summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-04-13 13:04:06 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-04-13 13:04:06 +0000
commite5cbacaf5622ad6d80bd314984eeed40f62cc08e (patch)
tree0bfbd5cbefd93757da1d52ed6579849e88fdb9e8 /test
parent0979b44e26ec23ab0445e7271932eba04fa604bb (diff)
downloadquilt-e5cbacaf5622ad6d80bd314984eeed40f62cc08e.tar.gz
- Add --sort options to the diff and refresh commands which
sorts files by filename. The default is to keep files in their original order whenever possible. - refresh command: add new files in sort order instead of the filesystem order. - diff command: output files in the order in which they show up in the patch instead of sorting them alphabetically. - Add sort testcase.
Diffstat (limited to 'test')
-rw-r--r--test/fold.test12
-rw-r--r--test/sort.test52
2 files changed, 58 insertions, 6 deletions
diff --git a/test/fold.test b/test/fold.test
index cdd2e5d..1b26924 100644
--- a/test/fold.test
+++ b/test/fold.test
@@ -36,18 +36,18 @@
$ quilt fold -q < patches/patch2.diff
$ quilt diff | sed -e "s/\\t.*//"
- > Index: d/dir/file3.txt
- > ===================================================================
- > --- /dev/null
- > +++ d/dir/file3.txt
- > @@ -0,0 +1 @@
- > +This is file3.txt.
> Index: d/file1.txt
> ===================================================================
> --- /dev/null
> +++ d/file1.txt
> @@ -0,0 +1 @@
> +This is file1.txt.
+ > Index: d/dir/file3.txt
+ > ===================================================================
+ > --- /dev/null
+ > +++ d/dir/file3.txt
+ > @@ -0,0 +1 @@
+ > +This is file3.txt.
$ cd ..
$ rm -rf d
diff --git a/test/sort.test b/test/sort.test
new file mode 100644
index 0000000..0e0a23f
--- /dev/null
+++ b/test/sort.test
@@ -0,0 +1,52 @@
+ $ mkdir d
+ $ cd d
+
+ $ quilt new sort.diff
+ > Patch patches/sort.diff is now on top
+
+ $ quilt add b c
+ > File b added to patch patches/sort.diff
+ > File c added to patch patches/sort.diff
+
+ $ echo b > b
+ $ echo c > c
+ $ quilt refresh
+ > Refreshed patch patches/sort.diff
+
+ $ quilt add a
+ > File a added to patch patches/sort.diff
+
+ $ echo a > a
+ $ quilt files
+ > b
+ > c
+ > a
+
+ $ quilt diff | grep ^Index
+ > Index: d/b
+ > Index: d/c
+ > Index: d/a
+
+ $ quilt refresh
+ > Refreshed patch patches/sort.diff
+
+ $ grep ^Index patches/sort.diff
+ > Index: d/b
+ > Index: d/c
+ > Index: d/a
+
+ $ quilt diff --sort | grep ^Index
+ > Index: d/a
+ > Index: d/b
+ > Index: d/c
+
+ $ quilt refresh --sort
+ > Refreshed patch patches/sort.diff
+
+ $ grep ^Index patches/sort.diff
+ > Index: d/a
+ > Index: d/b
+ > Index: d/c
+
+ $ cd ..
+ $ rm -rf d