sapling/phabricator
Adam Simpkins 30d1d145d8 conduit: cache and re-use conduit connections
Summary:
Update the phabricator/conduit.py module to cache connections to Phabricator
and re-use them, rather than creating a brand new connection each time
call_conduit() is invoked.

This makes the `{phabstatus}` template reasonable to use outside of the
smartlog extension.  There was already custom logic for smartlog so that it
only makes a single conduit call to look up data on all revisions at once.
However, generic `log` commands would still end up creating a separate
connection to phabricator for each revision.  With this change `log` still ends
up making one call per revision, but at least it does not set up and tear down
a separate connection for each one any more.

Test Plan:
Tested using the `{phabstatus}` template with `hg log` and confirmed it no
longer made a separate connection to phabrictor for each revision.  It is still
pretty slow, but no longer quite as bad.

Reviewers: #mercurial, simonfar, tomaszo

Reviewed By: simonfar

Subscribers: simonfar, medson, mjpieters, net-systems-diffs@fb.com

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

Signature: t1:5383425:1499680847:428185ba762fefbe12a411a1afa0a090aafda2f2
2017-07-12 20:00:00 -07:00
..
__init__.py add arcconfig accessors 2016-04-27 09:27:56 -07:00
arcconfig.py commands: update to use registrar instead of cmdutil 2017-05-22 13:38:37 -07:00
conduit.py conduit: cache and re-use conduit connections 2017-07-12 20:00:00 -07:00
diffprops.py phabdiff: only match at the start of a line 2017-03-28 20:53:07 -07:00