##// END OF EJS Templates
change relglob: patterns to be consistent with glob: patterns...
Alexis S. L. Carvalho -
r4307:702f4857 default
parent child Browse files
Show More
@@ -436,7 +436,7 b' def _matcher(canonroot, cwd, names, inc,'
436 elif kind == 'path':
436 elif kind == 'path':
437 return '^' + re.escape(name) + '(?:/|$)'
437 return '^' + re.escape(name) + '(?:/|$)'
438 elif kind == 'relglob':
438 elif kind == 'relglob':
439 return globre(name, '(?:|.*/)', '(?:/|$)')
439 return globre(name, '(?:|.*/)', tail)
440 elif kind == 'relpath':
440 elif kind == 'relpath':
441 return re.escape(name) + '(?:/|$)'
441 return re.escape(name) + '(?:/|$)'
442 elif kind == 'relre':
442 elif kind == 'relre':
@@ -19,6 +19,8 b' mkdir t'
19 echo 0 > t/x
19 echo 0 > t/x
20 echo 0 > t/b
20 echo 0 > t/b
21 echo 0 > t/e.h
21 echo 0 > t/e.h
22 mkdir dir.h
23 echo 0 > dir.h/foo
22 hg ci -A -m m -d "1000000 0"
24 hg ci -A -m m -d "1000000 0"
23 touch nottracked
25 touch nottracked
24 hglocate a && echo locate succeeded || echo locate failed
26 hglocate a && echo locate succeeded || echo locate failed
@@ -39,14 +41,14 b' hglocate -I ../t'
39 # test issue294
41 # test issue294
40 cd ..
42 cd ..
41 rm -r t
43 rm -r t
42 hglocate t
44 hglocate 't/**'
43 mkdir otherdir
45 mkdir otherdir
44 cd otherdir
46 cd otherdir
45 hglocate b
47 hglocate b
46 hglocate '*.h'
48 hglocate '*.h'
47 hglocate path:t/x
49 hglocate path:t/x
48 hglocate 're:.*\.h'
50 hglocate 're:.*\.h$'
49 hglocate -r 0 b
51 hglocate -r 0 b
50 hglocate -r 0 '*.h'
52 hglocate -r 0 '*.h'
51 hglocate -r 0 path:t/x
53 hglocate -r 0 path:t/x
52 hglocate -r 0 're:.*\.h'
54 hglocate -r 0 're:.*\.h$'
@@ -1,5 +1,6 b''
1 adding a
1 adding a
2 adding b
2 adding b
3 adding dir.h/foo
3 adding t.h
4 adding t.h
4 adding t/b
5 adding t/b
5 adding t/e.h
6 adding t/e.h
@@ -14,6 +15,7 b' locate failed'
14 hg locate
15 hg locate
15 a
16 a
16 b
17 b
18 dir.h/foo
17 t.h
19 t.h
18 t/b
20 t/b
19 t/e.h
21 t/e.h
@@ -25,6 +27,7 b' hg locate NONEXISTENT'
25
27
26 hg locate
28 hg locate
27 b
29 b
30 dir.h/foo
28 t.h
31 t.h
29 t/b
32 t/b
30 t/e.h
33 t/e.h
@@ -38,6 +41,7 b' hg locate -r 0 NONEXISTENT'
38 hg locate -r 0
41 hg locate -r 0
39 a
42 a
40 b
43 b
44 dir.h/foo
41 t.h
45 t.h
42 t/b
46 t/b
43 t/e.h
47 t/e.h
@@ -46,6 +50,7 b' t/x'
46 % -I/-X with relative path should work
50 % -I/-X with relative path should work
47 hg locate
51 hg locate
48 b
52 b
53 dir.h/foo
49 t.h
54 t.h
50 t/b
55 t/b
51 t/e.h
56 t/e.h
@@ -56,7 +61,7 b' t/b'
56 t/e.h
61 t/e.h
57 t/x
62 t/x
58
63
59 hg locate t
64 hg locate t/**
60 t/b
65 t/b
61 t/e.h
66 t/e.h
62 t/x
67 t/x
@@ -72,7 +77,7 b' hg locate *.h'
72 hg locate path:t/x
77 hg locate path:t/x
73 ../t/x
78 ../t/x
74
79
75 hg locate re:.*\.h
80 hg locate re:.*\.h$
76 ../t.h
81 ../t.h
77 ../t/e.h
82 ../t/e.h
78
83
@@ -87,7 +92,7 b' hg locate -r 0 *.h'
87 hg locate -r 0 path:t/x
92 hg locate -r 0 path:t/x
88 ../t/x
93 ../t/x
89
94
90 hg locate -r 0 re:.*\.h
95 hg locate -r 0 re:.*\.h$
91 ../t.h
96 ../t.h
92 ../t/e.h
97 ../t/e.h
93
98
@@ -77,7 +77,8 b" debugwalk 're:.*[kb]$'"
77 debugwalk path:beans/black
77 debugwalk path:beans/black
78 debugwalk path:beans//black
78 debugwalk path:beans//black
79 debugwalk relglob:Procyonidae
79 debugwalk relglob:Procyonidae
80 debugwalk relglob:Procyonidae/ fennel
80 debugwalk 'relglob:Procyonidae/**'
81 debugwalk 'relglob:Procyonidae/**' fennel
81 debugwalk beans 'glob:beans/*'
82 debugwalk beans 'glob:beans/*'
82 debugwalk 'glob:mamm**'
83 debugwalk 'glob:mamm**'
83 debugwalk 'glob:mamm**' fennel
84 debugwalk 'glob:mamm**' fennel
@@ -232,11 +232,13 b' hg debugwalk path:beans//black'
232 f beans/black beans/black exact
232 f beans/black beans/black exact
233
233
234 hg debugwalk relglob:Procyonidae
234 hg debugwalk relglob:Procyonidae
235
236 hg debugwalk relglob:Procyonidae/**
235 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
237 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
236 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
238 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
237 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
239 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
238
240
239 hg debugwalk relglob:Procyonidae/ fennel
241 hg debugwalk relglob:Procyonidae/** fennel
240 f fennel fennel exact
242 f fennel fennel exact
241 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
243 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
242 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
244 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
General Comments 0
You need to be logged in to leave comments. Login now