##// END OF EJS Templates
ignore: remove .hgignore from ignore list if nonexistent...
Durham Goode -
r25163:3139900f default
parent child Browse files
Show More
@@ -143,7 +143,9 b' class dirstate(object):'
143
143
144 @rootcache('.hgignore')
144 @rootcache('.hgignore')
145 def _ignore(self):
145 def _ignore(self):
146 files = [self._join('.hgignore')]
146 files = []
147 if os.path.exists(self._join('.hgignore')):
148 files.append(self._join('.hgignore'))
147 for name, path in self._ui.configitems("ui"):
149 for name, path in self._ui.configitems("ui"):
148 if name == 'ignore' or name.startswith('ignore.'):
150 if name == 'ignore' or name.startswith('ignore.'):
149 # we need to use os.path.join here rather than self._join
151 # we need to use os.path.join here rather than self._join
@@ -55,7 +55,7 b' def ignorepats(lines):'
55
55
56 return patterns, warnings
56 return patterns, warnings
57
57
58 def readignorefile(filepath, warn, skipwarning=False):
58 def readignorefile(filepath, warn):
59 try:
59 try:
60 pats = []
60 pats = []
61 fp = open(filepath)
61 fp = open(filepath)
@@ -64,9 +64,8 b' def readignorefile(filepath, warn, skipw'
64 for warning in warnings:
64 for warning in warnings:
65 warn("%s: %s\n" % (filepath, warning))
65 warn("%s: %s\n" % (filepath, warning))
66 except IOError, inst:
66 except IOError, inst:
67 if not skipwarning:
67 warn(_("skipping unreadable ignore file '%s': %s\n") %
68 warn(_("skipping unreadable ignore file '%s': %s\n") %
68 (filepath, inst.strerror))
69 (filepath, inst.strerror))
70 return pats
69 return pats
71
70
72 def readpats(root, files, warn):
71 def readpats(root, files, warn):
@@ -76,8 +75,7 b' def readpats(root, files, warn):'
76 for f in files:
75 for f in files:
77 if f in pats:
76 if f in pats:
78 continue
77 continue
79 skipwarning = f == files[0]
78 pats[f] = readignorefile(f, warn)
80 pats[f] = readignorefile(f, warn, skipwarning=skipwarning)
81
79
82 return [(f, pats[f]) for f in files if f in pats]
80 return [(f, pats[f]) for f in files if f in pats]
83
81
General Comments 0
You need to be logged in to leave comments. Login now