Debian Codegraph @

tests/test-status-terse.t

raw
1 $ mkdir folder
2 $ cd folder
3 $ hg init
4 $ mkdir x x/l x/m x/n x/l/u x/l/u/a
5 $ touch a b x/aa.o x/bb.o
6 $ hg status
7 ? a
8 ? b
9 ? x/aa.o
10 ? x/bb.o
11
12 $ hg status --terse u
13 ? a
14 ? b
15 ? x/
16 $ hg status --terse maudric
17 ? a
18 ? b
19 ? x/
20 $ hg status --terse madric
21 ? a
22 ? b
23 ? x/aa.o
24 ? x/bb.o
25 $ hg status --terse f
26 abort: 'f' not recognized
27 [10]
28
29 Add a .hgignore so that we can also have ignored files
30
31 $ echo ".*\.o" > .hgignore
32 $ hg status
33 ? .hgignore
34 ? a
35 ? b
36 $ hg status -i
37 I x/aa.o
38 I x/bb.o
39
40 Tersing ignored files
41 $ hg status -t i --ignored
42 I x/
43
44 Adding more files
45 $ mkdir y
46 $ touch x/aa x/bb y/l y/m y/l.o y/m.o
47 $ touch x/l/aa x/m/aa x/n/aa x/l/u/bb x/l/u/a/bb
48
49 $ hg status
50 ? .hgignore
51 ? a
52 ? b
53 ? x/aa
54 ? x/bb
55 ? x/l/aa
56 ? x/l/u/a/bb
57 ? x/l/u/bb
58 ? x/m/aa
59 ? x/n/aa
60 ? y/l
61 ? y/m
62
63 $ hg status --terse u
64 ? .hgignore
65 ? a
66 ? b
67 ? x/
68 ? y/
69
70 Run from subdirectory
71 $ hg status --terse u --cwd x/l
72 ? .hgignore
73 ? a
74 ? b
75 ? x/
76 ? y/
77 $ relstatus() {
78 > hg status --terse u --config commands.status.relative=1 "$@";
79 > }
80 This should probably have {"l/", "m/", "n/"} instead of {"."}. They should
81 probably come after "../y/".
82 $ relstatus --cwd x
83 ? ../.hgignore
84 ? ../a
85 ? ../b
86 ? .
87 ? ../y/
88 This should probably have {"u/", "../m/", "../n/"} instead of {"../"}.
89 $ relstatus --cwd x/l
90 ? ../../.hgignore
91 ? ../../a
92 ? ../../b
93 ? ../
94 ? ../../y/
95 This should probably have {"a/", "bb", "../aa", "../../m/", "../../n/"}
96 instead of {"../../"}.
97 $ relstatus --cwd x/l/u
98 ? ../../../.hgignore
99 ? ../../../a
100 ? ../../../b
101 ? ../../
102 ? ../../../y/
103 This should probably have {"bb", "../bb", "../../aa", "../../../m/",
104 "../../../n/"} instead of {"../../../"}.
105 $ relstatus --cwd x/l/u/a
106 ? ../../../../.hgignore
107 ? ../../../../a
108 ? ../../../../b
109 ? ../../../
110 ? ../../../../y/
111
112 $ hg add x/aa x/bb .hgignore
113 $ hg status --terse au
114 A .hgignore
115 A x/aa
116 A x/bb
117 ? a
118 ? b
119 ? x/l/
120 ? x/m/
121 ? x/n/
122 ? y/
123
124 Including ignored files
125
126 $ hg status --terse aui
127 A .hgignore
128 A x/aa
129 A x/bb
130 ? a
131 ? b
132 ? x/l/
133 ? x/m/
134 ? x/n/
135 ? y/l
136 ? y/m
137 $ hg status --terse au -i
138 I x/aa.o
139 I x/bb.o
140 I y/l.o
141 I y/m.o
142
143 Committing some of the files
144
145 $ hg commit x/aa x/bb .hgignore -m "First commit"
146 $ hg status
147 ? a
148 ? b
149 ? x/l/aa
150 ? x/l/u/a/bb
151 ? x/l/u/bb
152 ? x/m/aa
153 ? x/n/aa
154 ? y/l
155 ? y/m
156 $ hg status --terse mardu
157 ? a
158 ? b
159 ? x/l/
160 ? x/m/
161 ? x/n/
162 ? y/
163
164 Modifying already committed files
165
166 $ echo "Hello" >> x/aa
167 $ echo "World" >> x/bb
168 $ hg status --terse maurdc
169 M x/aa
170 M x/bb
171 ? a
172 ? b
173 ? x/l/
174 ? x/m/
175 ? x/n/
176 ? y/
177
178 Respecting other flags
179
180 $ hg status --terse marduic --all
181 M x/aa
182 M x/bb
183 ? a
184 ? b
185 ? x/l/
186 ? x/m/
187 ? x/n/
188 ? y/l
189 ? y/m
190 I x/aa.o
191 I x/bb.o
192 I y/l.o
193 I y/m.o
194 C .hgignore
195 $ hg status --terse marduic -a
196 $ hg status --terse marduic -c
197 C .hgignore
198 $ hg status --terse marduic -m
199 M x/aa
200 M x/bb
201
202 Passing 'i' in terse value will consider the ignored files while tersing
203
204 $ hg status --terse marduic -u
205 ? a
206 ? b
207 ? x/l/
208 ? x/m/
209 ? x/n/
210 ? y/l
211 ? y/m
212
213 Omitting 'i' in terse value does not consider ignored files while tersing
214
215 $ hg status --terse marduc -u
216 ? a
217 ? b
218 ? x/l/
219 ? x/m/
220 ? x/n/
221 ? y/
222
223 Trying with --rev
224
225 $ hg status --terse marduic --rev 0 --rev 1
226 abort: cannot use --terse with --rev
227 [10]
228
229 Config item to set the default terseness
230 $ cat <<EOF >> $HGRCPATH
231 > [commands]
232 > status.terse = u
233 > EOF
234 $ hg status -mu
235 M x/aa
236 M x/bb
237 ? a
238 ? b
239 ? x/l/
240 ? x/m/
241 ? x/n/
242 ? y/
243
244 Command line flag overrides the default
245 $ hg status --terse=
246 M x/aa
247 M x/bb
248 ? a
249 ? b
250 ? x/l/aa
251 ? x/l/u/a/bb
252 ? x/l/u/bb
253 ? x/m/aa
254 ? x/n/aa
255 ? y/l
256 ? y/m
257 $ hg status --terse=mardu
258 M x/aa
259 M x/bb
260 ? a
261 ? b
262 ? x/l/
263 ? x/m/
264 ? x/n/
265 ? y/
266
267 Specifying --rev should still work, with the terseness disabled.
268 $ hg status --rev 0
269 M x/aa
270 M x/bb
271 ? a
272 ? b
273 ? x/l/aa
274 ? x/l/u/a/bb
275 ? x/l/u/bb
276 ? x/m/aa
277 ? x/n/aa
278 ? y/l
279 ? y/m