Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 50421:ed052780ad5e
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().
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Fri, 07 Apr 2023 15:42:49 +0200 |
parents | af776c3d5c3e |
children | f0d2b18f0274 |
comparison
equal
deleted
inserted
replaced
50420:b88e9c707c95 | 50421:ed052780ad5e |
---|---|
4510 elif opts[b'peer'] == b'raw': | 4510 elif opts[b'peer'] == b'raw': |
4511 ui.write(_(b'using raw connection to peer\n')) | 4511 ui.write(_(b'using raw connection to peer\n')) |
4512 peer = None | 4512 peer = None |
4513 else: | 4513 else: |
4514 ui.write(_(b'creating ssh peer from handshake results\n')) | 4514 ui.write(_(b'creating ssh peer from handshake results\n')) |
4515 peer = sshpeer.makepeer( | 4515 peer = sshpeer._make_peer( |
4516 ui, | 4516 ui, |
4517 url, | 4517 url, |
4518 proc, | 4518 proc, |
4519 stdin, | 4519 stdin, |
4520 stdout, | 4520 stdout, |
4566 raise error.Abort( | 4566 raise error.Abort( |
4567 _(b'--peer %s not supported with HTTP peers') % opts[b'peer'] | 4567 _(b'--peer %s not supported with HTTP peers') % opts[b'peer'] |
4568 ) | 4568 ) |
4569 else: | 4569 else: |
4570 peer_path = urlutil.try_path(ui, path) | 4570 peer_path = urlutil.try_path(ui, path) |
4571 peer = httppeer.makepeer(ui, peer_path, opener=opener) | 4571 peer = httppeer._make_peer(ui, peer_path, opener=opener) |
4572 | 4572 |
4573 # We /could/ populate stdin/stdout with sock.makefile()... | 4573 # We /could/ populate stdin/stdout with sock.makefile()... |
4574 else: | 4574 else: |
4575 raise error.Abort(_(b'unsupported connection configuration')) | 4575 raise error.Abort(_(b'unsupported connection configuration')) |
4576 | 4576 |