Mercurial > hg
annotate tests/test-pull-network.t @ 49777:e1953a34c110
bundle: emit full snapshot as is, without doing a redelta
With the new `forced` delta-reused policy, it become important to be able to
send full snapshot where full snapshot are needed. Otherwise, the fallback delta
will simply be used on the client sideā¦ creating monstrous delta chain, since
revision that are meant as a reset of delta-chain chain becoming too complex are
simply adding a new full delta-tree on the leaf of another one.
In the `non-forced` cases, client process full snapshot from the bundle
differently from deltas, so client will still try to convert the full snapshot
into a delta if possible. So this will no lead to pathological storage
explosion.
I have considered making this configurable, but the impact seems limited enough
that it does not seems to be worth it. Especially with the current
sparse-revlog format that use "delta-tree" with multiple level snapshots, full
snapshot are much less frequent and not that different from other intermediate
snapshot that we are already sending over the wire anyway.
CPU wise, this will help the bundling side a little as it will not need to
reconstruct revisions and compute deltas. The unbundling side might save a tiny
amount of CPU as it won't need to reconstruct the delta-base to reconstruct the
revision full text. This only slightly visible in some of the benchmarks. And
have no real impact on most of them.
### data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog
# benchmark.name = perf-bundle
# benchmark.variants.revs = last-40000
before: 11.467186 seconds
just-emit-full: 11.190576 seconds (-2.41%)
with-pull-force: 11.041091 seconds (-3.72%)
# benchmark.name = perf-unbundle
# benchmark.variants.revs = last-40000
before: 16.744862
just-emit-full:: 16.561036 seconds (-1.10%)
with-pull-force: 16.389344 seconds (-2.12%)
# benchmark.name = pull
# benchmark.variants.revs = last-40000
before: 26.870569
just-emit-full: 26.391188 seconds (-1.78%)
with-pull-force: 25.633184 seconds (-4.60%)
Space wise (so network-wise) the impact is fairly small. When taking compression into
account.
Below are tests the size of `hg bundle --all` for a handful of benchmark repositories
(with bzip, zstd compression and without it)
This show a small increase in the bundle size, but nothing really significant
except maybe for mozilla-try (+12%) that nobody really pulls large chunk of anyway.
Mozilla-try is also the repository that benefit the most for not having to
recompute deltas client size.
### mercurial:
bzip-before: 26 406 342 bytes
bzip-after: 26 691 543 bytes +1.08%
zstd-before: 27 918 645 bytes
zstd-after: 28 075 896 bytes +0.56%
none-before: 98 675 601 bytes
none-after: 100 411 237 bytes +1.76%
### pypy
bzip-before: 201 295 752 bytes
bzip-after: 209 780 282 bytes +4.21%
zstd-before: 202 974 795 bytes
zstd-after: 205 165 780 bytes +1.08%
none-before: 871 070 261 bytes
none-after: 993 595 057 bytes +14.07%
### netbeans
bzip-before: 601 314 330 bytes
bzip-after: 614 246 241 bytes +2.15%
zstd-before: 604 745 136 bytes
zstd-after: 615 497 705 bytes +1.78%
none-before: 3 338 238 571 bytes
none-after: 3 439 422 535 bytes +3.03%
### mozilla-central
bzip-before: 1 493 006 921 bytes
bzip-after: 1 549 650 570 bytes +3.79%
zstd-before: 1 481 910 102 bytes
zstd-after: 1 513 052 415 bytes +2.10%
none-before: 6 535 929 910 bytes
none-after: 7 010 191 342 bytes +7.26%
### mozilla-try
bzip-before: 6 583 425 999 bytes
bzip-after: 7 423 536 928 bytes +12.76%
zstd-before: 6 021 009 212 bytes
zstd-after: 6 674 922 420 bytes +10.86%
none-before: 22 954 739 558 bytes
none-after: 26 013 854 771 bytes +13.32%
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 07 Dec 2022 20:12:23 +0100 |
parents | 9987d14ad63f |
children | 2f2682f40ea0 |
rev | line source |
---|---|
22046
7a9cbb315d84
tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents:
17486
diff
changeset
|
1 #require serve |
15446
c5c9ca3719f9
tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents:
13956
diff
changeset
|
2 |
13956
ffb5c09ba822
tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents:
13826
diff
changeset
|
3 $ hg init test |
12279 | 4 $ cd test |
5 | |
6 $ echo foo>foo | |
7 $ hg addremove | |
8 adding foo | |
9 $ hg commit -m 1 | |
10 | |
11 $ hg verify | |
12 checking changesets | |
13 checking manifests | |
14 crosschecking files in changesets and manifests | |
15 checking files | |
39489
f1186c292d03
verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents:
38078
diff
changeset
|
16 checked 1 changesets with 1 changes to 1 files |
336 | 17 |
12279 | 18 $ hg serve -p $HGPORT -d --pid-file=hg.pid |
19 $ cat hg.pid >> $DAEMON_PIDS | |
20 $ cd .. | |
21 | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
22 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy |
12279 | 23 requesting all changes |
24 adding changesets | |
25 adding manifests | |
26 adding file changes | |
27 added 1 changesets with 1 changes to 1 files | |
34661
eb586ed5d8ce
transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
33644
diff
changeset
|
28 new changesets 340e38bdcde4 |
12279 | 29 updating to branch default |
30 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
31 | |
32 $ cd copy | |
33 $ hg verify | |
34 checking changesets | |
35 checking manifests | |
36 crosschecking files in changesets and manifests | |
37 checking files | |
39489
f1186c292d03
verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents:
38078
diff
changeset
|
38 checked 1 changesets with 1 changes to 1 files |
336 | 39 |
12279 | 40 $ hg co |
41 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 $ cat foo | |
43 foo | |
44 | |
45 $ hg manifest --debug | |
46 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo | |
47 | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
48 $ hg pull |
15552
62c9183a0bbb
clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents:
13956
diff
changeset
|
49 pulling from http://foo@localhost:$HGPORT/ |
12279 | 50 searching for changes |
51 no changes found | |
52 | |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12328
diff
changeset
|
53 $ hg rollback --dry-run --verbose |
13446
1e497df514e2
rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents:
12643
diff
changeset
|
54 repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/) |
12279 | 55 |
26604
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
56 Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
57 not are encoded like a node: |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
58 |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
59 $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy' |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
60 pulling from http://foo@localhost:$HGPORT/ |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45025
diff
changeset
|
61 abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy' |
26604
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
62 [255] |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
63 $ hg pull -r 'xxxxxxxxxxxxxxxxxx y' |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
64 pulling from http://foo@localhost:$HGPORT/ |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45025
diff
changeset
|
65 abort: unknown revision 'xxxxxxxxxxxxxxxxxx y' |
26604
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
66 [255] |
a3fcc8e3136b
context: don't hex encode all unknown 20 char revision specs (issue4890)
Mads Kiilerich <madski@unity3d.com>
parents:
24205
diff
changeset
|
67 |
42078
50b69c08651b
tests: demonstrate broken pull of "ffffffffffff" revision
Martin von Zweigbergk <martinvonz@google.com>
parents:
39707
diff
changeset
|
68 Test pull of working copy revision |
50b69c08651b
tests: demonstrate broken pull of "ffffffffffff" revision
Martin von Zweigbergk <martinvonz@google.com>
parents:
39707
diff
changeset
|
69 $ hg pull -r 'ffffffffffff' |
50b69c08651b
tests: demonstrate broken pull of "ffffffffffff" revision
Martin von Zweigbergk <martinvonz@google.com>
parents:
39707
diff
changeset
|
70 pulling from http://foo@localhost:$HGPORT/ |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45025
diff
changeset
|
71 abort: unknown revision 'ffffffffffff' |
42078
50b69c08651b
tests: demonstrate broken pull of "ffffffffffff" revision
Martin von Zweigbergk <martinvonz@google.com>
parents:
39707
diff
changeset
|
72 [255] |
50b69c08651b
tests: demonstrate broken pull of "ffffffffffff" revision
Martin von Zweigbergk <martinvonz@google.com>
parents:
39707
diff
changeset
|
73 |
12279 | 74 Test 'file:' uri handling: |
75 | |
17486 | 76 $ hg pull -q file://../test-does-not-exist |
13823
ad179644750f
hg: look up schemes using url.url
Brodie Rao <brodie@bitheap.org>
parents:
13817
diff
changeset
|
77 abort: file:// URLs can only refer to localhost |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12279
diff
changeset
|
78 [255] |
12279 | 79 |
13826
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
80 $ hg pull -q file://../test |
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
81 abort: file:// URLs can only refer to localhost |
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
82 [255] |
e574207e3bcd
url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
Brodie Rao <brodie@bitheap.org>
parents:
13823
diff
changeset
|
83 |
31771
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
84 MSYS changes 'file:' into 'file;' |
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
85 |
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
86 #if no-msys |
24205
abcb1ee3b20a
check-code: allow disabling msys path check
Matt Mackall <mpm@selenic.com>
parents:
22947
diff
changeset
|
87 $ hg pull -q file:../test # no-msys |
31771
5e92ba77793c
test-serve: disable unfixable tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
26604
diff
changeset
|
88 #endif |
12279 | 89 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
90 It's tricky to make file:// URLs working on every platform with |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
91 regular shell commands. |
12279 | 92 |
48879
9987d14ad63f
py2: drop some more from __future__ statements
Gregory Szorc <gregory.szorc@gmail.com>
parents:
48526
diff
changeset
|
93 $ URL=`"$PYTHON" -c "import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"` |
12279 | 94 $ hg pull -q "$URL" |
13817
7f18bab2c0b0
url: abort on file:// URLs with non-localhost hosts
Brodie Rao <brodie@bitheap.org>
parents:
13446
diff
changeset
|
95 abort: file:// URLs can only refer to localhost |
7f18bab2c0b0
url: abort on file:// URLs with non-localhost hosts
Brodie Rao <brodie@bitheap.org>
parents:
13446
diff
changeset
|
96 [255] |
12279 | 97 |
48879
9987d14ad63f
py2: drop some more from __future__ statements
Gregory Szorc <gregory.szorc@gmail.com>
parents:
48526
diff
changeset
|
98 $ URL=`"$PYTHON" -c "import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"` |
13817
7f18bab2c0b0
url: abort on file:// URLs with non-localhost hosts
Brodie Rao <brodie@bitheap.org>
parents:
13446
diff
changeset
|
99 $ hg pull -q "$URL" |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
100 |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
101 SEC: check for unsafe ssh url |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
102 |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
103 $ cat >> $HGRCPATH << EOF |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
104 > [ui] |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
105 > ssh = sh -c "read l; read l; read l" |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
106 > EOF |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
107 |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
108 $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
109 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
110 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
111 [255] |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
112 $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
113 pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
114 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
115 [255] |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
116 $ hg pull 'ssh://fakehost|touch${IFS}owned/path' |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
117 pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45025
diff
changeset
|
118 abort: no suitable response from remote hg |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
119 [255] |
45025
24b1a8eb73aa
ui: add option to timestamp status and diagnostic messages
Joerg Sonnenberger <joerg@bec.de>
parents:
42079
diff
changeset
|
120 $ hg --config ui.timestamp-output=true pull 'ssh://fakehost%7Ctouch%20owned/path' |
24b1a8eb73aa
ui: add option to timestamp status and diagnostic messages
Joerg Sonnenberger <joerg@bec.de>
parents:
42079
diff
changeset
|
121 \[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\] pulling from ssh://fakehost%7Ctouch%20owned/path (re) |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45025
diff
changeset
|
122 \[20[2-9][0-9]-[01][0-9]-[0-3][0-9]T[0-5][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]\] abort: no suitable response from remote hg (re) |
33638
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
123 [255] |
92b583e3e522
pull: add tests for unsafe ssh url (SEC)
Sean Farley <sean@farley.io>
parents:
31771
diff
changeset
|
124 |
33644
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
125 $ [ ! -f owned ] || echo 'you got owned' |
943c91326b23
ssh: unban the use of pipe character in user@host:port string
Yuya Nishihara <yuya@tcha.org>
parents:
33638
diff
changeset
|
126 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16107
diff
changeset
|
127 $ cd .. |