diff mercurial/localrepo.py @ 49865:ff7134e03629

peer: have `repo.peer` take an optional `path` argument We are ready to start to actually set the value now.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Dec 2022 00:16:07 +0100
parents a6e2a668c746
children 376395868b7b
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Dec 03 00:13:50 2022 +0100
+++ b/mercurial/localrepo.py	Sat Dec 03 00:16:07 2022 +0100
@@ -303,8 +303,8 @@
 class localpeer(repository.peer):
     '''peer for a local repo; reflects only the most recent API'''
 
-    def __init__(self, repo, caps=None):
-        super(localpeer, self).__init__(repo.ui)
+    def __init__(self, repo, caps=None, path=None):
+        super(localpeer, self).__init__(repo.ui, path=path)
 
         if caps is None:
             caps = moderncaps.copy()
@@ -451,8 +451,8 @@
     """peer extension which implements legacy methods too; used for tests with
     restricted capabilities"""
 
-    def __init__(self, repo):
-        super(locallegacypeer, self).__init__(repo, caps=legacycaps)
+    def __init__(self, repo, path=None):
+        super(locallegacypeer, self).__init__(repo, caps=legacycaps, path=path)
 
     # Begin of baselegacywirecommands interface.
 
@@ -1633,8 +1633,8 @@
                 parts.pop()
         return False
 
-    def peer(self):
-        return localpeer(self)  # not cached to avoid reference cycle
+    def peer(self, path=None):
+        return localpeer(self, path=path)  # not cached to avoid reference cycle
 
     def unfiltered(self):
         """Return unfiltered version of the repository