Memorialize Python 3.7 support
[stgit.git] / t / t3400-pick.sh
blob22b348ca3ea5a8dcdd3e3aa71e7e14f4446097e3
1 #!/bin/sh
2 test_description='Test the pick command'
4 . ./test-lib.sh
6 test_expect_success \
7 'Initialize the StGIT repository' \
9 stg init &&
10 stg new A -m "a" && echo A > a && stg add a && stg refresh &&
11 stg new B -m "b" && echo B > b && stg add b && stg refresh &&
12 stg branch --clone foo &&
13 stg new C -m "c" && echo C > c && stg add c && stg refresh &&
14 stg new D-foo -m "d" && echo D > d && stg add d && stg refresh &&
15 stg branch master
18 test_expect_success \
19 'Pick remote patch' \
21 stg pick foo:C &&
22 test "$(echo $(stg series --applied --noprefix))" = "A B C"
25 test_expect_success \
26 'Pick --unapplied remote patch' \
28 stg pick --unapplied --ref-branch foo --name D D-foo &&
29 test "$(echo $(stg series --applied --noprefix))" = "A B C" &&
30 test "$(echo $(stg series --unapplied --noprefix))" = "D"
33 test_expect_success \
34 'Pick local unapplied patch' \
36 stg pick D &&
37 test "$(echo $(stg series --applied --noprefix))" = "A B C D-0" &&
38 test "$(echo $(stg series --unapplied --noprefix))" = "D"
41 test_expect_success \
42 'Pick --fold --revert local patch' \
44 stg pick --fold --revert D &&
45 stg refresh && stg clean &&
46 test "$(echo $(stg series --applied --noprefix))" = "A B C" &&
47 test "$(echo $(stg series --unapplied --noprefix))" = "D"
50 test_expect_success \
51 'Pick --fold without applied patches' \
53 stg pop --all &&
54 stg pick --fold D &&
55 test "$(echo $(stg series --unapplied --noprefix))" = "A B C D" &&
56 test "$(echo $(stg status))" = "A d"
59 test_done