changeset 26322:2cd19782d2d4

commit: 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:56:18 -0700
parents db4c192cb9b3
children ed884807dc48
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Sep 22 14:09:42 2015 -0700
+++ b/mercurial/localrepo.py	Thu Sep 24 00:56:18 2015 -0700
@@ -1378,13 +1378,15 @@
 
     @unfilteredmethod
     def commit(self, text="", user=None, date=None, match=None, force=False,
-               editor=False, extra={}):
+               editor=False, extra=None):
         """Add a new revision to current repository.
 
         Revision information is gathered from the working directory,
         match can be used to filter the committed files. If editor is
         supplied, it is called to get a commit message.
         """
+        if extra is None:
+            extra = {}
 
         def fail(f, msg):
             raise util.Abort('%s: %s' % (f, msg))