changeset 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 b3bba126b04a
children 22bc6fb9aefc
files mercurial/hg.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Fri Jul 08 18:10:57 2005 -0800
+++ b/mercurial/hg.py	Sat Jul 09 18:11:54 2005 -0800
@@ -504,7 +504,14 @@
                 l = file(self.wjoin(".hgignore"))
                 for pat in l:
                     if pat != "\n":
-                        bigpat.append(util.pconvert(pat[:-1]))
+                        p = util.pconvert(pat[:-1])
+                        try:
+                            r = re.compile(p)
+                        except:
+                            self.ui.warn("ignoring invalid ignore"
+                                         + " regular expression '%s'\n" % p)
+                        else:
+                            bigpat.append(util.pconvert(pat[:-1]))
             except IOError: pass
             if bigpat:
                 s = "(?:%s)" % (")|(?:".join(bigpat))