comparison hgext/largefiles/overrides.py @ 26336:ec2662b9629d

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:40:53 -0700
parents 7699d3212994
children 932330c3f469
comparison
equal deleted inserted replaced
26335:6c93834d7d66 26336:ec2662b9629d
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={}, globbed=False,
54 default='relpath', badfn=None): 54 default='relpath', badfn=None):
55 match = oldmatch(ctx, pats, opts, globbed, default, badfn=badfn) 55 match = oldmatch(ctx, pats, opts, globbed, default, badfn=badfn)
56 return composenormalfilematcher(match, manifest) 56 return composenormalfilematcher(match, manifest)
57 oldmatch = installmatchfn(overridematch) 57 oldmatch = installmatchfn(overridematch)
58 58