mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
a3dc8b960d
Summary: Previously, I have performance concern about the signature of `fctx.annotate`: it returns fctxs, not ideal for performance since my initial goal is to get rid of reading revlogs in the best case. And letting the low-level `fctx.annotate` have some side effects writing to the disk is not that pretty. Because of that, fastannotate had re-invent part of the formatter (also optimized for performance somehow), and still cannot support all the features the original annotate supports, namely, templates. Now it makes sense to just replace `fctx.annotate` with a sub-optimal implementation, just for the flexibility of the template support of the original annotate command. We can use a "fake" or "lazy" fctx object to minimal the performance impact when people only need to print changeset nodes and line numbers - in which case we don't read revlog. Actually, the hgweb support already did a similar thing - converting fastannotate output to annotate output. So we can reuse some code. The next planned steps are: - Make the original "annotate" command aware of fastannotate protocol, do the pre-download stuff (downloading cache files at `fctx.annotate` is possible but inefficient because of not being batched). - "fastannotate" command remains a separated command optimized for perf and provides extra features like "--deleted". Because of the plan, the "commands" option does not make much sense - "fastannotate" command will not replace "annotate" directly thus dropped from the config interface. A new "modes" config option is added to control how fastannotate works. Test Plan: Modified existing tests Reviewers: #sourcecontrol, simonfar Reviewed By: simonfar Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4238998 Signature: t1:4238998:1480447679:c48e0e565663c086293265e104d9cf414d913aa7 |
||
---|---|---|
.. | ||
__init__.py | ||
commands.py | ||
context.py | ||
error.py | ||
formatter.py | ||
protocol.py | ||
revmap.py | ||
support.py |