summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-10-23 23:07:03 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-10-23 23:07:03 +0000
commit5a15736543bbfe6263c608e57840e3c0eb4e5a03 (patch)
tree8cd84872ddbb2a189b210e5aecda2c21ddf63337
parent815520d0deef50a9dc30bd8367c3a1c794b2f688 (diff)
downloadquilt-5a15736543bbfe6263c608e57840e3c0eb4e5a03.tar.gz
- `quilt add': Return exit code 2 when a file has already been added.
- Add `quilt edit' command: Does a `quilt add' and then invokes $EDITOR (fallback is `vi'). Files that don't exist after editing are again removed from the patch.
-rw-r--r--Makefile.in2
-rw-r--r--quilt.changes9
-rw-r--r--quilt/add.in2
-rw-r--r--quilt/edit.in68
4 files changed, 79 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in
index 360792e..27d2210 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -57,7 +57,7 @@ DIRT += $(BIN_IN:%=bin/%)
QUILT_IN := add applied delete diff files import new next patches \
pop previous push refresh remove series setup top unapplied \
- fork snapshot
+ fork snapshot edit
QUILT_SRC := $(QUILT_IN:%=%.in)
QUILT := $(QUILT_IN)
diff --git a/quilt.changes b/quilt.changes
index 7a8614c..9cb0efa 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Fri Oct 24 00:50:08 CEST 2003 - agruen@suse.de
+
+- `quilt add': Return exit code 2 when a file has already been
+ added.
+- Add `quilt edit' command: Does a `quilt add' and then invokes
+ $EDITOR (fallback is `vi'). Files that don't exist after editing
+ are again removed from the patch.
+
+-------------------------------------------------------------------
Wed Oct 22 01:44:04 CEST 2003 - agruen@suse.de
- `Quilt fork' should better fork the next patch instead of the
diff --git a/quilt/add.in b/quilt/add.in
index 5b1d932..b6074f7 100644
--- a/quilt/add.in
+++ b/quilt/add.in
@@ -87,7 +87,7 @@ do
if file_in_patch $file $patch
then
echo $"File $file is already in patch $patch"
- status=1
+ status=2
continue
fi
next_patch=$(next_patch_for_file $patch $file)
diff --git a/quilt/edit.in b/quilt/edit.in
new file mode 100644
index 0000000..4385015
--- /dev/null
+++ b/quilt/edit.in
@@ -0,0 +1,68 @@
+#! @BASH@
+
+# This script is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# See the COPYING and AUTHORS files for more details.
+
+: ${EDITOR:=vi}
+
+usage()
+{
+ echo $"Usage: quilt edit file ..."
+ if [ x$1 = x-h ]
+ then
+ echo $"
+
+Edit the specified file(s) in $EDITOR after adding it (them) to the
+topmost patch.
+"
+ exit 0
+ else
+ exit 1
+ fi
+}
+
+options=`getopt -o h -- "$@"`
+
+if [ $? -ne 0 ]
+then
+ usage
+fi
+
+eval set -- "$options"
+
+while true
+do
+ case "$1" in
+ -h)
+ usage -h ;;
+ --)
+ shift
+ break ;;
+ esac
+done
+
+if [ $# -eq 0 ]
+then
+ usage
+fi
+
+bash -c ". @QUILT@/add" "quilt add" "$@"
+$EDITOR "$@"
+status=$?
+for file in "$@"
+do
+ if ! [ -e "$file" ]
+ then
+ bash -c ". @QUILT@/remove" "quilt remove" "$file"
+ status=1
+ fi
+done
+
+exit $status
+### Local Variables:
+### mode: shell-script
+### End:
+# vim:filetype=sh