Summary:
Previously remotefilelog would open a connection and leave the getfiles command
running on that connection, so it didn't have to reopen the ssh connection each
time. We want to reuse this ssh connection for treemanifest and fastannotate, so
let's switch it to a pool model where the connection is kept open but the
getfiles command is not left open.
If an exception happens while the connection is out of the pool, it is discarded
instead of being added back to the pool.
Test Plan:
Ran the tests. The fastannotate tests changed to reflect the new way
the connectionpool allows use.
Reviewers: quark, #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5280323
Signature: t1:5280323:1497975420:e3ae1ee854a1afc90816502543a19ff36f59b497
Summary:
fastannotate will tell remotefilelog what nodes of a file is already known in
linelog + revmap, so remotefilelog will not prefetch those files. Previously,
fastannotate either prevents all prefetching or allows all prefetching, which
is sub-optimal.
fastannotate could now donate its sshpeer to remotefilelog, so remotefilelog
won't need to start another one (assuming they can share a same sshpeer,
could be turned off via config options). This should reduce run time if SSH
handshake is expensive.
fastannotate could now also steal sshpeer from remotefilelog, so fastannotate
won't need to start another one. Combined with the above change, there would
always be only one sshpeer shared by fastannotate and remotefilelog.
Test Plan: Modified existing tests
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: ikostia, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4325382
Signature: t1:4325382:1481933531:39d6344b2c076fbbff1f07997cd268e7cee25e80
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:
If the annotate cache is up-to-date on the main branch, there is likely no need
to prefetch file contents, unless the user is annotating a side branch, which
requires a deeper integration between fastannotate and remotefilelog to just
prefetch the missing part correctly - I'll think about it later while this diff seems
good enough for common cases.
Test Plan: Added a new test
Reviewers: durham, #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4256370
Signature: t1:4256370:1480612767:c2e2a9225fb63ff36ffb579f9641851eb8cd8b39