diff mercurial/ignore.py @ 5029:ac97e065cfc7

Fix re: and glob: patterns in .hgignore (reported by Brad Schick) relglob: and relre: were already detected for a long time, so I kept this undocumented functionality, especially as it was already tested in test-hgignore.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 30 Jul 2007 20:01:16 +0200
parents b43f17691ae6
children fae670ee6c6d
line wrap: on
line diff
--- a/mercurial/ignore.py
+++ b/mercurial/ignore.py
@@ -57,10 +57,13 @@ def ignore(root, files, warn):
                         warn(_("%s: ignoring invalid syntax '%s'\n") % (f, s))
                     continue
                 pat = syntax + line
-                for s in syntaxes.values():
-                    if line.startswith(s):
+                for s, rels in syntaxes.items():
+                    if line.startswith(rels):
                         pat = line
                         break
+                    elif line.startswith(s+':'):
+                        pat = rels + line[len(s)+1:]
+                        break
                 pats[f].append(pat)
         except IOError, inst:
             if f != files[0]: