##// END OF EJS Templates
match: remove unnecessary '^' from regexes...
Martin von Zweigbergk -
r33357:a21819f4 default
parent child Browse files
Show More
@@ -797,7 +797,7 b' def _regex(kind, pat, globsuffix):'
797 797 if kind == 'path':
798 798 if pat == '.':
799 799 return ''
800 return '^' + util.re.escape(pat) + '(?:/|$)'
800 return util.re.escape(pat) + '(?:/|$)'
801 801 if kind == 'rootfilesin':
802 802 if pat == '.':
803 803 escaped = ''
@@ -805,7 +805,7 b' def _regex(kind, pat, globsuffix):'
805 805 # Pattern is a directory name.
806 806 escaped = util.re.escape(pat) + '/'
807 807 # Anything after the pattern must be a non-directory.
808 return '^' + escaped + '[^/]+$'
808 return escaped + '[^/]+$'
809 809 if kind == 'relglob':
810 810 return '(?:|.*/)' + _globre(pat) + globsuffix
811 811 if kind == 'relpath':
@@ -109,7 +109,7 b''
109 109 f fenugreek ../fenugreek
110 110 f mammals/skunk skunk
111 111 $ hg debugwalk -I 'path:beans'
112 matcher: <includematcher includes='(?:^beans(?:/|$))'>
112 matcher: <includematcher includes='(?:beans(?:/|$))'>
113 113 f beans/black ../beans/black
114 114 f beans/borlotti ../beans/borlotti
115 115 f beans/kidney ../beans/kidney
@@ -126,27 +126,27 b''
126 126 f beans/turtle ../beans/turtle
127 127
128 128 $ hg debugwalk 'rootfilesin:'
129 matcher: <patternmatcher patterns='(?:^[^/]+$)'>
129 matcher: <patternmatcher patterns='(?:[^/]+$)'>
130 130 f fennel ../fennel
131 131 f fenugreek ../fenugreek
132 132 f fiddlehead ../fiddlehead
133 133 $ hg debugwalk -I 'rootfilesin:'
134 matcher: <includematcher includes='(?:^[^/]+$)'>
134 matcher: <includematcher includes='(?:[^/]+$)'>
135 135 f fennel ../fennel
136 136 f fenugreek ../fenugreek
137 137 f fiddlehead ../fiddlehead
138 138 $ hg debugwalk 'rootfilesin:.'
139 matcher: <patternmatcher patterns='(?:^[^/]+$)'>
139 matcher: <patternmatcher patterns='(?:[^/]+$)'>
140 140 f fennel ../fennel
141 141 f fenugreek ../fenugreek
142 142 f fiddlehead ../fiddlehead
143 143 $ hg debugwalk -I 'rootfilesin:.'
144 matcher: <includematcher includes='(?:^[^/]+$)'>
144 matcher: <includematcher includes='(?:[^/]+$)'>
145 145 f fennel ../fennel
146 146 f fenugreek ../fenugreek
147 147 f fiddlehead ../fiddlehead
148 148 $ hg debugwalk -X 'rootfilesin:'
149 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:^[^/]+$)'>>
149 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:[^/]+$)'>>
150 150 f beans/black ../beans/black
151 151 f beans/borlotti ../beans/borlotti
152 152 f beans/kidney ../beans/kidney
@@ -158,15 +158,15 b''
158 158 f mammals/Procyonidae/raccoon Procyonidae/raccoon
159 159 f mammals/skunk skunk
160 160 $ hg debugwalk 'rootfilesin:fennel'
161 matcher: <patternmatcher patterns='(?:^fennel/[^/]+$)'>
161 matcher: <patternmatcher patterns='(?:fennel/[^/]+$)'>
162 162 $ hg debugwalk -I 'rootfilesin:fennel'
163 matcher: <includematcher includes='(?:^fennel/[^/]+$)'>
163 matcher: <includematcher includes='(?:fennel/[^/]+$)'>
164 164 $ hg debugwalk 'rootfilesin:skunk'
165 matcher: <patternmatcher patterns='(?:^skunk/[^/]+$)'>
165 matcher: <patternmatcher patterns='(?:skunk/[^/]+$)'>
166 166 $ hg debugwalk -I 'rootfilesin:skunk'
167 matcher: <includematcher includes='(?:^skunk/[^/]+$)'>
167 matcher: <includematcher includes='(?:skunk/[^/]+$)'>
168 168 $ hg debugwalk 'rootfilesin:beans'
169 matcher: <patternmatcher patterns='(?:^beans/[^/]+$)'>
169 matcher: <patternmatcher patterns='(?:beans/[^/]+$)'>
170 170 f beans/black ../beans/black
171 171 f beans/borlotti ../beans/borlotti
172 172 f beans/kidney ../beans/kidney
@@ -174,7 +174,7 b''
174 174 f beans/pinto ../beans/pinto
175 175 f beans/turtle ../beans/turtle
176 176 $ hg debugwalk -I 'rootfilesin:beans'
177 matcher: <includematcher includes='(?:^beans/[^/]+$)'>
177 matcher: <includematcher includes='(?:beans/[^/]+$)'>
178 178 f beans/black ../beans/black
179 179 f beans/borlotti ../beans/borlotti
180 180 f beans/kidney ../beans/kidney
@@ -182,19 +182,19 b''
182 182 f beans/pinto ../beans/pinto
183 183 f beans/turtle ../beans/turtle
184 184 $ hg debugwalk 'rootfilesin:mammals'
185 matcher: <patternmatcher patterns='(?:^mammals/[^/]+$)'>
185 matcher: <patternmatcher patterns='(?:mammals/[^/]+$)'>
186 186 f mammals/skunk skunk
187 187 $ hg debugwalk -I 'rootfilesin:mammals'
188 matcher: <includematcher includes='(?:^mammals/[^/]+$)'>
188 matcher: <includematcher includes='(?:mammals/[^/]+$)'>
189 189 f mammals/skunk skunk
190 190 $ hg debugwalk 'rootfilesin:mammals/'
191 matcher: <patternmatcher patterns='(?:^mammals/[^/]+$)'>
191 matcher: <patternmatcher patterns='(?:mammals/[^/]+$)'>
192 192 f mammals/skunk skunk
193 193 $ hg debugwalk -I 'rootfilesin:mammals/'
194 matcher: <includematcher includes='(?:^mammals/[^/]+$)'>
194 matcher: <includematcher includes='(?:mammals/[^/]+$)'>
195 195 f mammals/skunk skunk
196 196 $ hg debugwalk -X 'rootfilesin:mammals'
197 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:^mammals/[^/]+$)'>>
197 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:mammals/[^/]+$)'>>
198 198 f beans/black ../beans/black
199 199 f beans/borlotti ../beans/borlotti
200 200 f beans/kidney ../beans/kidney
@@ -320,7 +320,7 b''
320 320 matcher: <differencematcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:[^/]*\\/Procyonidae(?:/|$))'>>
321 321 f mammals/skunk mammals/skunk
322 322 $ hg debugwalk path:mammals
323 matcher: <patternmatcher patterns='(?:^mammals(?:/|$))'>
323 matcher: <patternmatcher patterns='(?:mammals(?:/|$))'>
324 324 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
325 325 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
326 326 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
@@ -383,7 +383,7 b' Test patterns:'
383 383 matcher: <patternmatcher patterns='(?:glob\\:glob$)'>
384 384 f glob:glob glob:glob exact
385 385 $ hg debugwalk path:glob:glob
386 matcher: <patternmatcher patterns='(?:^glob\\:glob(?:/|$))'>
386 matcher: <patternmatcher patterns='(?:glob\\:glob(?:/|$))'>
387 387 f glob:glob glob:glob exact
388 388 $ rm glob:glob
389 389 $ hg addremove
@@ -402,10 +402,10 b' Test patterns:'
402 402 f mammals/skunk mammals/skunk
403 403
404 404 $ hg debugwalk path:beans/black
405 matcher: <patternmatcher patterns='(?:^beans\\/black(?:/|$))'>
405 matcher: <patternmatcher patterns='(?:beans\\/black(?:/|$))'>
406 406 f beans/black beans/black exact
407 407 $ hg debugwalk path:beans//black
408 matcher: <patternmatcher patterns='(?:^beans\\/black(?:/|$))'>
408 matcher: <patternmatcher patterns='(?:beans\\/black(?:/|$))'>
409 409 f beans/black beans/black exact
410 410
411 411 $ hg debugwalk relglob:Procyonidae
General Comments 0
You need to be logged in to leave comments. Login now