[PATCH] guilt: improve patch header handling
[guilt/mob.git] / regression / t-051.sh
blob1066bece365247ddf2be99c93ccff2791300ee66
1 #!/bin/bash
3 # Test the commands that use get_*_series, while applying guards
6 source $REG_DIR/scaffold
8 cmd setup_repo
10 function fixup_time_info
12 touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
15 function std_tests
17 cmd list_files
18 cmd guilt-prev
19 cmd guilt-next
20 cmd guilt-applied
21 cmd guilt-unapplied
22 cmd list_files
25 # create a couple of dummy (empty) patches strategically placed thoughout
26 # the series
27 cmd guilt-new first
28 cmd guilt-push modify
29 cmd guilt-new second
30 cmd guilt-push add
31 cmd guilt-new third
32 cmd guilt-push remove
33 cmd guilt-new fourth
34 cmd guilt-push mode
35 cmd guilt-new fifth
36 cmd guilt-pop -a
37 fixup_time_info first
38 fixup_time_info second
39 fixup_time_info third
40 fixup_time_info fourth
41 fixup_time_info fifth
42 fixup_time_info modify
43 fixup_time_info add
44 fixup_time_info remove
45 fixup_time_info mode
47 p=first
49 # no guarded patches; no guards selected
50 cmd guilt-guard -l
51 cmd guilt-push -a
52 std_tests
53 cmd guilt-pop -a
54 cmd list_files
56 # no guarded patches; one guard selected
57 cmd guilt-select foo
58 cmd guilt-guard -l
59 cmd guilt-push -a
60 std_tests
61 cmd guilt-pop -a
62 cmd list_files
64 # one positive guarded patch; no guards selected
65 cmd guilt-select -n
66 cmd guilt-guard $p +foo
67 cmd guilt-guard -l
68 cmd guilt-push -a
69 std_tests
70 cmd guilt-pop -a
71 cmd list_files
73 # one positive guarded patch; that guard selected
74 cmd guilt-select foo
75 cmd guilt-guard -l
76 cmd guilt-push -a
77 std_tests
78 cmd guilt-pop -a
79 cmd list_files
81 # one positive guarded patch; different guard selected
82 cmd guilt-select -n
83 cmd guilt-select bar
84 cmd guilt-guard -l
85 cmd guilt-push -a
86 std_tests
87 cmd guilt-pop -a
88 cmd list_files
90 # one negative guarded patch; no guards selected
91 cmd guilt-select -n
92 cmd guilt-guard -l
93 cmd guilt-guard $p -foo
94 cmd guilt-guard -l
95 cmd guilt-push -a
96 std_tests
97 cmd guilt-pop -a
98 cmd list_files
100 # one negative guarded patch; that guard selected
101 cmd guilt-select foo
102 cmd guilt-guard -l
103 cmd guilt-push -a
104 std_tests
105 cmd guilt-pop -a
106 cmd list_files
108 # one negative guarded patch; different guard selected
109 cmd guilt-select -n
110 cmd guilt-select bar
111 cmd guilt-guard -l
112 cmd guilt-push -a
113 std_tests
114 cmd guilt-pop -a
115 cmd list_files