changeset 30659:1404146157d9

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 :/
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 22 Dec 2016 09:26:47 -0800
parents c49be208ae34
children 1f21a6835604
files hgext/convert/common.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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