Yuya Nishihara <yuya@tcha.org> [Tue, 03 Apr 2018 22:24:50 +0900] rev 37306
addremove: pass command-level similarity value down to scmutil.addremove()
Since we've changed to carry a similarity value by opts dict, it makes sense
to leave a string '0'-'100' value unmodified.
Augie Fackler <augie@google.com> [Tue, 03 Apr 2018 13:37:57 -0400] rev 37305
setup: add overlooked hgext.infinitepush package declaration
Will fix infinitepush tests that have been failing when run without --local.
Differential Revision: https://phab.mercurial-scm.org/D3038
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 09:12:15 -0700] rev 37304
tests: remove dependence on repo.changectx()
This was one of few remaining uses of repo.changectx() in core.
Differential Revision: https://phab.mercurial-scm.org/D3036
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 08:55:49 -0700] rev 37303
log: remove dependence on repo.changectx()
This was one of few remaining uses of repo.changectx() in core.
Differential Revision: https://phab.mercurial-scm.org/D3035
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 08:55:16 -0700] rev 37302
verify: remove dependence on repo.changectx()
This was one of few remaining uses of repo.changectx() in core.
Differential Revision: https://phab.mercurial-scm.org/D3034
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 08:46:58 -0700] rev 37301
bookmarks: switch from repo.changectx('.') to repo['.']
The two forms are synonymous and the new form is by far the more
common form.
Differential Revision: https://phab.mercurial-scm.org/D3033
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 14:52:57 -0700] rev 37300
stringutil: add function to pretty print an object
This is inspired by the pprint() module/function (which we can't
use because the output is different on Python 2 and 3 - namely the
use of b'' literals).
We hook it up to `hg debugwireproto` for printing the response to
a wire protocol command.
This foreshadows future peer work, which will support decoding
CBOR responses into rich data structures.
Differential Revision: https://phab.mercurial-scm.org/D2987
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 13:30:24 -0700] rev 37299
wireproto: add frame flag to denote payloads as CBOR
We may eventually want a separate frame type for this. But for
now this is the easiest to implement.
Differential Revision: https://phab.mercurial-scm.org/D2986
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 13:01:28 -0700] rev 37298
wireproto: implement custom __repr__ for frame
This version won't print the full payload (which could be large).
It also prints human friendly values for types and flags.
Differential Revision: https://phab.mercurial-scm.org/D2985
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 12:44:35 -0700] rev 37297
keepalive: implement readinto()
This is part of the standard I/O interface. It is used by the framing
protocol. So we need to implement it so frames can be decoded.
Differential Revision: https://phab.mercurial-scm.org/D2984
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 23 Mar 2018 16:24:53 -0700] rev 37296
wireproto: port protocol handler to zope.interface
zope.interface is superior to the abc module. Let's port to it.
As part of this, we add tests for interface conformance for
classes implementing the interface.
Differential Revision: https://phab.mercurial-scm.org/D2983
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 10:40:41 -0700] rev 37295
wireproto: separate commands tables for version 1 and 2 commands
We can't easily reuse existing command handlers for version 2
commands because the response types will be different. e.g. many
commands return nodes encoded as hex. Our new wire protocol is
binary safe, so we'll wish to encode nodes as binary.
We /could/ teach each command handler to look at the protocol
handler and change behavior based on the version in use. However,
this would make logic a bit unwieldy over time and would make
it harder to design a unified protocol handler interface. I think
it's better to create a clean break between version 1 and version 2
of commands on the server.
What I imagine happening is we will have separate @wireprotocommand
functions for each protocol generation. Those functions will parse the
request, dispatch to a common function to process it, then generate
the response in its own, transport-specific manner.
This commit establishes a separate table for tracking version 1
commands from version 2 commands. The HTTP server pieces have been
updated to use this new table.
Most commands are marked as both version 1 and version 2, so there is
little practical impact to this change.
A side-effect of this change is we now rely on transport registration
in wireprototypes.TRANSPORTS and certain properties of the protocol
interface. So a test had to be updated to conform.
Differential Revision: https://phab.mercurial-scm.org/D2982
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 10:12:02 -0700] rev 37294
wireproto: mark SSHv2 as a version 1 transport
The version component is used for filtering/routing wire protocol
commands to their proper handler. The actual version 2 of the wire
protocol commands will use a different encoding of responses. We
already have tests using the version 2 SSH transport and version 2
of the wire protocol commands won't be implemented atomically.
This commit marks the SSHv2 transport as version 1 so it will
still invoke the version 1 commands. Once the commands are all
implemented in version 2, we can restore its proper behavior.
Some tests had to be disabled as a result of this change.
Differential Revision: https://phab.mercurial-scm.org/D2981
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 28 Mar 2018 14:05:29 -0700] rev 37293
wireproto: stop aliasing wire protocol types (API)
We generally shy away from aliasing module symbols. I think I
was keeping this around for API compatibility. We've already made
tons of other API breaks in the wire protocol code this release.
What's one more?
.. api::
``wireproto`` module no longer re-exports various types used to
define responses to wire protocol commands. Access these types
from the ``wireprototypes`` module.
Differential Revision: https://phab.mercurial-scm.org/D2979
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 14:34:32 -0700] rev 37292
wireproto: use CBOR for command requests
Now that we're using CBOR in the new wire protocol, let's convert
command requests to it.
Before I wrote this patch and was even thinking about CBOR, I was
thinking about how commands should be issued and came to the
conclusion that we didn't need separate frames to represent the
command name from its arguments. I already had a partially
completed patch prepared to merge the frames.
But with CBOR, it makes the implementation a bit simpler because
we don't need to roll our own serialization.
The changes here are a bit invasive. I tried to split this into
multiple commits to make it easier to review. But it was just too
hard.
* "command name" and "command argument" frames have been collapsed
into a "command request" frame.
* The flags for this new frame are totally different.
* Frame processing has been overhauled to reflect the new order
of things.
* Test fallout was significant. A handful of tests were removed.
Altogether, I think the new code is simpler. We don't have
complicated state around receiving commands. We're either receiving
command request frames or command data frames. We /could/
potentially collapse command data frames into command request
frames. Although I'd have to think a bit more about this before
I do it.
Differential Revision: https://phab.mercurial-scm.org/D2951
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 26 Mar 2018 10:50:36 -0700] rev 37291
wireproto: define frame to represent progress updates
Today, a long-running operation on a server may run without any sign
of progress on the client. This can lead to the conclusion that the
server has hung or the connection has dropped. In fact, connections
can and do time out due to inactivity. And a long-running server
operation can result in the connection dropping prematurely because
no data is being sent!
While we're inventing the new wire protocol, let's provide a mechanism
for communicating progress on potentially expensive server-side events.
We introduce a new frame type that conveys "progress" updates. This
frame type essentially holds the data required to formulate a
``ui.progress()`` call.
We only define the frame right now. Implementing it will be a bit of
work since there is no analog to progress frames in the existing
wire protocol. We'll need to teach the ui object to write to the
wire protocol, etc.
The use of a CBOR map may seem wasteful, as this will encode key
names in every frame. This *is* wasteful. However, maps are
extensible. And the intent is to always use compression via
streams. Compression will make the overhead negligible since repeated
strings will be mostly eliminated over the wire.
Differential Revision: https://phab.mercurial-scm.org/D2902