Patchwork [7,of,8,V2] mq: don't use mutable default argument value

login
register
mail settings
Submitter Gregory Szorc
Date March 13, 2017, 4:57 a.m.
Message ID <c9cfed31ea6d38b60f50.1489381059@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19274/
State Accepted
Headers show

Comments

Gregory Szorc - March 13, 2017, 4:57 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1489380946 25200
#      Sun Mar 12 21:55:46 2017 -0700
# Node ID c9cfed31ea6d38b60f50c4af5efe850e3d7f4be7
# Parent  e379f89d119b7b1cd40c313693912b5fdc4a3360
mq: don't use mutable default argument value

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -721,7 +721,8 @@  class queue(object):
                     util.rename(absf, absorig)
 
     def printdiff(self, repo, diffopts, node1, node2=None, files=None,
-                  fp=None, changes=None, opts={}):
+                  fp=None, changes=None, opts=None):
+        opts = opts or {}
         stat = opts.get('stat')
         m = scmutil.match(repo[node1], files, opts)
         cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2,  m,