# HG changeset patch # User Pierre-Yves David # Date 2015-09-24 08:04:10 # Node ID d9537ce64f3af401b5cfafa1369ed93831c3b10d # Parent 188c1e9506f5d1bfbc0928011bb7a371f995fe3c addremove: 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 @@ -791,7 +791,9 @@ def matchfiles(repo, files, badfn=None): '''Return a matcher that will efficiently match exactly these files.''' return matchmod.exact(repo.root, repo.getcwd(), files, badfn=badfn) -def addremove(repo, matcher, prefix, opts={}, dry_run=None, similarity=None): +def addremove(repo, matcher, prefix, opts=None, dry_run=None, similarity=None): + if opts is None: + opts = {} m = matcher if dry_run is None: dry_run = opts.get('dry_run')