From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGit PATCH 2/8] New test: "stg pop --keep"
Date: Mon, 08 Oct 2007 01:17:24 +0200 [thread overview]
Message-ID: <20071007231724.12626.57217.stgit@yoghurt> (raw)
In-Reply-To: <20071007231446.12626.14259.stgit@yoghurt>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
t/t1204-pop-keep.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
create mode 100755 t/t1204-pop-keep.sh
diff --git a/t/t1204-pop-keep.sh b/t/t1204-pop-keep.sh
new file mode 100755
index 0000000..40cd2a2
--- /dev/null
+++ b/t/t1204-pop-keep.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+test_description='Test "stg pop -keep"'
+. ./test-lib.sh
+stg init
+
+test_expect_success 'Create a few patches' '
+ for i in 0 1 2; do
+ stg new p$i -m p$i &&
+ echo "patch$i" >> patch$i.txt &&
+ stg add patch$i.txt &&
+ stg refresh
+ done &&
+ [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]
+'
+
+test_expect_success 'Make some non-conflicting local changes' '
+ echo "local" >> patch0.txt
+'
+
+test_expect_success 'Pop two patches, keeping local changes' '
+ stg pop -n 2 --keep &&
+ [ "$(echo $(stg applied))" = "p0" ] &&
+ [ "$(echo $(stg unapplied))" = "p1 p2" ] &&
+ [ "$(echo $(ls patch?.txt))" = "patch0.txt" ] &&
+ [ "$(echo $(cat patch0.txt))" = "patch0 local" ]
+'
+
+test_expect_success 'Reset and push patches again' '
+ git reset --hard &&
+ stg push -a
+'
+
+test_expect_success 'Pop a patch without local changes' '
+ stg pop --keep &&
+ [ "$(echo $(stg applied))" = "p0 p1" ] &&
+ [ "$(echo $(stg unapplied))" = "p2" ] &&
+ [ "$(echo $(ls patch?.txt))" = "patch0.txt patch1.txt" ]
+'
+
+test_done
next prev parent reply other threads:[~2007-10-07 23:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-07 23:17 [StGit PATCH 0/8] Miscellaneous fixes and improvements Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 1/8] Add --ack/--sign options to "stg new" Karl Hasselström
2007-10-07 23:17 ` Karl Hasselström [this message]
2007-10-07 23:17 ` [StGit PATCH 3/8] Fix up the help text for "stg edit" Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 4/8] Don't split long and short description in " Karl Hasselström
2007-10-07 23:40 ` David Brown
2007-10-08 6:41 ` Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 5/8] Make a common superclass for all StGit exceptions Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 6/8] Simplify debug level error checking Karl Hasselström
2007-10-07 23:17 ` [StGit PATCH 7/8] Discard stderr output from git-rev-parse Karl Hasselström
2007-10-07 23:18 ` [StGit PATCH 8/8] Remove the --force flag to "stg rebase" and "stg pull" Karl Hasselström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071007231724.12626.57217.stgit@yoghurt \
--to=kha@treskal.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.