comparison hgext/largefiles/overrides.py @ 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
comparison
equal deleted inserted replaced
26336:ec2662b9629d 26337:932330c3f469
48 m.matchfn = lambda f: notlfile(f) and origmatchfn(f) 48 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
49 return m 49 return m
50 50
51 def installnormalfilesmatchfn(manifest): 51 def installnormalfilesmatchfn(manifest):
52 '''installmatchfn with a matchfn that ignores all largefiles''' 52 '''installmatchfn with a matchfn that ignores all largefiles'''
53 def overridematch(ctx, pats=(), opts={}, globbed=False, 53 def overridematch(ctx, pats=(), opts=None, globbed=False,
54 default='relpath', badfn=None): 54 default='relpath', badfn=None):
55 if opts is None:
56 opts = {}
55 match = oldmatch(ctx, pats, opts, globbed, default, badfn=badfn) 57 match = oldmatch(ctx, pats, opts, globbed, default, badfn=badfn)
56 return composenormalfilematcher(match, manifest) 58 return composenormalfilematcher(match, manifest)
57 oldmatch = installmatchfn(overridematch) 59 oldmatch = installmatchfn(overridematch)
58 60
59 def installmatchfn(f): 61 def installmatchfn(f):