Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
4997:60c54154ec4c | 5029:ac97e065cfc7 |
---|---|
55 syntax = syntaxes[s] | 55 syntax = syntaxes[s] |
56 except KeyError: | 56 except KeyError: |
57 warn(_("%s: ignoring invalid syntax '%s'\n") % (f, s)) | 57 warn(_("%s: ignoring invalid syntax '%s'\n") % (f, s)) |
58 continue | 58 continue |
59 pat = syntax + line | 59 pat = syntax + line |
60 for s in syntaxes.values(): | 60 for s, rels in syntaxes.items(): |
61 if line.startswith(s): | 61 if line.startswith(rels): |
62 pat = line | 62 pat = line |
63 break | |
64 elif line.startswith(s+':'): | |
65 pat = rels + line[len(s)+1:] | |
63 break | 66 break |
64 pats[f].append(pat) | 67 pats[f].append(pat) |
65 except IOError, inst: | 68 except IOError, inst: |
66 if f != files[0]: | 69 if f != files[0]: |
67 warn(_("skipping unreadable ignore file '%s': %s\n") % | 70 warn(_("skipping unreadable ignore file '%s': %s\n") % |