convert: don't use {} as default argument value
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 22 Dec 2016 09:26:47 -0800
changeset 30659 1404146157d9
parent 30658 c49be208ae34
child 30660 1f21a6835604
convert: don't use {} as default argument value This is a common Python gotcha. I'm kinda surprised we don't have a check-code to detect this :/
hgext/convert/common.py
--- a/hgext/convert/common.py	Thu Dec 22 19:08:38 2016 -0500
+++ b/hgext/convert/common.py	Thu Dec 22 09:26:47 2016 -0800
@@ -55,7 +55,7 @@
 
 class commit(object):
     def __init__(self, author, date, desc, parents, branch=None, rev=None,
-                 extra={}, sortkey=None, saverev=True, phase=phases.draft,
+                 extra=None, sortkey=None, saverev=True, phase=phases.draft,
                  optparents=None):
         self.author = author or 'unknown'
         self.date = date or '0 0'
@@ -64,7 +64,7 @@
         self.optparents = optparents or [] # will be used if already converted
         self.branch = branch
         self.rev = rev
-        self.extra = extra
+        self.extra = extra or {}
         self.sortkey = sortkey
         self.saverev = saverev
         self.phase = phase