Mercurial > hg
annotate tests/test-hghave.t @ 42415:c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Few releases ago, we introduce narrow_widen wireproto command to be used to widen
narrow repositories. Before this patch, that was used in non-ellipses cases
only. In ellipses cases, we still do exchange.pull() which can pull more data
than required.
After this patch, the client will first check whether server supports doing
ellipses widening using wireproto command or not by checking server's wireproto
capability. If the server is upto date and support latest ellipses capability,
we call the wireproto command. Otherwise we fallback to exchange.pull() like
before.
The compat code make sure that things works even if one of the client or server
is old. The initial version of this patch does not had this compat code. It's
added to help Google release things smoothly internally. I plan to drop the
compat code before the upcoming major release.
Due to change to wireproto command, the code looks a bit dirty, next patches
will clean that up.
Differential Revision: https://phab.mercurial-scm.org/D6436
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 22 May 2019 02:59:48 +0530 |
parents | c3970be8deca |
children | 7eac24de491d |
rev | line source |
---|---|
33116
6c113a7dec52
tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents:
32942
diff
changeset
|
1 $ . "$TESTDIR/helpers-testrepo.sh" |
6c113a7dec52
tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents:
32942
diff
changeset
|
2 |
12430 | 3 Testing that hghave does not crash when checking features |
8059
41a2c5cbcb6a
hghave: checking that all targets are Exception-free
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
diff
changeset
|
4 |
25472
4d2b9b304ad0
tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents:
12430
diff
changeset
|
5 $ hghave --test-features 2>/dev/null |
25732
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
6 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
7 Testing hghave extensibility for third party tools |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
8 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
9 $ cat > hghaveaddon.py <<EOF |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
10 > import hghave |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
11 > @hghave.check("custom", "custom hghave feature") |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
12 > def has_custom(): |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
13 > return True |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
14 > EOF |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
15 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
16 (invocation via run-tests.py) |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
17 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
18 $ cat > test-hghaveaddon.t <<EOF |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
19 > #require custom |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
20 > $ echo foo |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
21 > foo |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
22 > EOF |
33116
6c113a7dec52
tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents:
32942
diff
changeset
|
23 $ ( \ |
33204
ddd65b4f3ae6
tests: alias syshg and syshgenv so they can be switched conditionally
Yuya Nishihara <yuya@tcha.org>
parents:
33116
diff
changeset
|
24 > testrepohgenv; \ |
40257
c3970be8deca
tests: fix up test-hghave for recent run-tests change to use more CPUs
Augie Fackler <augie@google.com>
parents:
40205
diff
changeset
|
25 > "$PYTHON" $TESTDIR/run-tests.py -j 1 \ |
c3970be8deca
tests: fix up test-hghave for recent run-tests change to use more CPUs
Augie Fackler <augie@google.com>
parents:
40205
diff
changeset
|
26 > $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \ |
33116
6c113a7dec52
tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents:
32942
diff
changeset
|
27 > ) |
40257
c3970be8deca
tests: fix up test-hghave for recent run-tests change to use more CPUs
Augie Fackler <augie@google.com>
parents:
40205
diff
changeset
|
28 running 1 tests using 1 parallel processes |
25732
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
29 . |
32942
5af78c524f34
tests: remove support for warned tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26158
diff
changeset
|
30 # Ran 1 tests, 0 skipped, 0 failed. |
25732
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
31 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
32 (invocation via command line) |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
33 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
34 $ unset TESTDIR |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
35 $ hghave custom |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
36 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
37 (terminate with exit code 2 at failure of importing hghaveaddon.py) |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
38 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
39 $ rm hghaveaddon.* |
40205
89ba51c3e4f1
tests: use NO_CHECK_EOF for fragments having intentional error
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
39707
diff
changeset
|
40 $ cat > hghaveaddon.py <<NO_CHECK_EOF |
25732
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
41 > importing this file should cause syntax error |
40205
89ba51c3e4f1
tests: use NO_CHECK_EOF for fragments having intentional error
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
39707
diff
changeset
|
42 > NO_CHECK_EOF |
25732
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
43 |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
44 $ hghave custom |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
45 failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1) |
b94df10cc3b5
hghave: allow adding customized features at runtime
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
25472
diff
changeset
|
46 [2] |