[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH] Merge the two revert test cases
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH] Merge the two revert test cases |
Date: |
Tue, 10 Feb 2015 15:11:57 +0100 |
Merge the two revert test cases into a single, complete and commented
test file.
---
test/revert.test | 47 ++++++++++++++++++++++++++---------------------
test/revert2.test | 25 -------------------------
2 files changed, 26 insertions(+), 46 deletions(-)
--- quilt.orig/test/revert.test 2012-12-10 10:42:22.005822023 +0100
+++ quilt/test/revert.test 2015-02-10 10:12:45.844917704 +0100
@@ -11,40 +11,45 @@
> File sub/g added to patch patches/p.diff
> File sub/h added to patch patches/p.diff
- $ rm -f sub/g
$ echo h1 > sub/h
+ $ quilt revert sub/h
+ > Changes to sub/h in patch patches/p.diff reverted
+
+ $ quilt diff -z
+
+# Our patch modifies file f, deletes file g and creates file h
+ $ echo f2 > sub/f
+ $ rm -f sub/g
+ $ echo h2 > sub/h
$ quilt refresh
> Refreshed patch patches/p.diff
+# Check if we can revert modifications
$ cd sub
- $ echo f2 > f
- $ quilt revert f
+ $ echo f3 > f
+ $ echo h3 > h
+ $ quilt revert f g h
> Changes to sub/f in patch ../patches/p.diff reverted
+ > File sub/g is unchanged
+ > Changes to sub/h in patch ../patches/p.diff reverted
$ quilt diff -z
- $ quilt pop -qf
- > Removing patch ../patches/p.diff
- > No patches applied
-
- $ quilt push -q
- > Applying patch ../patches/p.diff
- > Now at patch ../patches/p.diff
- $ echo g2 > g
- $ quilt revert g
+# Check if we can revert file creation
+ $ echo g3 > g
+ $ quilt revert f g
+ > File sub/f is unchanged
> Changes to sub/g in patch ../patches/p.diff reverted
$ quilt diff -z
- $ quilt pop -qf
- > Removing patch ../patches/p.diff
- > No patches applied
-
- $ quilt push -q
- > Applying patch ../patches/p.diff
- > Now at patch ../patches/p.diff
+ $ [ ! -e g ] || echo "File sub/g shouldn't exist"
- $ echo h2 > h
- $ quilt revert h
+# Check if we can revert file deletion
+ $ rm f h
+ $ quilt revert f h
+ > Changes to sub/f in patch ../patches/p.diff reverted
> Changes to sub/h in patch ../patches/p.diff reverted
$ quilt diff -z
+ $ [ -e f ] || echo "File sub/f should exist"
+ $ [ -e h ] || echo "File sub/h should exist"
--- quilt.orig/test/revert2.test 2012-12-10 10:42:22.005822023 +0100
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,25 +0,0 @@
- $ mkdir patches
-
- $ quilt new revert.patch
- > Patch patches/revert.patch is now on top
-
- $ quilt add foo bar baz
- > File foo added to patch patches/revert.patch
- > File bar added to patch patches/revert.patch
- > File baz added to patch patches/revert.patch
-
- $ echo foo > foo
- $ echo bar > bar
- $ echo baz > baz
- $ quilt revert baz
- > Changes to baz in patch patches/revert.patch reverted
-
- $ quilt refresh
- > Refreshed patch patches/revert.patch
-
- $ echo will-revert > bar
- $ quilt revert bar
- > Changes to bar in patch patches/revert.patch reverted
-
- $ quilt refresh
- > Patch patches/revert.patch is unchanged
--
Jean Delvare
SUSE L3 Support
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Quilt-dev] [PATCH] Merge the two revert test cases,
Jean Delvare <=