Sun, 04 Feb 2018 12:55:18 -0800 sshpeer: move URL validation out of sshpeer.__init__
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 04 Feb 2018 12:55:18 -0800] rev 35931
sshpeer: move URL validation out of sshpeer.__init__ We will soon have another SSH peer class to support the new version of the SSH protocol. However, we won't know which peer class to instantiate until we perform a handshake on an active connection. This means that we need to move connection establishment and handshake code out of sshpeer.__init__. This commit starts the process of migrating peer creation code out of sshpeer.__init__ into instance(), which is the API for creating peers. The moved code no longer calls _abort(). _abort() runs _cleanup() and raises. _cleanup() only performs actions on self._pipe*. These objects aren't instantiated until we actually connect to the peer. So _abort() was not necessary in the old code. To keep the API the same, __init__() now makes a redundant call to util.url(). This will be fixed in subsequent commits. Differential Revision: https://phab.mercurial-scm.org/D2027
Sun, 04 Feb 2018 14:02:41 -0800 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 04 Feb 2018 14:02:41 -0800] rev 35930
tests: add low-level SSH protocol tests We don't really have good low-level tests for the behavior of the SSH wire protocol. This commit attempts to establish some. The added tests consist of a mixture of starting a server with `hg serve --stdio` and sending bytes to it and using `hg debugpeer` to go through the official client code. Having insight into what raw bytes are exchanged as well as what the peer does is useful. We also introduce a test extension for modifying the behavior of the SSH server and peer. For example, we change the server to not recognize the "hello" command, simulating behavior of <0.9.1 servers. These tests are generally useful to have. But the impetus for creating them now is they will be needed for verifying behavior of old clients and servers when a new SSH protocol is introduced. Differential Revision: https://phab.mercurial-scm.org/D2026 # no-check-commit because of serve_forever()
Sat, 03 Feb 2018 12:01:01 -0800 debugcommands: introduce debugpeer command
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 03 Feb 2018 12:01:01 -0800] rev 35929
debugcommands: introduce debugpeer command `hg debugpeer <path>` will establish a connection to a peer repository and print information about it. If you add --debug, it will log low-level protocol request info. This will be useful for upcoming tests around protocol handshaking. Differential Revision: https://phab.mercurial-scm.org/D2025
Sun, 04 Feb 2018 12:47:37 -0800 sshpeer: make "instance" a function
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 04 Feb 2018 12:47:37 -0800] rev 35928
sshpeer: make "instance" a function The API is that peer modules must provide an "instance" symbol that is callable to return a peer. Making "instance" a function instead of an alias to "sshpeer" makes it easier to monkeypatch the "sshpeer" type. It will also make it possible to turn instance() into a factory function of sorts that returns different types based on connection properties. Differential Revision: https://phab.mercurial-scm.org/D2024
Sun, 04 Feb 2018 16:17:43 -0500 lfs: deduplicate oids in the transfer
Matt Harbison <matt_harbison@yahoo.com> [Sun, 04 Feb 2018 16:17:43 -0500] rev 35927
lfs: deduplicate oids in the transfer Apparently, we can't rely on the server to deduplicate for us. Sadly, the pointer object isn't hashable, so it can't be reduced by converting it to a set. In order to be hashable, it needs to be immutable. I had a bunch of code to change it to composition and forward the readonly dict methods to a member dict. But the pointer is updated via __setitem__() when creating the pointer file. So it didn't see worth adding all of that code to the class.
Sun, 04 Feb 2018 15:26:49 -0500 cat: call the storage prefetch hook
Matt Harbison <matt_harbison@yahoo.com> [Sun, 04 Feb 2018 15:26:49 -0500] rev 35926
cat: call the storage prefetch hook It's not important to call in the case of a single file, but maybe it's better to do so for consistency.
Sun, 04 Feb 2018 14:31:32 -0500 archive: call the storage prefetch hook
Matt Harbison <matt_harbison@yahoo.com> [Sun, 04 Feb 2018 14:31:32 -0500] rev 35925
archive: call the storage prefetch hook
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -7 +7 +10 +30 +100 +300 +1000 +3000 +10000 tip