forked from pool/quilt
49 lines
1.3 KiB
Diff
49 lines
1.3 KiB
Diff
|
From: Jean Delvare <jdelvare@suse.de>
|
||
|
Subject: edit: Use command "remove" to remove files
|
||
|
Upstream: Submitted (2011-02-11)
|
||
|
|
||
|
Commit f1c186ee renamed command "remove" to "revert". Commit bd1dfdab
|
||
|
changed the semantics of command "revert". Commit 6d2501ac restored
|
||
|
command "remove". However command "edit" is still calling command
|
||
|
"revert" to remove files from the patch when it should be using
|
||
|
command "remove".
|
||
|
|
||
|
This case was not covered by the test suite, which is why the bug was
|
||
|
not spotted earlier.
|
||
|
---
|
||
|
quilt/edit.in | 2 +-
|
||
|
test/edit.test | 11 +++++++++++
|
||
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
||
|
|
||
|
--- a/quilt/edit.in
|
||
|
+++ b/quilt/edit.in
|
||
|
@@ -71,7 +71,7 @@ for file in "$@"
|
||
|
do
|
||
|
if ! [ -e "$SUBDIR$file" ]
|
||
|
then
|
||
|
- quilt_command revert "$file"
|
||
|
+ quilt_command remove "$file"
|
||
|
status=1
|
||
|
fi
|
||
|
done
|
||
|
--- a/test/edit.test
|
||
|
+++ b/test/edit.test
|
||
|
@@ -37,6 +37,17 @@ $ quilt files
|
||
|
$ quilt refresh
|
||
|
> Refreshed patch patches/patch
|
||
|
|
||
|
+# Test the behavior if the editor is called on a new file but
|
||
|
+# does not actually create it
|
||
|
+$ cat > editor
|
||
|
+< #! /bin/sh
|
||
|
+< echo Doing nothing to $1
|
||
|
+
|
||
|
+$ quilt edit nofoo
|
||
|
+> File nofoo added to patch patches/patch
|
||
|
+> Doing nothing to nofoo
|
||
|
+> File nofoo removed from patch patches/patch
|
||
|
+
|
||
|
# Test the behavior if the editor creates a brand new file
|
||
|
$ cat > editor
|
||
|
< #! /bin/sh
|