mercurial/hg.py
changeset 656 147d2fa2d766
parent 652 a54a1c101a9a
child 657 22bc6fb9aefc
--- 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))