series: Added -g option to start gitk
[guilt.git] / regression / 060-files.sh
blob915c73aeb36ca75767f233db368beb64d5329dfe
1 #!/bin/bash
3 # Test the series parsing code
6 source scaffold
7 source generic_test_data
9 # the test itself
10 empty_repo
11 cd $REPODIR
12 guilt-init
14 generic_prepare_for_tests
16 # create a patch that contains a file in a subdirectory
17 guilt-new subdir
18 mkdir blah
19 touch blah/sub
20 guilt-add blah/sub
21 guilt-refresh
23 function expected_files
25 echo "def"
28 function expected_files_label
30 echo "mode def"
33 function expected_files_verbose_label
35 echo "[mode] def"
38 function expected_files_all
40 echo "blah/sub"
41 echo "def"
42 echo "abd"
43 echo "abd"
44 echo "def"
47 function expected_files_label_all
49 echo "subdir blah/sub"
50 echo "modify def"
51 echo "add abd"
52 echo "remove abd"
53 echo "mode def"
56 function expected_files_verbose_all
58 echo "subdir"
59 echo "+ blah/sub"
60 echo "modify"
61 echo " def"
62 echo "add"
63 echo "+ abd"
64 echo "remove"
65 echo "- abd"
66 echo "mode"
67 echo " def"
70 function expected_files_verbose_label_all
72 echo "[subdir] blah/sub"
73 echo "[modify] def"
74 echo "[add] abd"
75 echo "[remove] abd"
76 echo "[mode] def"
80 # push em all for tesing
81 guilt-push -a > /dev/null
83 guilt-files > /tmp/reg.$$
84 expected_files | diff -u - /tmp/reg.$$
85 echo -n "[files] "
87 guilt-files -l > /tmp/reg.$$
88 expected_files_label | diff -u - /tmp/reg.$$
89 echo -n "[label] "
91 guilt-files -v -l > /tmp/reg.$$
92 expected_files_verbose_label | diff -u - /tmp/reg.$$
93 echo -n "[verbose label] "
95 guilt-files -a > /tmp/reg.$$
96 expected_files_all | diff -u - /tmp/reg.$$
97 echo -n "[all] "
99 guilt-files -l -a > /tmp/reg.$$
100 expected_files_label_all | diff -u - /tmp/reg.$$
101 echo -n "[label all] "
103 guilt-files -v -a > /tmp/reg.$$
104 expected_files_verbose_all | diff -u - /tmp/reg.$$
105 echo -n "[verbose all] "
107 guilt-files -v -l -a > /tmp/reg.$$
108 expected_files_verbose_label_all | diff -u - /tmp/reg.$$
109 echo -n "[verbose label all] "
111 rm -f /tmp/reg.$$
113 complete_test