Yuya Nishihara <yuya@tcha.org> [Fri, 16 Mar 2018 22:47:15 +0900] rev 37068
templater: use template context to render old-style list template
Prepares for dropping the 'templ' resource.
This means old-style list templates are processed by the same engine class
as the one for the list node. I think that's fine since templates for the
same list should be tightly coupled, and I believe the extension point for
the engine classes isn't actually used.
Now templatekw._showlist() is a compatibility wrapper for _showcompatlist(),
and will be deprecated soon. The function is still marked as private since
I plan to change the interface to get rid of closures capturing context and
mapping.
Yuya Nishihara <yuya@tcha.org> [Fri, 16 Mar 2018 22:36:40 +0900] rev 37067
templater: add context.preload(t) to test if the specified template exists
I'm going to remove 'templ' from the resources dict because it is the only
resource that the caller can't provide. This also implies that putting
'templ' into the resources dict creates a reference cycle.
context.preload(t) will be used in place of templater.__contains__().
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 12:28:19 +0900] rev 37066
annotate: pack line content into annotateline object (API)
Just for code readability. We can do that since the annotateline type is
no longer used while computing the history.
Yuya Nishihara <yuya@tcha.org> [Tue, 13 Mar 2018 22:18:06 +0900] rev 37065
annotate: drop linenumber flag from fctx.annotate() (API)
Now linenumber=True is fast enough to be enabled by default.
Yuya Nishihara <yuya@tcha.org> [Mon, 12 Mar 2018 20:45:10 +0900] rev 37064
annotate: do not construct attr.s object per line while computing history
Unfortunately, good abstraction has a cost. It's way slower to construct
an annotateline() object than creating a plain tuple or a list. This patch
changes the internal data structure from row-based to columnar, so the
decorate() function can be instant (i.e. no Python in hot loop.)
For code readability, the outermost tuple is switched to an attr.s object
instead.
(original, row-based attr.s)
$ hg annot mercurial/commands.py --time > /dev/null
time: real 11.470 secs (user 11.400+0.000 sys 0.070+0.000)
$ hg annot mercurial/commands.py --time --line-number > /dev/null
time: real 39.590 secs (user 39.500+0.000 sys 0.080+0.000)
(this patch, columnar)
$ hg annot mercurial/commands.py --time > /dev/null
time: real 11.780 secs (user 11.710+0.000 sys 0.070+0.000)
$ hg annot mercurial/commands.py --time --line-number > /dev/null
time: real 12.240 secs (user 12.170+0.000 sys 0.090+0.000)
(cf. 4.3.3, row-based tuple)
$ hg annot mercurial/commands.py --time --line-number > /dev/null
time: real 19.540 secs (user 19.460+0.000 sys 0.080+0.000)
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 15 Mar 2018 18:05:49 -0700] rev 37063
wireproto: explicitly track which requests are active
We previously only tracked which requests are receiving. A
misbehaving client could accidentally have multiple requests with
the same ID in flight.
We now explicitly track which request IDs are currently active.
We make it illegal to receive a frame associated with a request
ID that has already been dispatched.
Differential Revision: https://phab.mercurial-scm.org/D2901
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 15 Mar 2018 16:09:58 -0700] rev 37062
wireproto: use named arguments when passing around frame data
Named arguments is easier to reason about compared to positional
arguments. Especially when you have many positional arguments.
Differential Revision: https://phab.mercurial-scm.org/D2900
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 15 Mar 2018 16:03:14 -0700] rev 37061
wireproto: define attr-based classes for representing frames
When frames only had 3 attributes, it was reasonable to
represent them as a tuple. With them growing more attributes,
it will be easier to pass them around as a more formal type.
So let's define attr-based classes to represent frame headers and
full frames.
Differential Revision: https://phab.mercurial-scm.org/D2899