Guilt v0.32-rc2
[guilt.git] / regression / t-051.sh
blob4cb5d155539961a8b806bd07b928c065c6a39acc
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 -d "$GIT_COMMITTER_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
43 p=first
45 # no guarded patches; no guards selected
46 cmd guilt-guard -l
47 cmd guilt-push -a
48 std_tests
49 cmd guilt-pop -a
50 cmd list_files
52 # no guarded patches; one guard selected
53 cmd guilt-select foo
54 cmd guilt-guard -l
55 cmd guilt-push -a
56 std_tests
57 cmd guilt-pop -a
58 cmd list_files
60 # one positive guarded patch; no guards selected
61 cmd guilt-select -n
62 cmd guilt-guard $p +foo
63 cmd guilt-guard -l
64 cmd guilt-push -a
65 std_tests
66 cmd guilt-pop -a
67 cmd list_files
69 # one positive guarded patch; that guard selected
70 cmd guilt-select foo
71 cmd guilt-guard -l
72 cmd guilt-push -a
73 std_tests
74 cmd guilt-pop -a
75 cmd list_files
77 # one positive guarded patch; different guard selected
78 cmd guilt-select -n
79 cmd guilt-select bar
80 cmd guilt-guard -l
81 cmd guilt-push -a
82 std_tests
83 cmd guilt-pop -a
84 cmd list_files
86 # one negative guarded patch; no guards selected
87 cmd guilt-select -n
88 cmd guilt-guard -l
89 cmd guilt-guard $p -foo
90 cmd guilt-guard -l
91 cmd guilt-push -a
92 std_tests
93 cmd guilt-pop -a
94 cmd list_files
96 # one negative guarded patch; that guard selected
97 cmd guilt-select foo
98 cmd guilt-guard -l
99 cmd guilt-push -a
100 std_tests
101 cmd guilt-pop -a
102 cmd list_files
104 # one negative guarded patch; different guard selected
105 cmd guilt-select -n
106 cmd guilt-select bar
107 cmd guilt-guard -l
108 cmd guilt-push -a
109 std_tests
110 cmd guilt-pop -a
111 cmd list_files