changeset 49748:78af51ba73c5

peer: stop having a `peer()` method on `peer()` This is already a peer, why do you want a peer if you already have one.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Dec 2022 03:45:45 +0100
parents 8a38cd76588f
children be3fcd9e5e52
files mercurial/hg.py mercurial/httppeer.py mercurial/interfaces/repository.py mercurial/localrepo.py mercurial/sshpeer.py
diffstat 5 files changed, 0 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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