Summary:
fastannotate has a fastpath, when the node (commit hash) exists in revmap,
it would generate the output instantly from the linelog without going
through the history.
In the "fctx" mode, the vanilla annotate command would pass the revision
number instead of changeset node to fastannotate, which prevents
fastannotate from using the fast path.
This diff converts the revision number to node before testing the fast path
to solve the problem.
Test Plan: Modified existing tests.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4288927
Signature: t1:4288927:1481073363:3330d60878161139ee195bc968c161d6c0d95ace
Summary:
Simplifies some shell code, namely `$extpath` is duplicated with `$TESTDIR/..`
so remove one of them.
Change `library.sh` (used by remotefilelog tests) to reuse `$HGRCPATH` instead
of overriding the environment variable, because it never gets restored and the
current code would assume `$HGRCPATH` to have `.hgrc` as its basename, which is
not always true.
Test Plan: `arc unit`
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4256506
Signature: t1:4256506:1480612191:73832c427b6562b9000a6df006226653157a7156
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
Summary:
The recent bdiff behavior change affects us. Document why and update the test
so it works with both the old and new (less optimal imo) bdiff behavior.
Test Plan: Updated the test
Reviewers: #sourcecontrol, simonfar, rmcelroy
Reviewed By: simonfar, rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4231966
Signature: t1:4231966:1480011763:d116799ded3514d644e4b80296ffc71a8d712a43
Summary:
There are some minor differences between the two annotate algorithm.
Both are reasonable in theory. The differences are explained in the test.
The `badfn` change is needed to make exit code correct.
Test Plan: Run the modified test
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4060263
Signature: t1:4060263:1477401942:64a08d2fa28ea0fa9b54fa0f0ea48ca489c308df