summaryrefslogtreecommitdiffstats
path: root/test/two.test
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-01-28 01:36:39 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-01-28 01:36:39 +0000
commit78aa77c7415f569ad964d8b5b03ddb048f90beee (patch)
treea8e3645f5bf1b705d7db5b9df4045f9efa54464c /test/two.test
parent74367691ed6938fb64ee66df6c9db99d6b1870f9 (diff)
downloadquilt-78aa77c7415f569ad964d8b5b03ddb048f90beee.tar.gz
- Add a few more test cases for subdirectory support.
- Fix a few bugs introduced while merging Chris's patch.
Diffstat (limited to 'test/two.test')
-rw-r--r--test/two.test157
1 files changed, 157 insertions, 0 deletions
diff --git a/test/two.test b/test/two.test
new file mode 100644
index 0000000..4d48467
--- /dev/null
+++ b/test/two.test
@@ -0,0 +1,157 @@
+(To run, type `./run two.test' in this directory.)
+
+ $ mkdir -p d/patches d/d
+ $ cd d/d
+ $ mkdir dir
+ $ echo "This is file one." > dir/file1
+ $ quilt new patch1.diff
+ > Patch patch1 is now on top
+
+ $ quilt add dir/file1
+ > File d/dir/file1 added to patch patch1
+
+ $ quilt add file2
+ > File d/file2 added to patch patch1
+
+ $ quilt diff
+ $ quilt diff -z
+ $ quilt refresh
+ > Nothing in patch patch1
+
+ $ echo "This is file two." > file2
+ $ quilt diff | sed -e "s/\\t.*//"
+ > Index: d/d/file2
+ > ===================================================================
+ > --- d.orig/d/file2
+ > +++ d/d/file2
+ > @@ -0,0 +1 @@
+ > +This is file two.
+
+ $ quilt diff -z | sed -e "s/\\t.*//"
+ > Index: d/d/file2
+ > ===================================================================
+ > --- d.orig/d/file2
+ > +++ d/d/file2
+ > @@ -0,0 +1 @@
+ > +This is file two.
+
+ $ quilt refresh
+ > Refreshed patch patch1
+
+ $ quilt diff -z
+ $ echo "Another line has been added." >> dir/file1
+ $ quilt diff -z | sed -e "s/\\t.*//"
+ > Index: d/d/dir/file1
+ > ===================================================================
+ > --- d.orig/d/dir/file1
+ > +++ d/d/dir/file1
+ > @@ -1 +1,2 @@
+ > This is file one.
+ > +Another line has been added.
+
+ $ cd dir
+ $ quilt diff -z file1
+ > Index: d/d/dir/file1
+ > ===================================================================
+ > --- d.orig/d/dir/file1
+ > +++ d/d/dir/file1
+ > @@ -1 +1,2 @@
+ > This is file one.
+ > +Another line has been added.
+
+ $ cd ..
+
+ $ quilt refresh
+ > Refreshed patch patch1
+
+ $ quilt new patch2.diff
+ > Patch patch2 is now on top
+
+ $ quilt add dir/file3
+ > File d/dir/file3 added to patch patch2
+
+ $ echo "This is file three." > dir/file3
+ $ quilt refresh
+ > Refreshed patch patch2
+
+ $ quilt add -p patch1 dir/file3
+ > File d/dir/file3 modified by patch patch2
+
+ $ quilt pop -R
+ > Removing patch2
+ > Removing d/dir/file3
+ >
+ > Now at patch patch1
+
+ $ quilt add file4
+ > File d/file4 added to patch patch1
+
+ $ echo "This is file 4." > file4
+ $ quilt refresh
+ > Refreshed patch patch1
+
+ $ quilt push
+ > Applying patch2
+ > patching file d/dir/file3
+ >
+ > Now at patch patch2
+
+ $ quilt new subdir/patch3.diff
+ > Patch subdir/patch3 is now on top
+
+ $ quilt add file4
+ > File d/file4 added to patch subdir/patch3
+
+ $ rm file4
+ $ quilt diff | sed -e "s/\\t.*//"
+ > Index: d/d/file4
+ > ===================================================================
+ > --- d.orig/d/file4
+ > +++ d/d/file4
+ > @@ -1 +0,0 @@
+ > -This is file 4.
+
+ $ quilt add -p patch2 file4
+ > File d/file4 modified by patch subdir/patch3
+
+ $ quilt refresh
+ > Refreshed patch subdir/patch3
+
+ $ echo "Another line here, too." >> dir/file3
+ $ quilt refresh patch2
+ > Refreshed patch patch2
+
+ $ echo "Another line added." >> file2
+ $ quilt diff -z -P patch1 | sed -e "s/\\t.*//"
+ > Index: d/d/file2
+ > ===================================================================
+ > --- d.orig/d/file2
+ > +++ d/d/file2
+ > @@ -1 +1,2 @@
+ > This is file two.
+ > +Another line added.
+ > More recent patches modify files in patch1.
+
+ $ quilt refresh patch1
+ > More recent patches modify files in patch1. Enforce refresh with -f.
+
+ $ quilt refresh -f patch1
+ > Refreshed patch patch1
+
+ $ echo "Another line here, too." >> dir/file3
+ $ quilt pop -R
+ > Removing subdir/patch3
+ > Restoring d/file4
+ >
+ > Now at patch patch2
+
+ $ quilt refresh patch2
+ > Refreshed patch patch2
+
+ $ quilt pop -qaR
+ > Removing patch2
+ > Removing patch1
+ > No patches applied
+
+ $ cd ../..
+ $ rm -rf d