comparison tests/test-walk.t @ 11799:ddebb6a690b4

tests: unify test-walk
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Thu, 12 Aug 2010 21:52:53 +0900
parents tests/test-walk@cfb4a51da7d5
children a4cc9e6f41c3
comparison
equal deleted inserted replaced
11798:1ab3d8977bdf 11799:ddebb6a690b4
1 $ mkdir t
2 $ cd t
3 $ hg init
4 $ mkdir -p beans
5 $ for b in kidney navy turtle borlotti black pinto; do
6 > echo $b > beans/$b
7 $ done
8 $ mkdir -p mammals/Procyonidae
9 $ for m in cacomistle coatimundi raccoon; do
10 > echo $m > mammals/Procyonidae/$m
11 $ done
12 $ echo skunk > mammals/skunk
13 $ echo fennel > fennel
14 $ echo fenugreek > fenugreek
15 $ echo fiddlehead > fiddlehead
16 $ echo glob:glob > glob:glob
17 $ hg addremove
18 adding beans/black
19 adding beans/borlotti
20 adding beans/kidney
21 adding beans/navy
22 adding beans/pinto
23 adding beans/turtle
24 adding fennel
25 adding fenugreek
26 adding fiddlehead
27 adding glob:glob
28 adding mammals/Procyonidae/cacomistle
29 adding mammals/Procyonidae/coatimundi
30 adding mammals/Procyonidae/raccoon
31 adding mammals/skunk
32 $ hg commit -m "commit #0" -d "1000000 0"
33
34 $ hg debugwalk
35 f beans/black beans/black
36 f beans/borlotti beans/borlotti
37 f beans/kidney beans/kidney
38 f beans/navy beans/navy
39 f beans/pinto beans/pinto
40 f beans/turtle beans/turtle
41 f fennel fennel
42 f fenugreek fenugreek
43 f fiddlehead fiddlehead
44 f glob:glob glob:glob
45 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
46 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
47 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
48 f mammals/skunk mammals/skunk
49 $ hg debugwalk -I.
50 f beans/black beans/black
51 f beans/borlotti beans/borlotti
52 f beans/kidney beans/kidney
53 f beans/navy beans/navy
54 f beans/pinto beans/pinto
55 f beans/turtle beans/turtle
56 f fennel fennel
57 f fenugreek fenugreek
58 f fiddlehead fiddlehead
59 f glob:glob glob:glob
60 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
61 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
62 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
63 f mammals/skunk mammals/skunk
64
65 $ cd mammals
66 $ hg debugwalk
67 f beans/black ../beans/black
68 f beans/borlotti ../beans/borlotti
69 f beans/kidney ../beans/kidney
70 f beans/navy ../beans/navy
71 f beans/pinto ../beans/pinto
72 f beans/turtle ../beans/turtle
73 f fennel ../fennel
74 f fenugreek ../fenugreek
75 f fiddlehead ../fiddlehead
76 f glob:glob ../glob:glob
77 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
78 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
79 f mammals/Procyonidae/raccoon Procyonidae/raccoon
80 f mammals/skunk skunk
81 $ hg debugwalk -X ../beans
82 f fennel ../fennel
83 f fenugreek ../fenugreek
84 f fiddlehead ../fiddlehead
85 f glob:glob ../glob:glob
86 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
87 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
88 f mammals/Procyonidae/raccoon Procyonidae/raccoon
89 f mammals/skunk skunk
90 $ hg debugwalk -I '*k'
91 f mammals/skunk skunk
92 $ hg debugwalk -I 'glob:*k'
93 f mammals/skunk skunk
94 $ hg debugwalk -I 'relglob:*k'
95 f beans/black ../beans/black
96 f fenugreek ../fenugreek
97 f mammals/skunk skunk
98 $ hg debugwalk -I 'relglob:*k' .
99 f mammals/skunk skunk
100 $ hg debugwalk -I 're:.*k$'
101 f beans/black ../beans/black
102 f fenugreek ../fenugreek
103 f mammals/skunk skunk
104 $ hg debugwalk -I 'relre:.*k$'
105 f beans/black ../beans/black
106 f fenugreek ../fenugreek
107 f mammals/skunk skunk
108 $ hg debugwalk -I 'path:beans'
109 f beans/black ../beans/black
110 f beans/borlotti ../beans/borlotti
111 f beans/kidney ../beans/kidney
112 f beans/navy ../beans/navy
113 f beans/pinto ../beans/pinto
114 f beans/turtle ../beans/turtle
115 $ hg debugwalk -I 'relpath:../beans'
116 f beans/black ../beans/black
117 f beans/borlotti ../beans/borlotti
118 f beans/kidney ../beans/kidney
119 f beans/navy ../beans/navy
120 f beans/pinto ../beans/pinto
121 f beans/turtle ../beans/turtle
122 $ hg debugwalk .
123 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
124 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
125 f mammals/Procyonidae/raccoon Procyonidae/raccoon
126 f mammals/skunk skunk
127 $ hg debugwalk -I.
128 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
129 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
130 f mammals/Procyonidae/raccoon Procyonidae/raccoon
131 f mammals/skunk skunk
132 $ hg debugwalk Procyonidae
133 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
134 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
135 f mammals/Procyonidae/raccoon Procyonidae/raccoon
136
137 $ cd Procyonidae
138 $ hg debugwalk .
139 f mammals/Procyonidae/cacomistle cacomistle
140 f mammals/Procyonidae/coatimundi coatimundi
141 f mammals/Procyonidae/raccoon raccoon
142 $ hg debugwalk ..
143 f mammals/Procyonidae/cacomistle cacomistle
144 f mammals/Procyonidae/coatimundi coatimundi
145 f mammals/Procyonidae/raccoon raccoon
146 f mammals/skunk ../skunk
147 $ cd ..
148
149 $ hg debugwalk ../beans
150 f beans/black ../beans/black
151 f beans/borlotti ../beans/borlotti
152 f beans/kidney ../beans/kidney
153 f beans/navy ../beans/navy
154 f beans/pinto ../beans/pinto
155 f beans/turtle ../beans/turtle
156 $ hg debugwalk .
157 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
158 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
159 f mammals/Procyonidae/raccoon Procyonidae/raccoon
160 f mammals/skunk skunk
161 $ hg debugwalk .hg
162 abort: path 'mammals/.hg' is inside repo 'mammals'
163 $ hg debugwalk ../.hg
164 abort: path contains illegal component: .hg
165 $ cd ..
166
167 $ hg debugwalk -Ibeans
168 f beans/black beans/black
169 f beans/borlotti beans/borlotti
170 f beans/kidney beans/kidney
171 f beans/navy beans/navy
172 f beans/pinto beans/pinto
173 f beans/turtle beans/turtle
174 $ hg debugwalk -I '{*,{b,m}*/*}k'
175 f beans/black beans/black
176 f fenugreek fenugreek
177 f mammals/skunk mammals/skunk
178 $ hg debugwalk 'glob:mammals/../beans/b*'
179 f beans/black beans/black
180 f beans/borlotti beans/borlotti
181 $ hg debugwalk '-X*/Procyonidae' mammals
182 f mammals/skunk mammals/skunk
183 $ hg debugwalk path:mammals
184 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
185 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
186 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
187 f mammals/skunk mammals/skunk
188 $ hg debugwalk ..
189 abort: .. not under root
190 $ hg debugwalk beans/../..
191 abort: beans/../.. not under root
192 $ hg debugwalk .hg
193 abort: path contains illegal component: .hg
194 $ hg debugwalk beans/../.hg
195 abort: path contains illegal component: .hg
196 $ hg debugwalk beans/../.hg/data
197 abort: path contains illegal component: .hg/data
198 $ hg debugwalk beans/.hg
199 abort: path 'beans/.hg' is inside repo 'beans'
200
201 Don't know how to test absolute paths without always getting a false
202 error.
203 # hg debugwalk `pwd`/beans
204 # hg debugwalk `pwd`/..
205
206 $ hg debugwalk glob:\*
207 f fennel fennel
208 f fenugreek fenugreek
209 f fiddlehead fiddlehead
210 f glob:glob glob:glob
211 $ hg debugwalk 'glob:**e'
212 f beans/turtle beans/turtle
213 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
214 $ hg debugwalk 're:.*[kb]$'
215 f beans/black beans/black
216 f fenugreek fenugreek
217 f glob:glob glob:glob
218 f mammals/skunk mammals/skunk
219 $ hg debugwalk path:beans/black
220 f beans/black beans/black exact
221 $ hg debugwalk path:beans//black
222 f beans/black beans/black exact
223 $ hg debugwalk relglob:Procyonidae
224 $ hg debugwalk 'relglob:Procyonidae/**'
225 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
226 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
227 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
228 $ hg debugwalk 'relglob:Procyonidae/**' fennel
229 f fennel fennel exact
230 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
231 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
232 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
233 $ hg debugwalk beans 'glob:beans/*'
234 f beans/black beans/black
235 f beans/borlotti beans/borlotti
236 f beans/kidney beans/kidney
237 f beans/navy beans/navy
238 f beans/pinto beans/pinto
239 f beans/turtle beans/turtle
240 $ hg debugwalk 'glob:mamm**'
241 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
242 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
243 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
244 f mammals/skunk mammals/skunk
245 $ hg debugwalk 'glob:mamm**' fennel
246 f fennel fennel exact
247 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
248 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
249 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
250 f mammals/skunk mammals/skunk
251 $ hg debugwalk 'glob:j*'
252 $ hg debugwalk NOEXIST
253 NOEXIST: No such file or directory
254
255 $ mkfifo fifo
256 $ hg debugwalk fifo
257 fifo: unsupported file type (type is fifo)
258
259 $ rm fenugreek
260 $ hg debugwalk fenugreek
261 f fenugreek fenugreek exact
262 $ hg rm fenugreek
263 $ hg debugwalk fenugreek
264 f fenugreek fenugreek exact
265 $ touch new
266 $ hg debugwalk new
267 f new new exact
268
269 $ mkdir ignored
270 $ touch ignored/file
271 $ echo '^ignored$' > .hgignore
272 $ hg debugwalk ignored
273 $ hg debugwalk ignored/file
274 f ignored/file ignored/file exact
275
276 $ cd ..
277 $ hg debugwalk -R t t/mammals/skunk
278 f mammals/skunk t/mammals/skunk exact
279 $ mkdir t2
280 $ cd t2
281 $ hg debugwalk -R ../t ../t/mammals/skunk
282 f mammals/skunk ../t/mammals/skunk exact
283 $ hg debugwalk --cwd ../t mammals/skunk
284 f mammals/skunk mammals/skunk exact