Show More
@@ -148,19 +148,7 b' def _hashignore(ignore):' | |||
|
148 | 148 | |
|
149 | 149 | """ |
|
150 | 150 | sha1 = hashlib.sha1() |
|
151 | if util.safehasattr(ignore, 'includepat'): | |
|
152 | sha1.update(ignore.includepat) | |
|
153 | sha1.update('\0\0') | |
|
154 | if util.safehasattr(ignore, 'excludepat'): | |
|
155 | sha1.update(ignore.excludepat) | |
|
156 | sha1.update('\0\0') | |
|
157 | if util.safehasattr(ignore, 'patternspat'): | |
|
158 | sha1.update(ignore.patternspat) | |
|
159 | sha1.update('\0\0') | |
|
160 | if util.safehasattr(ignore, '_files'): | |
|
161 | for f in ignore._files: | |
|
162 | sha1.update(f) | |
|
163 | sha1.update('\0') | |
|
151 | sha1.update(repr(ignore)) | |
|
164 | 152 | return sha1.hexdigest() |
|
165 | 153 | |
|
166 | 154 | _watchmanencoding = pywatchman.encoding.get_local_encoding() |
@@ -810,11 +810,7 b' def debugignore(ui, repo, *files, **opts' | |||
|
810 | 810 | ignore = repo.dirstate._ignore |
|
811 | 811 | if not files: |
|
812 | 812 | # Show all the patterns |
|
813 | includepat = getattr(ignore, 'includepat', None) | |
|
814 | if includepat is not None: | |
|
815 | ui.write("%s\n" % includepat) | |
|
816 | else: | |
|
817 | raise error.Abort(_("no ignore patterns found")) | |
|
813 | ui.write("%s\n" % repr(ignore)) | |
|
818 | 814 | else: |
|
819 | 815 | for f in files: |
|
820 | 816 | nf = util.normpath(f) |
@@ -214,6 +214,9 b' class matcher(object):' | |||
|
214 | 214 | self._anypats = bool(include or exclude) |
|
215 | 215 | self._always = False |
|
216 | 216 | self._pathrestricted = bool(include or exclude or patterns) |
|
217 | self.patternspat = None | |
|
218 | self.includepat = None | |
|
219 | self.excludepat = None | |
|
217 | 220 | |
|
218 | 221 | # roots are directories which are recursively included/excluded. |
|
219 | 222 | self._includeroots = set() |
@@ -375,6 +378,11 b' class matcher(object):' | |||
|
375 | 378 | def prefix(self): |
|
376 | 379 | return not self.always() and not self.isexact() and not self.anypats() |
|
377 | 380 | |
|
381 | def __repr__(self): | |
|
382 | return ('<matcher files=%r, patterns=%r, includes=%r, excludes=%r>' % | |
|
383 | (self._files, self.patternspat, self.includepat, | |
|
384 | self.excludepat)) | |
|
385 | ||
|
378 | 386 | class subdirmatcher(matcher): |
|
379 | 387 | """Adapt a matcher to work on a subdirectory only. |
|
380 | 388 |
General Comments 0
You need to be logged in to leave comments.
Login now