# HG changeset patch # User Thomas Arendsen Hein # Date 1185818771 -7200 # Node ID c89671c3b062875258b22e673c8d7120dbe5cafe # Parent 36e8983fe44d5a6b3dd305eed1baff2cb2f98bd1# Parent ac97e065cfc7868311814588c624e21c257ddad8 merge with crew-stable diff -r 36e8983fe44d -r c89671c3b062 mercurial/ignore.py --- a/mercurial/ignore.py Sun Jul 29 19:32:55 2007 +0200 +++ b/mercurial/ignore.py Mon Jul 30 20:06:11 2007 +0200 @@ -57,10 +57,13 @@ 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]: diff -r 36e8983fe44d -r c89671c3b062 tests/test-hgignore --- a/tests/test-hgignore Sun Jul 29 19:32:55 2007 +0200 +++ b/tests/test-hgignore Mon Jul 30 20:06:11 2007 +0200 @@ -40,12 +40,15 @@ 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:/' diff -r 36e8983fe44d -r c89671c3b062 tests/test-hgignore.out --- a/tests/test-hgignore.out Sun Jul 29 19:32:55 2007 +0200 +++ b/tests/test-hgignore.out Mon Jul 30 20:06:11 2007 +0200 @@ -14,6 +14,21 @@ ? 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