[PATCH 3 of 7] _makelogrevset: avoid match.files() in conditions
Martin von Zweigbergk
martinvonz at google.com
Thu May 21 16:32:30 CDT 2015
# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1432060543 25200
# Tue May 19 11:35:43 2015 -0700
# Node ID 3fec5bc8607568164efcc27607fe249092b3fefc
# Parent 9df9ff660c4d0e0d183de87a6f76f233e3aa934c
_makelogrevset: avoid match.files() in conditions
See 9789b4a7c595 (match: introduce boolean prefix() method,
2014-10-28) for reasons to avoid match.files() in conditions.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1945,7 +1945,8 @@
# platforms without shell expansion (windows).
wctx = repo[None]
match, pats = scmutil.matchandpats(wctx, pats, opts)
- slowpath = match.anypats() or (match.files() and opts.get('removed'))
+ slowpath = match.anypats() or ((match.isexact() or match.prefix()) and
+ opts.get('removed'))
if not slowpath:
for f in match.files():
if follow and f not in wctx:
More information about the Mercurial-devel
mailing list