hgweb: don't use mutable default argument value
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 12 Mar 2017 21:52:17 -0700
changeset 31391 d2878bec55bd
parent 31390 7dafa8d0e006
child 31392 6168d4b93634
hgweb: don't use mutable default argument value
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py	Mon Dec 26 16:55:47 2016 -0700
+++ b/mercurial/hgweb/webutil.py	Sun Mar 12 21:52:17 2017 -0700
@@ -142,8 +142,8 @@
         return hex(self._changelog.node(self._revlog.linkrev(rev)))
 
 class _siblings(object):
-    def __init__(self, siblings=[], hiderev=None):
-        self.siblings = [s for s in siblings if s.node() != nullid]
+    def __init__(self, siblings=None, hiderev=None):
+        self.siblings = [s for s in siblings or [] if s.node() != nullid]
         if len(self.siblings) == 1 and self.siblings[0].rev() == hiderev:
             self.siblings = []