Mercurial > hg
comparison mercurial/ignore.py @ 25166:7f53f305d4a6
ignore: rename readignorefile to readpatternfile
A future commit will move the readignorefile logic into match.py so it can be
used from general match rules. Let's rename the function to represent this new
behavior.
author | Durham Goode <durham@fb.com> |
---|---|
date | Sat, 16 May 2015 15:45:46 -0700 |
parents | 581e2066d802 |
children | 6f7048cc2419 |
comparison
equal
deleted
inserted
replaced
25165:581e2066d802 | 25166:7f53f305d4a6 |
---|---|
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] |