setup: handle more invalid python3 syntax
This should keep the file portable to both python2 and python3.
revset: changed __add__ methods on lazy sets to return addsets (
issue4191)
Performance Benchmarking:
$ hg --time log --graph --style compact --limit 6 -r 'sort((::. or bookmark()
or heads(public())), "-rev")'
time: real 1.540 secs (user 1.510+0.000 sys 0.020+0.000)
$ ./hg --time log --graph --style compact --limit 6 -r 'sort((::. or
bookmark() or heads(public())), "-rev")'
time: real 1.240 secs (user 1.190+0.000 sys 0.040+0.010)
revset: added addset class with its basic methods
This class addresses the problem of losing performance on the __contains__
method when adding two smart structures with fast membership testing.
revset: changed descendants revset to use lazy generators
Performance Benchmarking:
$ time hg log -qr "0:: and 0:5"
...
real 0m3.665s
user 0m3.364s
sys 0m0.289s
$ time ./hg log -qr "0:: and 0:5"
...
real 0m0.492s
user 0m0.394s
sys 0m0.097s
revset: optimized _revancestors method based on order of revisions
If the revisions for which the ancestors are required are in descending order,
it lazily loads them into a heap to be able to yield values faster.
revset: changed ancestors revset to return lazy generators
This will not improve revsets like "::tip" but will do when that gets
intersected or substracted with another revset.
Performance Benchmarking:
$ time hg log -qr "draft() and ::tip"
...
real 0m3.961s
user 0m3.640s
sys 0m0.313s
$ time ./hg log -qr "draft() and ::tip"
...
real 0m1.080s
user 0m0.987s
sys 0m0.083s
doc: show short description of each commands in generated documents
Before this patch, short description of each commands is not shown in
generated documents (HTML file and UNIX man page). This omitting may
prevent users from understanding about commands.
This patch show it as the 1st paragraph in the help section of each
commands. This style is chosen because:
- showing it as the section title in "command - short desc" style
disallows referencing by "#command" in HTML file: in "en" locale,
hyphen concatenated title is used as the section ID in HTML file
for this style
- showing it as the 1st paragraph in "command - short desc" style
seems to be redundant: "command" appears also just before as the
section title
- showing it just after synopsis like "hg help command" seems not to
be reasonable in UNIX man page
This patch just writes short description ("d['desc'][0]") before "::",
because it should be already "strip()"-ed in "get_desc()", or empty
string for the command without description.