Patchwork [4,of,7] largefiles: don't use mutable default argument value

login
register
mail settings
Submitter Pierre-Yves David
Date March 15, 2017, 7:01 a.m.
Message ID <92e6b5422e92f0ad7707.1489561276@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19350/
State Accepted
Headers show

Comments

Pierre-Yves David - March 15, 2017, 7:01 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1489560550 25200
#      Tue Mar 14 23:49:10 2017 -0700
# Node ID 92e6b5422e92f0ad7707289335d9d40fb7c7da98
# Parent  b8d26aeff6a637b61cac05d5b8710bfc1a120f06
# 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 92e6b5422e92
largefiles: don't use mutable default argument value

Caught by pylint.

Patch

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -272,7 +272,9 @@  def reposetup(ui, repo):
         # contents updated to reflect the hash of their largefile.
         # Do that here.
         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 = {}
             orig = super(lfilesrepo, self).commit
 
             with self.wlock():