Mercurial > public > mercurial-scm > hg-stable
diff mercurial/scmutil.py @ 24447:d44d53bc9a1e
matcher: make e.g. 'relpath:.' lead to fast paths
Several commands take the fast path when match.always() is
true. However, when the user passes "." on the command line, that
results in a matcher for which match.always() == False. Let's make it
so such matchers return True, and have an empty list of .files(). This
makes e.g. "hg log ." as fast as "hg log" and "hg revert ." as fast as
"hg revert --all" (when run from repo root).
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 19 Nov 2014 15:56:58 -0800 |
parents | ca1365078c86 |
children | 56fff44cce98 |
line wrap: on
line diff
--- a/mercurial/scmutil.py Wed Mar 25 14:56:54 2015 -0400 +++ b/mercurial/scmutil.py Wed Nov 19 15:56:58 2014 -0800 @@ -725,6 +725,8 @@ def badfn(f, msg): ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg)) m.bad = badfn + if m.always(): + pats = [] return m, pats def match(ctx, pats=[], opts={}, globbed=False, default='relpath'):