py3: use pycompat.bytechr instead of chr
Differential Revision: https://phab.mercurial-scm.org/D2071
py3: use pycompat.ziplist instead of zip
zip returns a zip object instead of a list on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2070
patches: move assignment outside the conditional
Having this movement in its own patch will make the next patch clearer.
sshpeer: remove support for connecting to <0.9.1 servers (BC)
197d10e157ce made this change for the HTTP peer. Let's do the same
for the SSH peer.
Test output changes as expected. A redundant test has been dropped.
.. bc::
Support for connecting to Mercurial servers older than 0.9.1 has
been removed.
Differential Revision: https://phab.mercurial-scm.org/D2036
sshpeer: document the handshake mechanism
The mechanism by which SSH peers establish connections with remotes
is wonky and requires a bit of code archeology to understand. While
it is already documented in `hg help internals.wireproto`, it helps
to have documentation in the code as well.
Differential Revision: https://phab.mercurial-scm.org/D2035
sshpeer: move handshake outside of sshpeer
With the handshake now performed before a peer class is instantiated,
we can now instantiate a different peer class depending on the results
of the handshake.
Our test extension had to change to cope with the new API. Because
we now issue the command via raw I/O calls and don't call
_callstream(), we no longer have to register the fake command.
(_callstream() uses the command registration to see what args to
send).
Differential Revision: https://phab.mercurial-scm.org/D2034
sshpeer: inline I/O into _validaterepo()
We want to move the handshake code out of the peer class so the
peer factory function can perform the handshake and instantiate
a proper class depending on the results. To make that refactor
easier to read, we first inline I/O functionality into
_validaterepo().
Test output for low-level protocol tests didn't change, thus
hopefully demonstrating that this refactor didn't change any
material behavior.
Because we no longer call _callstream(), our test extension for
monkeypatching the peer had to change its hook point.
Differential Revision: https://phab.mercurial-scm.org/D2033