hgk: don't use mutable default argument value
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 14 Mar 2017 23:48:25 -0700
changeset 31409 dddc4812aa7a
parent 31408 6e3c79bc9a35
child 31410 86dfd31c0329
hgk: don't use mutable default argument value Caught by pylint.
hgext/hgk.py
--- a/hgext/hgk.py	Tue Mar 14 23:48:08 2017 -0700
+++ b/hgext/hgk.py	Tue Mar 14 23:48:25 2017 -0700
@@ -71,8 +71,10 @@
     inferrepo=True)
 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
     """diff trees from two commits"""
-    def __difftree(repo, node1, node2, files=[]):
+    def __difftree(repo, node1, node2, files=None):
         assert node2 is not None
+        if files is None:
+            files = []
         mmap = repo[node1].manifest()
         mmap2 = repo[node2].manifest()
         m = scmutil.match(repo[node1], files)