changeset 26337:932330c3f469

largefiles: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 24 Sep 2015 00:41:43 -0700
parents ec2662b9629d
children 52c68fb827ae
files hgext/largefiles/overrides.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Thu Sep 24 00:40:53 2015 -0700
+++ b/hgext/largefiles/overrides.py	Thu Sep 24 00:41:43 2015 -0700
@@ -50,8 +50,10 @@
 
 def installnormalfilesmatchfn(manifest):
     '''installmatchfn with a matchfn that ignores all largefiles'''
-    def overridematch(ctx, pats=(), opts={}, globbed=False,
+    def overridematch(ctx, pats=(), opts=None, globbed=False,
             default='relpath', badfn=None):
+        if opts is None:
+            opts = {}
         match = oldmatch(ctx, pats, opts, globbed, default, badfn=badfn)
         return composenormalfilematcher(match, manifest)
     oldmatch = installmatchfn(overridematch)