chiark
/
gitweb
/
~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix error in status.py when calling git.resolved
[stgit]
/
t
/
t2000-sync.sh
diff --git
a/t/t2000-sync.sh
b/t/t2000-sync.sh
index 02345bb0edfd7227e5fa8bd876f4ef8a6d7a3d24..e489603f3fa4d7d64c31cd52e17f8fd193242911 100755
(executable)
--- a/
t/t2000-sync.sh
+++ b/
t/t2000-sync.sh
@@
-18,18
+18,20
@@
test_expect_success \
'
stg new p1 -m p1 &&
echo foo1 > foo1.txt &&
'
stg new p1 -m p1 &&
echo foo1 > foo1.txt &&
-
stg
add foo1.txt &&
+
git
add foo1.txt &&
stg refresh &&
stg new p2 -m p2 &&
echo foo2 > foo2.txt &&
stg refresh &&
stg new p2 -m p2 &&
echo foo2 > foo2.txt &&
-
stg
add foo2.txt &&
+
git
add foo2.txt &&
stg refresh &&
stg new p3 -m p3 &&
echo foo3 > foo3.txt &&
stg refresh &&
stg new p3 -m p3 &&
echo foo3 > foo3.txt &&
-
stg
add foo3.txt &&
+
git
add foo3.txt &&
stg refresh &&
stg export &&
stg refresh &&
stg export &&
- stg pop
+ stg pop &&
+ [ "$(echo $(stg applied))" = "p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p3" ]
'
test_expect_success \
'
test_expect_success \
@@
-38,23
+40,26
@@
test_expect_success \
stg branch -c foo base &&
stg new p1 -m p1 &&
stg new p2 -m p2 &&
stg branch -c foo base &&
stg new p1 -m p1 &&
stg new p2 -m p2 &&
- stg new p3 -m p3
- test $(stg applied -c) -eq 3
+ stg new p3 -m p3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
- stg sync -b master p2 &&
- test $(stg applied -c) -eq 3 &&
+ stg sync -B master p2 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo2.txt) = "foo2"
'
test_expect_success \
'Synchronise the first two patches with the master branch' \
'
test $(cat foo2.txt) = "foo2"
'
test_expect_success \
'Synchronise the first two patches with the master branch' \
'
- stg sync -b master -a &&
- test $(stg applied -c) -eq 3 &&
+ stg sync -B master -a &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2"
'
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2"
'
@@
-63,7
+68,8
@@
test_expect_success \
'Synchronise all the patches with the exported series' \
'
stg sync -s patches-master/series -a &&
'Synchronise all the patches with the exported series' \
'
stg sync -s patches-master/series -a &&
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2" &&
test $(cat foo3.txt) = "foo3"
test $(cat foo1.txt) = "foo1" &&
test $(cat foo2.txt) = "foo2" &&
test $(cat foo3.txt) = "foo3"
@@
-73,16
+79,20
@@
test_expect_success \
'Modify the master patches' \
'
stg branch master &&
'Modify the master patches' \
'
stg branch master &&
+ [ "$(echo $(stg applied))" = "p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p3" ] &&
stg goto p1 &&
echo bar1 >> foo1.txt &&
stg refresh &&
stg goto p2 &&
echo bar2 > bar2.txt &&
stg goto p1 &&
echo bar1 >> foo1.txt &&
stg refresh &&
stg goto p2 &&
echo bar2 > bar2.txt &&
-
stg
add bar2.txt &&
+
git
add bar2.txt &&
stg refresh &&
stg goto p3 &&
echo bar3 >> foo3.txt &&
stg refresh &&
stg refresh &&
stg goto p3 &&
echo bar3 >> foo3.txt &&
stg refresh &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
stg export &&
stg branch foo
'
stg export &&
stg branch foo
'
@@
-90,38
+100,45
@@
test_expect_success \
test_expect_success \
'Synchronise second patch with the master branch' \
'
test_expect_success \
'Synchronise second patch with the master branch' \
'
- stg sync -b master p2 &&
- test $(stg applied -c) -eq 3 &&
+ stg sync -B master p2 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
test $(cat bar2.txt) = "bar2"
'
test $(cat bar2.txt) = "bar2"
'
-test_expect_
failure
\
+test_expect_
success
\
'Synchronise the first two patches with the master branch (to fail)' \
'
'Synchronise the first two patches with the master branch (to fail)' \
'
-
stg sync -b
master -a
+
! stg sync -B
master -a
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
- test $(stg applied -c) -eq 1 &&
+ [ "$(echo $(stg applied))" = "p1" ] &&
+ [ "$(echo $(stg unapplied))" = "p2 p3" ] &&
stg resolved -a &&
stg refresh &&
stg goto p3
stg resolved -a &&
stg refresh &&
stg goto p3
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]
'
'
-test_expect_
failure
\
+test_expect_
success
\
'Synchronise the third patch with the exported series (to fail)' \
'
'Synchronise the third patch with the exported series (to fail)' \
'
- stg sync -s patches-master/series p3
+
!
stg sync -s patches-master/series p3
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
'
test_expect_success \
'Restore the stack status after the failed sync' \
'
- test $(stg applied -c) -eq 3 &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ] &&
stg resolved -a &&
stg resolved -a &&
- stg refresh
+ stg refresh &&
+ [ "$(echo $(stg applied))" = "p1 p2 p3" ] &&
+ [ "$(echo $(stg unapplied))" = "" ]
'
test_done
'
test_done