# HG changeset patch # User Manuel Jacob # Date 2023-04-07 13:42:49 # Node ID ed052780ad5e083ef245f67e4899ac407c76c10c # Parent b88e9c707c9507393d2f581c7e993ab5f30e8773 peer: rename makepeer() → _make_peer() In httppeer and sshpeer, there previously were makepeer() and make_peer(), which was confusing. Therefore, this changeset renames one of the functions. makepeer() was the internal function called by make_peer() and some debug command. This function is renamed to _make_peer(). diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -4512,7 +4512,7 @@ def debugwireproto(ui, repo, path=None, peer = None else: ui.write(_(b'creating ssh peer from handshake results\n')) - peer = sshpeer.makepeer( + peer = sshpeer._make_peer( ui, url, proc, @@ -4568,7 +4568,7 @@ def debugwireproto(ui, repo, path=None, ) else: peer_path = urlutil.try_path(ui, path) - peer = httppeer.makepeer(ui, peer_path, opener=opener) + peer = httppeer._make_peer(ui, peer_path, opener=opener) # We /could/ populate stdin/stdout with sock.makefile()... else: diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -592,7 +592,7 @@ def performhandshake(ui, url, opener, re return respurl, info -def makepeer(ui, path, opener=None, requestbuilder=urlreq.request): +def _make_peer(ui, path, opener=None, requestbuilder=urlreq.request): """Construct an appropriate HTTP peer instance. ``opener`` is an ``url.opener`` that should be used to establish @@ -628,7 +628,7 @@ def make_peer(ui, path, create, intents= _(b'Python support for SSL and HTTPS is not installed') ) - inst = makepeer(ui, path) + inst = _make_peer(ui, path) return inst except error.RepoError as httpexception: diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -568,7 +568,7 @@ class sshv1peer(wireprotov1peer.wirepeer self._readerr() -def makepeer(ui, path, proc, stdin, stdout, stderr, autoreadstderr=True): +def _make_peer(ui, path, proc, stdin, stdout, stderr, autoreadstderr=True): """Make a peer instance from existing pipes. ``path`` and ``proc`` are stored on the eventual peer instance and may @@ -658,7 +658,7 @@ def make_peer(ui, path, create, intents= ui, sshcmd, args, remotecmd, remotepath, sshenv ) - peer = makepeer(ui, path, proc, stdin, stdout, stderr) + peer = _make_peer(ui, path, proc, stdin, stdout, stderr) # Finally, if supported by the server, notify it about our own # capabilities.