comparison hgext/largefiles/overrides.py @ 26339:4afdd4283d3e

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:44:59 -0700
parents 52c68fb827ae
children 0ddaa2cab926
comparison
equal deleted inserted replaced
26338:52c68fb827ae 26339:4afdd4283d3e
287 return orig(repo, ignoreupdate) 287 return orig(repo, ignoreupdate)
288 finally: 288 finally:
289 repo._repo.lfstatus = False 289 repo._repo.lfstatus = False
290 290
291 def overridelog(orig, ui, repo, *pats, **opts): 291 def overridelog(orig, ui, repo, *pats, **opts):
292 def overridematchandpats(ctx, pats=(), opts={}, globbed=False, 292 def overridematchandpats(ctx, pats=(), opts=None, globbed=False,
293 default='relpath', badfn=None): 293 default='relpath', badfn=None):
294 """Matcher that merges root directory with .hglf, suitable for log. 294 """Matcher that merges root directory with .hglf, suitable for log.
295 It is still possible to match .hglf directly. 295 It is still possible to match .hglf directly.
296 For any listed files run log on the standin too. 296 For any listed files run log on the standin too.
297 matchfn tries both the given filename and with .hglf stripped. 297 matchfn tries both the given filename and with .hglf stripped.
298 """ 298 """
299 if opts is None:
300 opts = {}
299 matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default, 301 matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default,
300 badfn=badfn) 302 badfn=badfn)
301 m, p = copy.copy(matchandpats) 303 m, p = copy.copy(matchandpats)
302 304
303 if m.always(): 305 if m.always():