Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webutil.py @ 31400:d2878bec55bd
hgweb: don't use mutable default argument value
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 12 Mar 2017 21:52:17 -0700 |
parents | cd29673cebdb |
children | d4645ae6ba15 |
line wrap: on
line diff
--- 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 = []