Regression test for "stg import"
[stgit/ydirson.git] / t / t1400-patch-history.sh
blobcabd5e8bc9a2fb309b32d4956bf19fd2dc48538a
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 stg add test &&
24 stg refresh
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 foo | grep -q -e "^new" &&
39 stg log foo | grep -q -e "^refresh" &&
40 stg log | grep -q -e "^new" &&
41 stg log | grep -q -e "^refresh"
44 test_expect_success \
45 'Check the "push" log' \
47 stg pop &&
48 echo foo > test2 && stg add test2 && stg refresh &&
49 stg push &&
50 stg log | grep -q -e "^push "
53 test_expect_success \
54 'Check the "push(f)" log' \
56 stg pop &&
57 stg refresh -m "Foo2 Patch" &&
58 stg push &&
59 stg log | grep -q -e "^push(f) "
62 test_expect_success \
63 'Check the "push(m)" log' \
65 stg pop &&
66 echo foo2 > test && stg refresh &&
67 stg push &&
68 stg log | grep -q -e "^push(m) "
71 test_expect_success \
72 'Check the push "undo" log' \
74 stg push --undo &&
75 stg log bar | grep -q -e "^undo "
78 test_expect_success \
79 'Check the refresh "undo" log' \
81 stg refresh --undo &&
82 stg log | grep -q -e "^undo "
85 test_done