Track the files conflict history
[stgit] / t / t1400-patch-history.sh
CommitLineData
64354a2d
CM
1#!/bin/sh
2#
3# Copyright (c) 2006 Catalin Marinas
4#
5
6test_description='Test the patch history generation.
7
8'
9
10. ./test-lib.sh
11
12test_expect_success \
13 'Initialize the StGIT repository' \
14 '
15 stg init
16 '
17
18test_expect_success \
19 'Create the first patch' \
20 '
21 stg new foo -m "Foo Patch" &&
22 echo foo > test && echo foo2 >> test &&
23 stg add test &&
24 stg refresh
25 '
26
27test_expect_success \
28 'Create the second patch' \
29 '
30 stg new bar -m "Bar Patch" &&
31 echo bar >> test &&
32 stg refresh
33 '
34
35test_expect_success \
36 'Check the "new" and "refresh" logs' \
37 '
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"
42 '
43
44test_expect_success \
45 'Check the "push" log' \
46 '
47 stg pop &&
48 echo foo > test2 && stg add test2 && stg refresh &&
49 stg push &&
50 stg log | grep -q -e "^push "
51 '
52
53test_expect_success \
54 'Check the "push(f)" log' \
55 '
56 stg pop &&
57 stg refresh -m "Foo2 Patch" &&
58 stg push &&
59 stg log | grep -q -e "^push(f) "
60 '
61
62test_expect_success \
63 'Check the "push(m)" log' \
64 '
65 stg pop &&
66 echo foo2 > test && stg refresh &&
67 stg push &&
68 stg log | grep -q -e "^push(m) "
69 '
70
71test_expect_success \
0f4eba6a
CM
72 'Check the "push(c)" log' \
73 '
74 echo bar > test && stg refresh &&
75 stg pop &&
76 echo foo > test && stg refresh &&
77 ! stg push &&
78 stg log | grep -q -e "^push(c) "
79 '
80
81test_expect_success \
64354a2d
CM
82 'Check the push "undo" log' \
83 '
0f4eba6a 84 stg status --reset &&
64354a2d
CM
85 stg push --undo &&
86 stg log bar | grep -q -e "^undo "
87 '
88
89test_expect_success \
90 'Check the refresh "undo" log' \
91 '
92 stg refresh --undo &&
93 stg log | grep -q -e "^undo "
94 '
95
96test_done