Commit Graph

6 Commits

Author SHA1 Message Date
Durham Goode
55f677869b remotefilelog: use a connection pool instead of a long running connection
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
2017-06-20 11:08:15 -07:00
Jun Wu
c41d432bb1 fastannotate: move to hgext3rd
Summary: Extensions should belong there.

Test Plan: Updated existing tests

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5113146

Signature: t1:5113146:1495562344:47bae69e6b22c14b32a8a9511878e88e89759d8f
2017-05-23 11:47:22 -07:00
Durham Goode
da7796c0fe fixtests: fix tests to work with upstream changes
Upstream has made some minor changes that affect the tests. Let's just update
the tests appropriately.
2017-05-16 09:40:27 -07:00
Jun Wu
d3424dd296 fastannotate: work better with remotefilelog
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
2016-12-19 12:13:51 -08:00
Jun Wu
5a61921433 fastannotate: resolve revision number to node
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
2016-12-07 00:09:04 +00:00
Jun Wu
22742a1054 fastannotate: conditionally disable remotefilelog annotate prefetching
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
2016-12-01 02:12:53 +00:00