[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [patch 2/6] select/merge documentation on import
From: |
jayvdb |
Subject: |
[Quilt-dev] [patch 2/6] select/merge documentation on import |
Date: |
Tue, 27 Sep 2005 19:19:24 +1000 |
User-agent: |
quilt/0.42-1 |
Adds tests for errors:
is already applied
is not in series
is not applied
No patches applied (other than for quilt pop, which has 18 existing tests)
Adds tests for commands
next
previous
applied
unapplied
top (1 existing test)
import
original description
test/three.test | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
test/import.test | 138 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 291 insertions(+)
--- /dev/null
+++ quilt-files/test/three.test
@@ -0,0 +1,153 @@
+
+ $ rm -rf d
+ $ mkdir -p d/patches
+ $ cd d
+
+ $ touch e
+ $ quilt annotate e
+ $ quilt top
+ $ quilt next
+ $ quilt previous
+ $ quilt unapplied
+ $ quilt applied
+
+ $ quilt next patch1
+ > Patch patch1 is not in series
+
+ $ quilt push patch1
+ > Patch patch1 is not in series
+
+ $ quilt push
+ > No patches applied
+
+ $ quilt pop
+ > No patch removed
+
+ $ quilt new patch1.diff
+ > Patch %{P}patch1.diff is now on top
+
+ $ quilt top
+ > patches/patch1.diff
+
+ $ quilt add f
+ > File f added to patch %{P}patch1.diff
+
+ $ echo f > f
+
+ $ ls %{P}
+ > series
+
+ $ quilt new patch2.diff
+ > Patch %{P}patch2.diff is now on top
+
+ $ quilt previous
+ > patches/patch1.diff
+
+ $ quilt add g
+ > File g added to patch %{P}patch2.diff
+
+ $ echo g > g
+
+ $ quilt refresh
+ > Refreshed patch %{P}patch2.diff
+
+ $ quilt pop
+ > Removing patch patches/patch2.diff
+ > Removing g
+ >
+ > Now at patch patches/patch1.diff
+
+ $ ls %{P}
+ > patch2.diff
+ > series
+
+ $ quilt next
+ > patches/patch2.diff
+
+ $ quilt previous
+ $ quilt previous patch2
+ > patches/patch1.diff
+
+ $ quilt pop
+ > Patch %{P}patch1.diff does not remove cleanly (refresh it or enforce
with -f)
+
+ $ quilt refresh
+ > Refreshed patch %{P}patch1.diff
+
+ $ quilt refresh patch2
+ > Patch patches/patch2.diff is not applied
+
+ $ quilt pop
+ > Removing patch patches/patch1.diff
+ > Removing f
+ >
+ > No patches applied
+
+ $ quilt top
+ $ quilt pop
+ > No patch removed
+
+ $ quilt applied
+ $ quilt unapplied
+ > patches/patch1.diff
+ > patches/patch2.diff
+
+ $ quilt previous
+ $ quilt next
+ > patches/patch1.diff
+
+ $ quilt applied patch1
+ > Patch is not applied
+
+ $ quilt unapplied patch2
+ $ quilt unapplied patch1
+ > patches/patch2.diff
+
+ $ quilt remove f
+ > No patches applied
+
+ $ quilt delete patch3.diff
+ > Patch patch3.diff is not in series
+
+ $ quilt push -qa
+ > Applying patch patches/patch1.diff
+ > Applying patch patches/patch2.diff
+ > Now at patch patches/patch2.diff
+
+ $ quilt push patch2
+ > Patch patches/patch2.diff is already applied
+
+ $ quilt push
+ > File series fully applied, ends at patch patches/patch2.diff
+
+ $ quilt diff --combine patch1 -P patch2
+ > Index: d/f
+ > ===================================================================
+ > --- /dev/null
+ > +++ d/f
+ > @@ -0,0 +1 @@
+ > +f
+ > Index: d/g
+ > ===================================================================
+ > --- /dev/null
+ > +++ d/g
+ > @@ -0,0 +1 @@
+ > +g
+
+ $ quilt diff -P patch1 --combine patch2
+ > Patch patches/patch2.diff not applied before patch patches/patch1.diff
+
+ $ echo patch3.diff >> %{P}/series
+ $ quilt diff -P patch1 --combine patch3
+ > Patch patches/patch3.diff not applied before patch patches/patch1.diff
+
+ $ quilt pop -qaR
+ > Removing patch %{P}patch2.diff
+ > Removing patch %{P}patch1.diff
+ > No patches applied
+
+ $ quilt annotate f
+ > sed: can't read f: No such file or directory
+
+ $ cd ../..
+ $ rm -rf d
--- /dev/null
+++ quilt-files/test/import.test
@@ -0,0 +1,138 @@
+
+ $ rm -rf d
+ $ mkdir -p d/patches
+ $ cd d
+
+ $ quilt new patch1.diff
+ > Patch %{P}patch1.diff is now on top
+
+ $ quilt add f
+ > File f added to patch %{P}patch1.diff
+
+ $ echo f > f
+
+ $ quilt refresh
+ > Refreshed patch %{P}patch1.diff
+
+ $ quilt pop
+ > Removing patch patches/patch1.diff
+ > Removing f
+ >
+ > No patches applied
+
+ $ mkdir t
+ $ mv patches/patch1.diff t/patch1.diff
+
+ # test importing into an empty series
+ $ rm -rf patches/ .pc/
+ $ mkdir patches
+ $ quilt import t/patch1.diff
+ > Importing patch patches/t/patch1.diff (stored as patches/patch1.diff)
+
+ $ quilt push
+ > Applying patch patches/patch1.diff
+ > patching file f
+ >
+ > Now at patch patches/patch1.diff
+
+ $ quilt new patch2.diff
+ > Patch %{P}patch2.diff is now on top
+
+ $ quilt add g
+ > File g added to patch %{P}patch2.diff
+
+ $ echo g > g
+
+ $ quilt refresh
+ > Refreshed patch %{P}patch2.diff
+
+ $ quilt pop
+ > Removing patch patches/patch2.diff
+ > Removing g
+ >
+ > Now at patch patches/patch1.diff
+
+ $ quilt header -a
+ < original description
+ > Appended text to header of patch patches/patch1.diff
+
+ $ quilt pop
+ > Removing patch patches/patch1.diff
+ > Removing f
+ >
+ > No patches applied
+
+ $ quilt delete patch1
+ > Removed patch patches/patch1.diff
+
+ $ cat %{P}series
+ > patch2.diff
+
+ # test a few error cases
+
+ $ quilt import missing.diff
+ > Importing patch patches/missing.diff (stored as patches/missing.diff)
+ > cp: cannot stat `missing.diff': No such file or directory
+ > Failed to import patch patches/missing.diff
+
+ $ quilt import patches/patch1.diff
+ > Patch patches/patch1.diff exists. Replace with -f.
+
+ $ quilt import -f patches/patch1.diff
+ > Replacing patch patches/patch1.diff with new version
+ > cp: `patches/patch1.diff' and `patches/patch1.diff' are the same file
+ > Failed to import patch patches/patch1.diff
+
+ # no real damage has been done
+
+ $ cat patches/patch1.diff
+ > original description
+ > Index: d/f
+ > ===================================================================
+ > --- /dev/null
+ > +++ d/f
+ > @@ -0,0 +1 @@
+ > +f
+
+ # a simple use of import
+
+ $ sed -e 's/original/new/' patches/patch1.diff > t/patch1.diff
+ $ quilt import t/patch1.diff
+ > Patch patches/patch1.diff exists. Replace with -f.
+
+ $ quilt import -f t/patch1.diff
+ > Replacing patch patches/patch1.diff with new version
+
+ $ ls patches/
+ > patch1.diff
+ > patch2.diff
+ > series
+
+ $ quilt header patch1
+ > new description
+
+ $ quilt delete patch1
+ > Removed patch patches/patch1.diff
+
+ # make sure it accepts non-conflicting names
+ # a small presentation problem here
+
+ $ cp patches/patch1.diff t/patch1.patch
+ $ quilt import t/patch1.patch
+ > Importing patch patches/t/patch1.patch (stored as
patches/patch1.patch)
+
+ $ ls patches/
+ > patch1.diff
+ > patch1.patch
+ > patch2.diff
+ > series
+
+ $ cat %{P}series
+ > patch1.patch
+ > patch2.diff
+
+ $ quilt delete patch1.diff
+ > Patch patch1.diff is not in series
+
+ $ cd ../..
+ $ rm -rf d
--
John
- [Quilt-dev] [patch 0/6] select/merge documentation on import, jayvdb, 2005/09/26
- [Quilt-dev] [patch 6/6] select/merge documentation on import, jayvdb, 2005/09/26
- [Quilt-dev] [patch 1/6] select/merge documentation on import, jayvdb, 2005/09/26
- [Quilt-dev] [patch 4/6] select/merge documentation on import, jayvdb, 2005/09/26
- [Quilt-dev] [patch 5/6] select/merge documentation on import, jayvdb, 2005/09/26
- [Quilt-dev] [patch 3/6] select/merge documentation on import, jayvdb, 2005/09/26
- [Quilt-dev] [patch 2/6] select/merge documentation on import,
jayvdb <=