summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt.changes6
-rw-r--r--quilt/push.in2
-rw-r--r--test/half-applies.test44
3 files changed, 51 insertions, 1 deletions
diff --git a/quilt.changes b/quilt.changes
index 39d2a10..66f17d9 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Feb 14 04:51:24 CET 2006 - agruen@suse.de
+
+- Fix a critical bug in the push command that causes parts of
+ patches to end up half-reversed (introduced on 22 Jan).
+
+-------------------------------------------------------------------
Sun Feb 12 00:58:49 CET 2006 - agruen@suse.de
- lib/backup-files.c: Close files before rename; Windows won't
diff --git a/quilt/push.in b/quilt/push.in
index 9699efc..a6cf1e8 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -224,13 +224,13 @@ add_patch()
opt_reverse=1
if apply_patch $patch "$patch_file" > /dev/null 2> /dev/null
then
- rollback_patch $patch
printf $"Patch %s can be reverse-applied\n" \
"$(print_patch "$patch")"
else
printf $"Patch %s does not apply (enforce with -f)\n" \
"$(print_patch $patch)"
fi
+ rollback_patch $patch
rm -f $tmp
status=1
fi
diff --git a/test/half-applies.test b/test/half-applies.test
new file mode 100644
index 0000000..a0aba9c
--- /dev/null
+++ b/test/half-applies.test
@@ -0,0 +1,44 @@
+$ rm -rf d
+$ mkdir -p d/patches
+$ cd d
+
+$ echo foo > foo.orig
+$ echo foo2 > foo
+$ echo bar > bar.orig
+$ echo bar2 > bar
+$ diff -u foo.orig foo >> patches/foorab.diff
+$ diff -u bar bar.orig >> patches/foorab.diff
+$ mv foo.orig foo
+$ mv bar.orig bar
+$ echo foorab.diff -p0 > patches/series
+$ quilt push
+> Applying patch patches/foorab.diff
+> patching file foo
+> patching file bar
+> Hunk #1 FAILED at 1.
+> 1 out of 1 hunk FAILED -- rejects in file bar
+> Patch patches/foorab.diff does not apply (enforce with -f)
+
+$ quilt push
+> Applying patch patches/foorab.diff
+> patching file foo
+> patching file bar
+> Hunk #1 FAILED at 1.
+> 1 out of 1 hunk FAILED -- rejects in file bar
+> Patch patches/foorab.diff does not apply (enforce with -f)
+
+$ quilt push -qf
+> Applying patch patches/foorab.diff
+> 1 out of 1 hunk FAILED -- saving rejects to file bar.rej
+> Applied patch patches/foorab.diff (forced; needs refresh)
+
+$ quilt diff
+> Index: foo
+> ===================================================================
+> --- foo.orig
+> +++ foo
+> @@ -1 +1 @@
+> -foo
+> +foo2
+$ cd ..
+$ rm -rf d