comparison hgext/largefiles/overrides.py @ 26959:f46e7f3b70af

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:46:37 -0700
parents 0ddaa2cab926
children 46bd31fffccb
comparison
equal deleted inserted replaced
26958:0ddaa2cab926 26959:f46e7f3b70af
615 # When we call orig below it creates the standins but we don't add 615 # When we call orig below it creates the standins but we don't add
616 # them to the dir state until later so lock during that time. 616 # them to the dir state until later so lock during that time.
617 wlock = repo.wlock() 617 wlock = repo.wlock()
618 618
619 manifest = repo[None].manifest() 619 manifest = repo[None].manifest()
620 def overridematch(ctx, pats=(), opts={}, globbed=False, 620 def overridematch(ctx, pats=(), opts=None, globbed=False,
621 default='relpath', badfn=None): 621 default='relpath', badfn=None):
622 if opts is None:
623 opts = {}
622 newpats = [] 624 newpats = []
623 # The patterns were previously mangled to add the standin 625 # The patterns were previously mangled to add the standin
624 # directory; we need to remove that now 626 # directory; we need to remove that now
625 for pat in pats: 627 for pat in pats:
626 if match_.patkind(pat) is None and lfutil.shortname in pat: 628 if match_.patkind(pat) is None and lfutil.shortname in pat: