From patchwork Wed Mar 15 07:01:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6,of,7] localrepo: don't use mutable default argument value From: Pierre-Yves David X-Patchwork-Id: 19352 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Wed, 15 Mar 2017 00:01:18 -0700 # HG changeset patch # User Pierre-Yves David # Date 1489560607 25200 # Tue Mar 14 23:50:07 2017 -0700 # Node ID b24451e8f9a6beee5501e9bedc47af7edc283ea4 # Parent 855f0045de7f94630923be4639f234b28be89e7f # 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 b24451e8f9a6 localrepo: don't use mutable default argument value Caught by pylint. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -119,7 +119,9 @@ legacycaps = moderncaps.union(set(['chan class localpeer(peer.peerrepository): '''peer for a local repo; reflects only the most recent API''' - def __init__(self, repo, caps=moderncaps): + def __init__(self, repo, caps=None): + if caps is None: + caps = moderncaps.copy() peer.peerrepository.__init__(self) self._repo = repo.filtered('served') self.ui = repo.ui