equal
deleted
inserted
replaced
9 import util, match |
9 import util, match |
10 import re |
10 import re |
11 |
11 |
12 _commentre = None |
12 _commentre = None |
13 |
13 |
14 def readignorefile(filepath, warn): |
14 def readpatternfile(filepath, warn): |
15 '''parse a pattern file, returning a list of |
15 '''parse a pattern file, returning a list of |
16 patterns. These patterns should be given to compile() |
16 patterns. These patterns should be given to compile() |
17 to be validated and converted into a match function.''' |
17 to be validated and converted into a match function.''' |
18 syntaxes = {'re': 'relre:', 'regexp': 'relre:', 'glob': 'relglob:'} |
18 syntaxes = {'re': 'relre:', 'regexp': 'relre:', 'glob': 'relglob:'} |
19 syntax = 'relre:' |
19 syntax = 'relre:' |
62 pats = {} |
62 pats = {} |
63 for f in files: |
63 for f in files: |
64 if f in pats: |
64 if f in pats: |
65 continue |
65 continue |
66 try: |
66 try: |
67 pats[f] = readignorefile(f, warn) |
67 pats[f] = readpatternfile(f, warn) |
68 except IOError, inst: |
68 except IOError, inst: |
69 warn(_("skipping unreadable ignore file '%s': %s\n") % |
69 warn(_("skipping unreadable ignore file '%s': %s\n") % |
70 (f, inst.strerror)) |
70 (f, inst.strerror)) |
71 |
71 |
72 return [(f, pats[f]) for f in files if f in pats] |
72 return [(f, pats[f]) for f in files if f in pats] |