Patchwork [3,of,7] _makelogrevset: avoid match.files() in conditions

login
register
mail settings
Submitter Martin von Zweigbergk
Date May 21, 2015, 9:32 p.m.
Message ID <3fec5bc8607568164efc.1432243950@waste.org>
Download mbox | patch
Permalink /patch/9223/
State Accepted
Delegated to: Augie Fackler
Headers show

Comments

Martin von Zweigbergk - May 21, 2015, 9:32 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@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.

Patch

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: