comparison mercurial/util.py @ 1454:f4250806dbeb

further fix traceback on invalid .hgignore patterns Please apply this little fix (matchfn return None if no patterns are specified).
author Benoit Boissinot <mercurial-bugs@selenic.com>
date Wed, 26 Oct 2005 16:10:56 -0700
parents 4babaa52badf
children 1a3c6689ef2b
comparison
equal deleted inserted replaced
1453:6fbb13b7a59f 1454:f4250806dbeb
244 return '.*' + name 244 return '.*' + name
245 return head + globre(name, '', tail) 245 return head + globre(name, '', tail)
246 246
247 def matchfn(pats, tail): 247 def matchfn(pats, tail):
248 """build a matching function from a set of patterns""" 248 """build a matching function from a set of patterns"""
249 if not pats:
250 return
249 matches = [] 251 matches = []
250 for k, p in pats: 252 for k, p in pats:
251 try: 253 try:
252 pat = '(?:%s)' % regex(k, p, tail) 254 pat = '(?:%s)' % regex(k, p, tail)
253 matches.append(re.compile(pat).match) 255 matches.append(re.compile(pat).match)