Mercurial > hg
annotate tests/test-revlog-v2.t @ 47420:e7ad2490d623
transaction: clarify a conditionnal about version check
Let us move the short branch early.
Differential Revision: https://phab.mercurial-scm.org/D10844
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 09 Jun 2021 01:13:09 +0200 |
parents | e6292eb33384 |
children | da3fb8c10caa |
rev | line source |
---|---|
37345
b09a25d74592
tests: disable test-revlog-v2 when using simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36485
diff
changeset
|
1 #require reporevlogstore |
b09a25d74592
tests: disable test-revlog-v2 when using simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36485
diff
changeset
|
2 |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 A repo with unknown revlogv2 requirement string cannot be opened |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 $ hg init invalidreq |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 $ cd invalidreq |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 $ echo exp-revlogv2.unknown >> .hg/requires |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 $ hg log |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45370
diff
changeset
|
9 abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 [255] |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 $ cd .. |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 Can create and open repo with revlog v2 requirement |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 $ cat >> $HGRCPATH << EOF |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 > [experimental] |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 > revlogv2 = enable-unstable-format-and-corrupt-my-data |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 > EOF |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 $ hg init empty-repo |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 $ cd empty-repo |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 $ cat .hg/requires |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 dotencode |
47279
40b51c28b242
dirstate-v2: Update the expected output of some tests for new requirement
Simon Sapin <simon.sapin@octobus.net>
parents:
47261
diff
changeset
|
25 exp-dirstate-v2 (dirstate-v2 !) |
46704
913485776542
revlog: introduce v2 format
Raphaël Gomès <rgomes@octobus.net>
parents:
46116
diff
changeset
|
26 exp-revlogv2.2 |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 fncache |
47221
5eb5b866e517
requirements: no longer drop `generaldelta` requirement with revlogv2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47157
diff
changeset
|
28 generaldelta |
46884
cc3ad5c3af3b
persistent-nodemap: enable the feature by default when using Rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46874
diff
changeset
|
29 persistent-nodemap (rust !) |
46874
84a93fa7ecfd
revlog-compression: use zstd by default (if available)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46704
diff
changeset
|
30 revlog-compression-zstd (zstd !) |
40906
27fa1d2bf484
test: enable sparse-revlog for test-revlog-v2.t
Boris Feld <boris.feld@octobus.net>
parents:
38363
diff
changeset
|
31 sparserevlog |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 store |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 $ hg log |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 Unknown flags to revlog are rejected |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 >>> with open('.hg/store/00changelog.i', 'wb') as fh: |
45370
15d35f2ba474
tests: make flag parsing test more future safe
Joerg Sonnenberger <joerg@bec.de>
parents:
41202
diff
changeset
|
39 ... fh.write(b'\xff\x00\xde\xad') and None |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 $ hg log |
47157
3a9f3470922c
revlog: use revlog.display_id in format related errors
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46884
diff
changeset
|
42 abort: unknown flags (0xff00) in version 57005 revlog 00changelog |
46116
17a695357270
errors: use detailed exit code 50 for StorageError
Martin von Zweigbergk <martinvonz@google.com>
parents:
45906
diff
changeset
|
43 [50] |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 $ cd .. |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 Writing a simple revlog v2 works |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 $ hg init simple |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 $ cd simple |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 $ touch foo |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 $ hg -q commit -A -m initial |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 $ hg log |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 changeset: 0:96ee1d7354c4 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 tag: tip |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 user: test |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
58 date: Thu Jan 01 00:00:00 1970 +0000 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 summary: initial |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
60 |
47324
0a3fa41fa719
revlogv2: use a unique filename for data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47323
diff
changeset
|
61 |
41202
e7a2cc84dbc0
revlog: always enable generaldelta on version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
40919
diff
changeset
|
62 Header written as expected |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
63 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
64 $ f --hexdump --bytes 4 .hg/store/00changelog.i |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 .hg/store/00changelog.i: |
47261
80164d50ae3d
revlogv2: no longer attempt to use inline for new revlog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47221
diff
changeset
|
66 0000: 00 00 de ad |....| |
32697
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 $ f --hexdump --bytes 4 .hg/store/data/foo.i |
19b9fc40cc51
revlog: skeleton support for version 2 revlogs
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
69 .hg/store/data/foo.i: |
47261
80164d50ae3d
revlogv2: no longer attempt to use inline for new revlog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47221
diff
changeset
|
70 0000: 00 00 de ad |....| |
47323
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
71 |
47342
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
72 Bundle use a compatible changegroup format |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
73 ------------------------------------------ |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
74 |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
75 $ hg bundle --all ../basic.hg |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
76 1 changesets found |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
77 $ hg debugbundle --spec ../basic.hg |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
78 bzip2-v2 |
dc3800569157
revlogv2: make sure bundling pick a compatible bundle format
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47324
diff
changeset
|
79 |
47323
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
80 The expected files are generated |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
81 -------------------------------- |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
82 |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
83 We should have have: |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
84 - a docket |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
85 - a index file with a unique name |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
86 - a data file |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
87 |
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
88 $ ls .hg/store/00changelog* .hg/store/00manifest* |
47389
e6292eb33384
revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47342
diff
changeset
|
89 .hg/store/00changelog-1335303a.sda |
e6292eb33384
revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47342
diff
changeset
|
90 .hg/store/00changelog-6b8ab34b.idx |
e6292eb33384
revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47342
diff
changeset
|
91 .hg/store/00changelog-b875dfc5.dat |
47323
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
92 .hg/store/00changelog.i |
47389
e6292eb33384
revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47342
diff
changeset
|
93 .hg/store/00manifest-05a21d65.idx |
e6292eb33384
revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47342
diff
changeset
|
94 .hg/store/00manifest-43c37dde.dat |
e6292eb33384
revlog: store sidedata in their own file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47342
diff
changeset
|
95 .hg/store/00manifest-e2c9362a.sda |
47323
f612db768c7a
revlogv2: use a unique filename for index
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
47279
diff
changeset
|
96 .hg/store/00manifest.i |