Mercurial > public > mercurial-scm > hg
comparison mercurial/manifest.py @ 25276:c436ba9d6ac0
manifest: use match.prefix() instead of 'not match.anypats()'
It seems clearer to check for what it is than what it isn't.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 19 May 2015 11:16:20 -0700 |
parents | 0de132d5328a |
children | 5411059d93f8 |
comparison
equal
deleted
inserted
replaced
25275:d94e403b5237 | 25276:c436ba9d6ac0 |
---|---|
217 def _filesfastpath(self, match): | 217 def _filesfastpath(self, match): |
218 '''Checks whether we can correctly and quickly iterate over matcher | 218 '''Checks whether we can correctly and quickly iterate over matcher |
219 files instead of over manifest files.''' | 219 files instead of over manifest files.''' |
220 files = match.files() | 220 files = match.files() |
221 return (len(files) < 100 and (match.isexact() or | 221 return (len(files) < 100 and (match.isexact() or |
222 (not match.anypats() and all(fn in self for fn in files)))) | 222 (match.prefix() and all(fn in self for fn in files)))) |
223 | 223 |
224 def walk(self, match): | 224 def walk(self, match): |
225 '''Generates matching file names. | 225 '''Generates matching file names. |
226 | 226 |
227 Equivalent to manifest.matches(match).iterkeys(), but without creating | 227 Equivalent to manifest.matches(match).iterkeys(), but without creating |