changeset 31421:ecc87acb4d10

localrepo: don't use mutable default argument value Caught by pylint.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 14 Mar 2017 23:50:07 -0700
parents a53f2d4c734f
children aa797bd54f44
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Mar 14 23:49:25 2017 -0700
+++ b/mercurial/localrepo.py	Tue Mar 14 23:50:07 2017 -0700
@@ -119,7 +119,9 @@
 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