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

Martin von Zweigbergk martinvonz at google.com
Thu May 21 16:32:31 CDT 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at 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.

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():


More information about the Mercurial-devel mailing list