[PATCH 1 of 7] mq: don't use mutable default argument value

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Mar 15 03:01:13 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1489560408 25200
#      Tue Mar 14 23:46:48 2017 -0700
# Node ID de882be93d6353919d59d9b0d5798db0d7e8a134
# Parent  ed23f929af38e3249a4c0b258939e89782b20795
# EXP-Topic check-pylint
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r de882be93d63
mq: don't use mutable default argument value

Caught by pylint.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -3439,7 +3439,9 @@ def reposetup(ui, repo):
                     raise error.Abort(errmsg)
 
         def commit(self, text="", user=None, date=None, match=None,
-                   force=False, editor=False, extra={}):
+                   force=False, editor=False, extra=None):
+            if extra is None:
+                extra = {}
             self.abortifwdirpatched(
                 _('cannot commit over an applied mq patch'),
                 force)


More information about the Mercurial-devel mailing list