Patchwork [4,of,7] commit: avoid match.files() in conditions

login
register
mail settings
Submitter Martin von Zweigbergk
Date May 21, 2015, 9:32 p.m.
Message ID <d2aad10416bb2b08587f.1432243951@waste.org>
Download mbox | patch
Permalink /patch/9224/
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 1432060565 25200
#      Tue May 19 11:36:05 2015 -0700
# Node ID d2aad10416bb2b08587f7d55cbe9e1f934b3de9e
# Parent  3fec5bc8607568164efcc27607fe249092b3fefc
commit: 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/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1443,7 +1443,7 @@ 
                     status.removed.insert(0, '.hgsubstate')
 
             # make sure all explicit patterns are matched
-            if not force and match.files():
+            if not force and (match.isexact() or match.prefix()):
                 matched = set(status.modified + status.added + status.removed)
 
                 for f in match.files():