peer: stop having a `peer()` method on `peer()`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 03 Dec 2022 03:45:45 +0100
changeset 49860 78af51ba73c5
parent 49859 8a38cd76588f
child 49861 be3fcd9e5e52
peer: stop having a `peer()` method on `peer()` This is already a peer, why do you want a peer if you already have one.
mercurial/hg.py
mercurial/httppeer.py
mercurial/interfaces/repository.py
mercurial/localrepo.py
mercurial/sshpeer.py
--- a/mercurial/hg.py	Sat Dec 03 03:45:39 2022 +0100
+++ b/mercurial/hg.py	Sat Dec 03 03:45:45 2022 +0100
@@ -723,8 +723,6 @@
             srcpeer = source
         branches = (None, branch or [])
         # XXX path: simply use the peer `path` object when this become available
-        srcpeer = source.peer()  # in case we were called with a localrepo
-        branches = (None, branch or [])
         origsource = source = srcpeer.url()
     srclock = destlock = destwlock = cleandir = None
     destpeer = None
--- a/mercurial/httppeer.py	Sat Dec 03 03:45:39 2022 +0100
+++ b/mercurial/httppeer.py	Sat Dec 03 03:45:45 2022 +0100
@@ -403,9 +403,6 @@
     def local(self):
         return None
 
-    def peer(self):
-        return self
-
     def canpush(self):
         return True
 
--- a/mercurial/interfaces/repository.py	Sat Dec 03 03:45:39 2022 +0100
+++ b/mercurial/interfaces/repository.py	Sat Dec 03 03:45:45 2022 +0100
@@ -123,12 +123,6 @@
         can be used to interface with it. Otherwise returns ``None``.
         """
 
-    def peer():
-        """Returns an object conforming to this interface.
-
-        Most implementations will ``return self``.
-        """
-
     def canpush():
         """Returns a boolean indicating if this peer can be pushed to."""
 
--- a/mercurial/localrepo.py	Sat Dec 03 03:45:39 2022 +0100
+++ b/mercurial/localrepo.py	Sat Dec 03 03:45:45 2022 +0100
@@ -325,9 +325,6 @@
     def local(self):
         return self._repo
 
-    def peer(self):
-        return self
-
     def canpush(self):
         return True
 
--- a/mercurial/sshpeer.py	Sat Dec 03 03:45:39 2022 +0100
+++ b/mercurial/sshpeer.py	Sat Dec 03 03:45:45 2022 +0100
@@ -416,9 +416,6 @@
     def local(self):
         return None
 
-    def peer(self):
-        return self
-
     def canpush(self):
         return True