# HG changeset patch # User Pierre-Yves David # Date 2015-09-24 08:00:05 # Node ID 58218b0e6005c8169350b88ce9cff648fe3eeadc # Parent cce8ebd3140773c0a95fedb4b3835be55385dbc3 match: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs. diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -753,13 +753,15 @@ def expandpats(pats): ret.append(kindpat) return ret -def matchandpats(ctx, pats=(), opts={}, globbed=False, default='relpath', +def matchandpats(ctx, pats=(), opts=None, globbed=False, default='relpath', badfn=None): '''Return a matcher and the patterns that were used. The matcher will warn about bad matches, unless an alternate badfn callback is provided.''' if pats == ("",): pats = [] + if opts is None: + opts = {} if not globbed and default == 'relpath': pats = expandpats(pats or [])