##// END OF EJS Templates
Fix re: and glob: patterns in .hgignore (reported by Brad Schick)...
Thomas Arendsen Hein -
r5029:ac97e065 default
parent child Browse files
Show More
@@ -57,10 +57,13 b' def ignore(root, files, warn):'
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
63 break
64 elif line.startswith(s+':'):
65 pat = rels + line[len(s)+1:]
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]:
@@ -40,12 +40,15 b' echo "--" ; hg status 2>&1 | sed -e \'s/a'
40 echo ".*\.o" > .hgignore
40 echo ".*\.o" > .hgignore
41 echo "--" ; hg status
41 echo "--" ; hg status
42
42
43 # XXX: broken
43 echo "glob:**.o" > .hgignore
44 #echo "glob:**.o" > .hgignore
44 echo "--" ; hg status
45 #echo "--" ; hg status
45
46 #
46 echo "glob:*.o" > .hgignore
47 #echo "glob:*.o" > .hgignore
47 echo "--" ; hg status
48 #echo "--" ; hg status
48
49 echo "syntax: glob" > .hgignore
50 echo "re:.*\.o" >> .hgignore
51 echo "--" ; hg status
49
52
50 echo "syntax: invalid" > .hgignore
53 echo "syntax: invalid" > .hgignore
51 echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
54 echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
@@ -14,6 +14,21 b' A dir/b.o'
14 ? a.c
14 ? a.c
15 ? syntax
15 ? syntax
16 --
16 --
17 A dir/b.o
18 ? .hgignore
19 ? a.c
20 ? syntax
21 --
22 A dir/b.o
23 ? .hgignore
24 ? a.c
25 ? syntax
26 --
27 A dir/b.o
28 ? .hgignore
29 ? a.c
30 ? syntax
31 --
17 .hgignore: ignoring invalid syntax 'invalid'
32 .hgignore: ignoring invalid syntax 'invalid'
18 A dir/b.o
33 A dir/b.o
19 ? .hgignore
34 ? .hgignore
General Comments 0
You need to be logged in to leave comments. Login now