addremove: remove a mutable default argument
Mutable default arguments are know to the state of California to cause bugs.
--- 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')