From a8592ac4467b34abd9b0ffae9192163dc68112bc Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Sat, 13 Mar 2004 23:25:46 +0000 Subject: - Revert `quilt fork' to how it originally worked: fork the *topmost* patch, not the next unapplied patch. Adapt the test suite accordingly. - Add flag to backup-files.c to make sure that files in the working tree have a link count of at most one. Use this where appropriate. - Fix a bug in `quilt snapshot': Taking snapshots caused files to get link counts bigger than one, so modifying them could cause multiple files to get modified. Speed up the command, too. - Update the documentation. Add example1.test from the documentation. --- test/example1.test | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++ test/snapshot.test | 7 --- test/snapshot2.test | 8 --- 3 files changed, 138 insertions(+), 15 deletions(-) create mode 100644 test/example1.test (limited to 'test') diff --git a/test/example1.test b/test/example1.test new file mode 100644 index 0000000..031f334 --- /dev/null +++ b/test/example1.test @@ -0,0 +1,138 @@ +The text used here was taken from: +http://the-tech.mit.edu/Shakespeare/midsummer/full.html + + $ mkdir example1 + $ cd example1 + $ cat > Oberon.txt + < Yet mark'd I where the bolt of Cupid fell: + < It fell upon a little western flower, + < Before milk-white, now purple with love's wound, + < And girls call it love-in-idleness. + + $ quilt new flower.diff + > Patch flower.diff is now on top + + $ quilt add Oberon.txt + > File Oberon.txt added to patch flower.diff + + $ cat >> Oberon.txt + < The juice of it on sleeping eye-lids laid + < Will make a man or woman madly dote + < Upon the next live creature that it sees. + +Or ``quilt edit Oberon.txt'' + + $ quilt refresh + > Refreshed patch flower.diff + + $ cat patches/flower.diff | sed -e "s/\\t.*//" + > Index: example1/Oberon.txt + > =================================================================== + > --- example1.orig/Oberon.txt + > +++ example1/Oberon.txt + > @@ -2,3 +2,6 @@ + > It fell upon a little western flower, + > Before milk-white, now purple with love's wound, + > And girls call it love-in-idleness. + > +The juice of it on sleeping eye-lids laid + > +Will make a man or woman madly dote + > +Upon the next live creature that it sees. + + $ sed -e "4aFetch me that flower; the herb I shew'd thee once:" Oberon.txt > Oberon.new + $ mv Oberon.new Oberon.txt + $ quilt diff -z | sed -e "s/\\t.*//" + > Index: example1/Oberon.txt + > =================================================================== + > --- example1.orig/Oberon.txt + > +++ example1/Oberon.txt + > @@ -2,6 +2,7 @@ + > It fell upon a little western flower, + > Before milk-white, now purple with love's wound, + > And girls call it love-in-idleness. + > +Fetch me that flower; the herb I shew'd thee once: + > The juice of it on sleeping eye-lids laid + > Will make a man or woman madly dote + > Upon the next live creature that it sees. + + $ quilt diff | sed -e "s/\\t.*//" + > Index: example1/Oberon.txt + > =================================================================== + > --- example1.orig/Oberon.txt + > +++ example1/Oberon.txt + > @@ -2,3 +2,7 @@ + > It fell upon a little western flower, + > Before milk-white, now purple with love's wound, + > And girls call it love-in-idleness. + > +Fetch me that flower; the herb I shew'd thee once: + > +The juice of it on sleeping eye-lids laid + > +Will make a man or woman madly dote + > +Upon the next live creature that it sees. + + $ quilt refresh + > Refreshed patch flower.diff + + $ quilt top + > flower.diff + + $ quilt files + > Oberon.txt + + $ quilt patches Oberon.txt + > flower.diff + $ quilt pop -f + > Removing flower.diff + > Restoring Oberon.txt + > + > No patches applied + + $ sed -e "s/girls/maidens/" Oberon.txt > Oberon.new + $ mv Oberon.new Oberon.txt + $ quilt push + > Applying flower.diff + > patching file Oberon.txt + > Hunk #1 FAILED at 2. + > 1 out of 1 hunk FAILED -- rejects in file Oberon.txt + > Patch flower.diff does not apply (enforce with -f) + + $ quilt push -f + > Applying flower.diff + > patching file Oberon.txt + > Hunk #1 FAILED at 2. + > 1 out of 1 hunk FAILED -- saving rejects to file Oberon.txt.rej + > Applied flower.diff (forced; needs refresh) + + $ cat >> Oberon.txt + < Fetch me that flower; the herb I shew'd thee once: + < The juice of it on sleeping eye-lids laid + < Will make a man or woman madly dote + < Upon the next live creature that it sees. + + $ quilt refresh + > Refreshed patch flower.diff + + $ cat Oberon.txt + > Yet mark'd I where the bolt of Cupid fell: + > It fell upon a little western flower, + > Before milk-white, now purple with love's wound, + > And maidens call it love-in-idleness. + > Fetch me that flower; the herb I shew'd thee once: + > The juice of it on sleeping eye-lids laid + > Will make a man or woman madly dote + > Upon the next live creature that it sees. + + $ cat patches/flower.diff + > Index: example1/Oberon.txt + > =================================================================== + > --- example1.orig/Oberon.txt + > +++ example1/Oberon.txt + > @@ -2,3 +2,7 @@ + > It fell upon a little western flower, + > Before milk-white, now purple with love's wound, + > And maidens call it love-in-idleness. + > +Fetch me that flower; the herb I shew'd thee once: + > +The juice of it on sleeping eye-lids laid + > +Will make a man or woman madly dote + > +Upon the next live creature that it sees. + + $ cd .. + $ rm -rf example1 diff --git a/test/snapshot.test b/test/snapshot.test index 1c0abf6..f70003e 100644 --- a/test/snapshot.test +++ b/test/snapshot.test @@ -16,17 +16,10 @@ $ quilt refresh > Refreshed patch snapshot $ quilt snapshot - $ quilt pop -q - > Removing snapshot - > No patches applied $ quilt fork > Fork of snapshot created as snapshot-2 - $ quilt push -q - > Applying snapshot-2 - > Now at patch snapshot-2 - $ quilt remove g.txt > File g.txt removed from patch snapshot-2 diff --git a/test/snapshot2.test b/test/snapshot2.test index b0d91e7..0f993cc 100644 --- a/test/snapshot2.test +++ b/test/snapshot2.test @@ -17,17 +17,9 @@ $ quilt refresh > Refreshed patch snapshot $ quilt snapshot - $ quilt pop -q - > Removing snapshot - > No patches applied - $ quilt fork > Fork of snapshot created as snapshot-2 - $ quilt push -q - > Applying snapshot-2 - > Now at patch snapshot-2 - $ quilt remove g.txt > File d/g.txt removed from patch snapshot-2 -- cgit