Mercurial > hg
annotate tests/test-repo-compengines.t @ 31987:8823daaf4665
obsolescence: add test for the "branch replacement" logic during push, case D2
Mercurial checks for the introduction of new heads on push. Evolution comes
into play to detect if existing branches on the server are being replaced by
some of the new one we push.
The current code for this logic is very basic (eg: issue4354) and was poorly
tested. We have a better implementation coming in the evolve extension fixing
these issues and with more serious tests coverage. In the process of upstreaming
this improved logic, we start with adding the test case that are already passing
with the current implementation. Once they are all in, we'll upstream the better
implementation and the extra test cases.
See inline documentation for details about the test case added in this
changeset.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 13 Apr 2017 16:27:42 +0200 |
parents | 4c0a5a256ae8 |
children | c2c8962a9465 |
rev | line source |
---|---|
30818
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 A new repository uses zlib storage, which doesn't need a requirement |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 $ hg init default |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 $ cd default |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 $ cat .hg/requires |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 dotencode |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 fncache |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 generaldelta |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 revlogv1 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 store |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 $ touch foo |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression' |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 $ hg debugrevlog -c | grep 0x78 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 0x78 (x) : 1 (100.00%) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 0x78 (x) : 110 (100.00%) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 $ cd .. |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 Unknown compression engine to format.compression aborts |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 $ hg --config experimental.format.compression=unknown init unknown |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 abort: compression engine unknown defined by experimental.format.compression not available |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 (run "hg debuginstall" to list available compression engines) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 [255] |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 A requirement specifying an unknown compression engine results in bail |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 $ hg init unknownrequirement |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 $ cd unknownrequirement |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 $ echo exp-compression-unknown >> .hg/requires |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 $ hg log |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 abort: repository requires features unknown to this Mercurial: exp-compression-unknown! |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 [255] |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 $ cd .. |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 #if zstd |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 $ hg --config experimental.format.compression=zstd init zstd |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 $ cd zstd |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
43 $ cat .hg/requires |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 dotencode |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 exp-compression-zstd |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 fncache |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 generaldelta |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 revlogv1 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 store |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 $ touch foo |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text' |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 $ hg debugrevlog -c | grep 0x28 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 0x28 : 1 (100.00%) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 0x28 : 98 (100.00%) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
58 $ cd .. |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
60 Specifying a new format.compression on an existing repo won't introduce data |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
61 with that engine or a requirement |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
62 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
63 $ cd default |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
64 $ touch bar |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 $ hg --config experimental.format.compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text' |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
66 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 $ cat .hg/requires |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 dotencode |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
69 fncache |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
70 generaldelta |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
71 revlogv1 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
72 store |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
73 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
74 $ hg debugrevlog -c | grep 0x78 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
75 0x78 (x) : 2 (100.00%) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
76 0x78 (x) : 199 (100.00%) |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
77 |
4c0a5a256ae8
localrepo: experimental support for non-zlib revlog compression
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
78 #endif |