Mercurial > hg > mercurial-crew-with-dirclash
changeset 5030:c89671c3b062
merge with crew-stable
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Mon, 30 Jul 2007 20:06:11 +0200 |
parents | 36e8983fe44d (current diff) ac97e065cfc7 (diff) |
children | af0995261f02 |
files | |
diffstat | 3 files changed, 29 insertions(+), 8 deletions(-) [+] |
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]:
--- a/tests/test-hgignore +++ b/tests/test-hgignore @@ -40,12 +40,15 @@ echo "--" ; hg status 2>&1 | sed -e 's/a echo ".*\.o" > .hgignore echo "--" ; hg status -# XXX: broken -#echo "glob:**.o" > .hgignore -#echo "--" ; hg status -# -#echo "glob:*.o" > .hgignore -#echo "--" ; hg status +echo "glob:**.o" > .hgignore +echo "--" ; hg status + +echo "glob:*.o" > .hgignore +echo "--" ; hg status + +echo "syntax: glob" > .hgignore +echo "re:.*\.o" >> .hgignore +echo "--" ; hg status echo "syntax: invalid" > .hgignore echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
--- a/tests/test-hgignore.out +++ b/tests/test-hgignore.out @@ -14,6 +14,21 @@ A dir/b.o ? a.c ? syntax -- +A dir/b.o +? .hgignore +? a.c +? syntax +-- +A dir/b.o +? .hgignore +? a.c +? syntax +-- +A dir/b.o +? .hgignore +? a.c +? syntax +-- .hgignore: ignoring invalid syntax 'invalid' A dir/b.o ? .hgignore