debian/rules should be producing architecture independent packages
[stgit/dwhite.git] / t / t1400-patch-history.sh
blob13cd1e338e0cfc576288a7c04507a554bd06e5d8
1 #!/bin/sh
3 # Copyright (c) 2006 Catalin Marinas
6 test_description='Test the patch history generation.
10 . ./test-lib.sh
12 test_expect_success \
13 'Initialize the StGIT repository' \
15 stg init
18 test_expect_success \
19 'Create the first patch' \
21 stg new foo -m "Foo Patch" &&
22 echo foo > test && echo foo2 >> test &&
23 git add test &&
24 stg refresh --annotate="foo notes"
27 test_expect_success \
28 'Create the second patch' \
30 stg new bar -m "Bar Patch" &&
31 echo bar >> test &&
32 stg refresh
35 test_expect_success \
36 'Check the "new" and "refresh" logs' \
38 stg log --full foo | grep -q -e "^refresh" &&
39 stg log --full | grep -q -e "^refresh"
42 test_expect_success \
43 'Check the log annotation' \
45 stg log foo | grep -q -e "\[refresh\] foo notes " &&
46 stg log bar | grep -q -e "\[refresh\] " &&
47 stg refresh -p foo --annotate="foo notes 2" &&
48 stg log foo | grep -q -v -e "\[refresh\] foo notes " &&
49 stg log foo | grep -q -e "\[refresh\] foo notes 2"
52 test_expect_success \
53 'Check the "push" log' \
55 stg pop &&
56 echo foo > test2 && git add test2 && stg refresh &&
57 stg push &&
58 stg log --full | grep -q -e "^push "
61 test_expect_success \
62 'Check the "push(f)" log' \
64 stg pop &&
65 stg edit -m "Foo2 Patch" &&
66 stg push &&
67 stg log --full | grep -q -e "^push(f) "
70 test_expect_success \
71 'Check the "push(m)" log' \
73 stg pop &&
74 echo foo2 > test && stg refresh &&
75 stg push &&
76 stg log --full | grep -q -e "^push(m) "
79 test_expect_success \
80 'Check the "push(c)" log' \
82 echo bar > test && stg refresh &&
83 stg pop &&
84 echo foo > test && stg refresh &&
85 conflict_old stg push &&
86 stg log --full | grep -q -e "^push(c) "
89 test_expect_success \
90 'Check the push "undo" log' \
92 stg push --undo &&
93 stg log --full bar | grep -q -e "^undo "
96 test_expect_success \
97 'Check the refresh "undo" log' \
99 stg refresh --undo &&
100 stg log --full | grep -q -e "^undo "
103 test_done