Summary:
Just as in phabricator/conduit.py. It is necessary for D620
BTW, not sure why do we have very similar code in two places.
Test Plan: Will be tested in D620
Reviewers: #fbhgext, shivramk, mitrandir
Reviewed By: #fbhgext, mitrandir
Differential Revision: https://phab.mercurial-scm.org/D742
Summary:
Previously, we didn't pass through additional parameters, which resulted in
errors complaining about insufficient arguments.
Test Plan: Added a new test that previously crashed
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D689
D451 is going to add an `order` parameter so let's update our code.
Also remove the wrapping of `revset.symbols['stringset']`, which is no
longer needed by the current Mercurial.
Differential Revision: https://phab.mercurial-scm.org/D543
Summary:
conduit HTTP POST request did not have correct content-type header set.
Now they do. Ideally we should use python-request package to do HTTP
but I do not know enough how to import these dependencies so I just went
with the minimal changes.
Test Plan:
ran hg log from dev environment and eventually got it all working.
{P57411895}
Reviewers: simpkins
Reviewed By: simpkins
Subscribers: net-systems-diffs@fb.com, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5080725
Tasks: 18294945
Signature: t1:5080725:1495052201:1bbd6edad4c1c4b3482a7479259460a815947630
Summary:
The function signature for a number of functions relating to templating changed.
In addition, the templater layer now requires that template functions have been
registered via the decorator, otherwise a require attribute is missing and
things blow up.
Test Plan: arc unit. rt.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4908220
Signature: t1:4908220:1492545033:66f089e03a6064ae96ca36f3abf99ecb6d48d422
Summary:
Don't let errors propagate out of the gitnode() revset. Always report errors
in gitnode() as a translation failure, rather than letting exceptions propagate
up and crash mercurial. The code was previously only catching internally
generated ConduitError exceptions, but it can also throw HttpError exceptions,
and the underlying httplib code can throw its own exceptions as well as
socket.error exceptions.
This also fixes the test code to use an ephemeral TCP port rather than assuming
port 8543 will always be available. Using a fixed TCP port in test code is a
very common way to cause bogus failures if the tests are run in parallel.
(For instance, testing multiple repositories in parallel on the same build
host.)
Test Plan:
Added unit tests that check the behavior when the server returns a 500 error,
and when the server refuses the connection entirely.
Reviewers: quark, durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4556871
Signature: t1:4556871:1487062142:b58d770d46c975d44933bec08cfce8acb25ff16b
Summary:
Many of the template keywords in our extensions were being registered
incorrectly, causing their help output to be rendered incorrectly in the
"hg help templates" output. The ones in smartlog.py were particularly bad, as
most of them showed only their description, without displaying the name of the
template. In smartlog.py only singlepublicsuccessor was being displayed
correctly, because it's docstring explicitly included it's own name at the
start.
This fixes all of our extensions to consistently use the
registrar.templatekeyword() decorator to register the keywords. This decorator
automatically prefixes the help message with the keyword name. The
mercurial/extensions.py code will explicitly check to see if an extension
contains an "templatekeyword" attribute, and if so it will register any
keywords contained in this registry after calling extsetup().
Test Plan:
Added new unit tests to check the output of "hg help templates" for the
affected keywords.
Reviewers: #sourcecontrol, kulshrax, ikostia, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, net-systems-diffs@, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4427729
Signature: t1:4427729:1484831476:17b478a5e867dfc3f85402588c381bf8b1831107
Summary:
Parallel callout to scmquery through conduit
This implements the special case of log on a single directory, preserving
follow behavior. To do this, we backtrackfrom the current head to find
all draft revisions along the path, then find the common public ancestor of
those. Once we find that, we can begin paging in results from the scmquery
service.
Pretty much a working diff at this point. Limits and boundary conditions
have not been fully tested. Every once in a while I run into a bum query,
which I suspect to be either a bad proxy or a service router failure; still
debugging that. Could also be an issue with conduit. Other than that,
things seem to work.
Test Plan:
Testing log with fastest setting (no revsets), revsets (using -M), and with extension disabled (--sparse):
[zamsden@devbig192.prn1 ~/local/fbcode] time hg log tao --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 -M > a
real 0m1.895s
user 0m0.003s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbcode] time hg log tao --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 > b
real 0m1.308s
user 0m0.005s
sys 0m0.001s
[zamsden@devbig192.prn1 ~/local/fbcode] diff a b
[zamsden@devbig192.prn1 ~/local/fbcode] time hg log tao --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 --sparse > c
real 0m7.320s
user 0m0.004s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbcode] diff a c
Testing --user option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/dragon --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 5 -u dmitri > a
real 0m2.765s
user 0m0.002s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/dragon --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 5 -u dmitri --sparse > b
real 0m23.247s
user 0m0.005s
sys 0m0.001s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing same output enabled / disabled for -X option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -X '**TARGETS' > a
real 0m1.292s
user 0m0.002s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -X '**TARGETS' --sparse > b
real 0m2.697s
user 0m0.002s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing -k option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -k 'e' -X '**TARGETS' -l 10 > a
real 0m1.174s
user 0m0.003s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -k 'e' -X '**TARGETS' -l 10 --sparse > b
real 0m1.259s
user 0m0.004s
sys 0m0.002s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing -I option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/scm/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -I '**.py' > a
real 0m1.473s
user 0m0.005s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/scm/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -I '**.py' --sparse > b
real 0m2.911s
user 0m0.003s
sys 0m0.002s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing multiple directory output in all three modes - revset, fast filtered, and forcing original fallback with --sparse
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/hphp/hhvm fbcode/hphp/runtime/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 -M > a
real 0m2.892s
user 0m0.003s
sys 0m0.006s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/hphp/hhvm fbcode/hphp/runtime/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 > b
real 0m2.575s
user 0m0.697s
sys 0m0.077s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/hphp/hhvm fbcode/hphp/runtime/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 --sparse > c
real 0m7.339s
user 0m0.003s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource] diff a c
[zamsden@devbig192.prn1 ~/local/fbsource]
Reviewers: rmcelroy, #scmquery, #mercurial, ttung, lcharignon, durham, stash
Reviewed By: stash
Subscribers: cdykes, lcharignon, quark, stash, mjpieters, jeroenv
Differential Revision: https://phabricator.intern.facebook.com/D3634075
Tasks: 12341014
Signature: t1:3634075:1471039212:0989839636847a8e5da6a0ef9150035fcf5bb797
Summary:
Be a better citizen under system python path.
Fix all tests issues and change setup.py to use glob pattern to include
all extensions.
Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3534311
Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2