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