Mercurial > hg-stable
changeset 25272:6c76c42a5893
walkchangerevs: avoid match.files() in conditions
See 9789b4a7c595 (match: introduce boolean prefix() method,
2014-10-28) for reasons to avoid match.files() in conditions.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 19 May 2015 11:34:50 -0700 |
parents | 1b1eaf1885df |
children | 8e0e334bad42 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu May 21 14:20:24 2015 -0700 +++ b/mercurial/cmdutil.py Tue May 19 11:34:50 2015 -0700 @@ -1755,7 +1755,8 @@ if not revs: return [] wanted = set() - slowpath = match.anypats() or (match.files() and opts.get('removed')) + slowpath = match.anypats() or ((match.isexact() or match.prefix()) and + opts.get('removed')) fncache = {} change = repo.changectx @@ -1835,7 +1836,7 @@ # Now that wanted is correctly initialized, we can iterate over the # revision range, yielding only revisions in wanted. def iterate(): - if follow and not match.files(): + if follow and match.always(): ff = _followfilter(repo, onlyfirst=opts.get('follow_first')) def want(rev): return ff.match(rev) and rev in wanted