comparison mercurial/hg.py @ 656:147d2fa2d766

Warn about bogus ignore expressions -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Warn about bogus ignore expressions manifest hash: 7beb33a1f0879a1d2457953187a523417bc7a101 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFC0IPqywK+sNU5EO8RAsOdAJ0bFxZoUjSk/BxWZ9C50SlxlDBlBQCeKbu0 QVzZZKIFlDRVWOsi8zfamHA= =zAVL -----END PGP SIGNATURE-----
author Matt Mackall <mpm@selenic.com>
date Sat, 09 Jul 2005 18:11:54 -0800
parents a54a1c101a9a
children 22bc6fb9aefc
comparison
equal deleted inserted replaced
655:b3bba126b04a 656:147d2fa2d766
502 bigpat = [] 502 bigpat = []
503 try: 503 try:
504 l = file(self.wjoin(".hgignore")) 504 l = file(self.wjoin(".hgignore"))
505 for pat in l: 505 for pat in l:
506 if pat != "\n": 506 if pat != "\n":
507 bigpat.append(util.pconvert(pat[:-1])) 507 p = util.pconvert(pat[:-1])
508 try:
509 r = re.compile(p)
510 except:
511 self.ui.warn("ignoring invalid ignore"
512 + " regular expression '%s'\n" % p)
513 else:
514 bigpat.append(util.pconvert(pat[:-1]))
508 except IOError: pass 515 except IOError: pass
509 if bigpat: 516 if bigpat:
510 s = "(?:%s)" % (")|(?:".join(bigpat)) 517 s = "(?:%s)" % (")|(?:".join(bigpat))
511 r = re.compile(s) 518 r = re.compile(s)
512 self.ignorefunc = r.search 519 self.ignorefunc = r.search