Show More
@@ -68,7 +68,8 b' class dirstate(object):' | |||
|
68 | 68 | try: |
|
69 | 69 | syntax = syntaxes[s] |
|
70 | 70 | except KeyError: |
|
71 |
self.ui.warn(_("ignoring invalid |
|
|
71 | self.ui.warn(_(".hgignore: ignoring invalid " | |
|
72 | "syntax '%s'\n") % s) | |
|
72 | 73 | continue |
|
73 | 74 | pat = syntax + line |
|
74 | 75 | for s in syntaxes.values(): |
@@ -88,7 +89,8 b' class dirstate(object):' | |||
|
88 | 89 | ignore = self.hgignore() |
|
89 | 90 | if ignore: |
|
90 | 91 | files, self.ignorefunc, anypats = util.matcher(self.root, |
|
91 |
inc=ignore |
|
|
92 | inc=ignore, | |
|
93 | src='.hgignore') | |
|
92 | 94 | else: |
|
93 | 95 | self.ignorefunc = util.never |
|
94 | 96 | return self.ignorefunc(fn) |
@@ -191,17 +191,17 b' def canonpath(root, cwd, myname):' | |||
|
191 | 191 | else: |
|
192 | 192 | raise Abort('%s not under root' % myname) |
|
193 | 193 | |
|
194 | def matcher(canonroot, cwd='', names=['.'], inc=[], exc=[], head=''): | |
|
195 | return _matcher(canonroot, cwd, names, inc, exc, head, 'glob') | |
|
194 | def matcher(canonroot, cwd='', names=['.'], inc=[], exc=[], head='', src=None): | |
|
195 | return _matcher(canonroot, cwd, names, inc, exc, head, 'glob', src) | |
|
196 | 196 | |
|
197 | def cmdmatcher(canonroot, cwd='', names=['.'], inc=[], exc=[], head=''): | |
|
197 | def cmdmatcher(canonroot, cwd='', names=['.'], inc=[], exc=[], head='', src=None): | |
|
198 | 198 | if os.name == 'nt': |
|
199 | 199 | dflt_pat = 'glob' |
|
200 | 200 | else: |
|
201 | 201 | dflt_pat = 'relpath' |
|
202 | return _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat) | |
|
202 | return _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat, src) | |
|
203 | 203 | |
|
204 | def _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat): | |
|
204 | def _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat, src): | |
|
205 | 205 | """build a function to match a set of file patterns |
|
206 | 206 | |
|
207 | 207 | arguments: |
@@ -262,7 +262,8 b' def _matcher(canonroot, cwd, names, inc,' | |||
|
262 | 262 | pat = '(?:%s)' % regex(k, p, tail) |
|
263 | 263 | matches.append(re.compile(pat).match) |
|
264 | 264 | except re.error: |
|
265 | raise Abort("invalid pattern: %s:%s" % (k, p)) | |
|
265 | if src: raise Abort("%s: invalid pattern: %s:%s" % (src, k, p)) | |
|
266 | else: raise Abort("invalid pattern: %s:%s" % (k, p)) | |
|
266 | 267 | |
|
267 | 268 | def buildfn(text): |
|
268 | 269 | for m in matches: |
General Comments 0
You need to be logged in to leave comments.
Login now