summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-10-27 13:41:38 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-10-27 13:41:38 +0000
commit78d1cc782538f84b7c089c42c3e99e71ef2143b3 (patch)
treedbb7c17a69de67f20f731cce29460e48729dd8a9 /test
parent412fd50be59afe85f04125cee2d56a3f20e394ef (diff)
downloadquilt-78d1cc782538f84b7c089c42c3e99e71ef2143b3.tar.gz
Add a new test case for conflicts while pushing.
Diffstat (limited to 'test')
-rw-r--r--test/conflicts.test139
1 files changed, 139 insertions, 0 deletions
diff --git a/test/conflicts.test b/test/conflicts.test
new file mode 100644
index 0000000..1b16f36
--- /dev/null
+++ b/test/conflicts.test
@@ -0,0 +1,139 @@
+This test case creates a patch and then applies that patch to a modified
+source file. The source file is modified until the patch doesn't apply
+anymore, then the patch is fixed.
+
+ $ mkdir d
+ $ cd d
+
+ $ cat > one.txt
+ < 1
+ < 2
+ < 3
+ < 4
+ < 5
+ < 6
+ < 7
+ < --
+ < a
+ < b
+ < c
+ < d
+ < e
+ < f
+ < g
+
+ $ quilt new a.diff
+ > Patch a is now on top
+
+ $ quilt add one.txt
+ > File one.txt added to patch a
+
+ $ mv one.txt one.orig
+ $ sed -e "s/4/4+/" -e 's/d/d+/' one.orig > one.txt
+ $ quilt refresh
+ > Refreshed patch a
+
+ $ quilt pop -q
+ > Removing a
+ > No patches applied
+
+
+ $ sed -e "s/^\\([17]\\)\$/\\1-/" one.orig > one.txt
+ $ quilt push -q
+ > Applying a
+ > Now at patch a
+
+ $ quilt pop -q
+ > Removing a
+ > No patches applied
+
+ $ sed -e "s/^\\([1267]\\)\$/\\1-/" one.orig > one.txt
+ $ quilt push -q
+ > Applying a
+ > Now at patch a
+
+ $ quilt pop -q
+ > Removing a
+ > No patches applied
+
+
+ $ sed -e "s/^\\([123567]\\)\$/\\1-/" one.orig > one.txt
+ $ quilt push -q
+ > Applying a
+ > 1 out of 2 hunks FAILED -- saving rejects to file one.txt.rej
+ > Patch a does not apply (enforce with -f)
+
+ $ quilt push -qf
+ > Applying a
+ > 1 out of 2 hunks FAILED -- saving rejects to file one.txt.rej
+ > Applied a (forced; needs refresh)
+
+ $ mv one.txt one.x
+ $ sed -e "s/4/4+/" one.x > one.txt
+ $ rm one.x
+ $ quilt diff -z | grep -v "^\\(---\\|+++\\)"
+ > Index: d/one.txt
+ > ===================================================================
+ > @@ -1,7 +1,7 @@
+ > 1-
+ > 2-
+ > 3-
+ > -4
+ > +4+
+ > 5-
+ > 6-
+ > 7-
+
+ $ quilt diff | grep -v "^\\(---\\|+++\\)"
+ > Index: d/one.txt
+ > ===================================================================
+ > @@ -1,7 +1,7 @@
+ > 1-
+ > 2-
+ > 3-
+ > -4
+ > +4+
+ > 5-
+ > 6-
+ > 7-
+ > @@ -9,7 +9,7 @@
+ > a
+ > b
+ > c
+ > -d
+ > +d+
+ > e
+ > f
+ > g
+
+ $ quilt refresh
+ > Refreshed patch a
+
+ $ cat patches/a.diff | grep -v "^\\(---\\|+++\\)"
+ > Index: d/one.txt
+ > ===================================================================
+ > @@ -1,7 +1,7 @@
+ > 1-
+ > 2-
+ > 3-
+ > -4
+ > +4+
+ > 5-
+ > 6-
+ > 7-
+ > @@ -9,7 +9,7 @@
+ > a
+ > b
+ > c
+ > -d
+ > +d+
+ > e
+ > f
+ > g
+
+ $ quilt pop -q
+ > Removing a
+ > No patches applied
+
+ $ cd ..
+ $ rm -rf d