match: remove a mutable default argument
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 24 Sep 2015 00:59:26 -0700
changeset 26325 cce8ebd31407
parent 26324 4a8e21578e14
child 26326 58218b0e6005
match: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Thu Sep 24 01:58:33 2015 -0700
+++ b/mercurial/scmutil.py	Thu Sep 24 00:59:26 2015 -0700
@@ -753,7 +753,7 @@
         ret.append(kindpat)
     return ret
 
-def matchandpats(ctx, pats=[], opts={}, globbed=False, default='relpath',
+def matchandpats(ctx, pats=(), opts={}, globbed=False, default='relpath',
                  badfn=None):
     '''Return a matcher and the patterns that were used.
     The matcher will warn about bad matches, unless an alternate badfn callback