[PATCH 5 of 7] largefiles: avoid match.files() in conditions

Martin von Zweigbergk martinvonz at google.com
Thu May 21 21:32:32 UTC 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1432066101 25200
#      Tue May 19 13:08:21 2015 -0700
# Node ID 769c0f5320b6eed726b54cad7623ff078ae80677
# Parent  d2aad10416bb2b08587f7d55cbe9e1f934b3de9e
largefiles: 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/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -238,10 +238,10 @@
     if path:
         link(storepath(repo, hash), path)
 
-def getstandinmatcher(repo, pats=[], opts={}):
+def getstandinmatcher(repo, pats=None, opts={}):
     '''Return a match object that applies pats to the standin directory'''
     standindir = repo.wjoin(shortname)
-    if pats:
+    if pats is not None:
         pats = [os.path.join(standindir, pat) for pat in pats]
     else:
         # no patterns: relative to repo root



More information about the Mercurial-devel mailing list