3 # Copyright (c) 2006 Catalin Marinas
6 test_description
='Test the patch history generation.
13 'Initialize the StGIT repository' \
19 'Create the first patch' \
21 stg new foo -m "Foo Patch" &&
22 echo foo > test && echo foo2 >> test &&
24 stg refresh --annotate="foo notes"
28 'Create the second patch' \
30 stg new bar -m "Bar Patch" &&
36 'Check the "new" and "refresh" logs' \
38 stg log --full foo | grep -q -e "^new" &&
39 stg log --full foo | grep -q -e "^refresh" &&
40 stg log --full | grep -q -e "^new" &&
41 stg log --full | grep -q -e "^refresh"
45 'Check the log annotation' \
47 stg log foo | grep -q -e "\[refresh\] foo notes " &&
48 stg log bar | grep -q -e "\[refresh\] " &&
49 stg refresh -p foo --annotate="foo notes 2" &&
50 stg log foo | grep -q -v -e "\[refresh\] foo notes " &&
51 stg log foo | grep -q -e "\[refresh\] foo notes 2"
55 'Check the "push" log' \
58 echo foo > test2 && stg add test2 && stg refresh &&
60 stg log --full | grep -q -e "^push "
64 'Check the "push(f)" log' \
67 stg refresh -m "Foo2 Patch" &&
69 stg log --full | grep -q -e "^push(f) "
73 'Check the "push(m)" log' \
76 echo foo2 > test && stg refresh &&
78 stg log --full | grep -q -e "^push(m) "
82 'Check the "push(c)" log' \
84 echo bar > test && stg refresh &&
86 echo foo > test && stg refresh &&
88 stg log --full | grep -q -e "^push(c) "
92 'Check the push "undo" log' \
95 stg log --full bar | grep -q -e "^undo "
99 'Check the refresh "undo" log' \
101 stg refresh --undo &&
102 stg log --full | grep -q -e "^undo "