# HG changeset patch # User Pierre-Yves David # Date 1443081850 25200 # 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 -r 188c1e9506f5 -r d9537ce64f3a mercurial/scmutil.py --- a/mercurial/scmutil.py Thu Sep 24 01:00:43 2015 -0700 +++ b/mercurial/scmutil.py Thu Sep 24 01:04:10 2015 -0700 @@ -791,7 +791,9 @@ '''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')