Show More
@@ -1,62 +1,64 | |||
|
1 | #require reporevlogstore | |
|
2 | ||
|
1 | 3 | A repo with unknown revlogv2 requirement string cannot be opened |
|
2 | 4 | |
|
3 | 5 | $ hg init invalidreq |
|
4 | 6 | $ cd invalidreq |
|
5 | 7 | $ echo exp-revlogv2.unknown >> .hg/requires |
|
6 | 8 | $ hg log |
|
7 | 9 | abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown! |
|
8 | 10 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
9 | 11 | [255] |
|
10 | 12 | $ cd .. |
|
11 | 13 | |
|
12 | 14 | Can create and open repo with revlog v2 requirement |
|
13 | 15 | |
|
14 | 16 | $ cat >> $HGRCPATH << EOF |
|
15 | 17 | > [experimental] |
|
16 | 18 | > revlogv2 = enable-unstable-format-and-corrupt-my-data |
|
17 | 19 | > EOF |
|
18 | 20 | |
|
19 | 21 | $ hg init empty-repo |
|
20 | 22 | $ cd empty-repo |
|
21 | 23 | $ cat .hg/requires |
|
22 | 24 | dotencode |
|
23 | 25 | exp-revlogv2.0 |
|
24 | 26 | fncache |
|
25 | 27 | store |
|
26 | 28 | |
|
27 | 29 | $ hg log |
|
28 | 30 | |
|
29 | 31 | Unknown flags to revlog are rejected |
|
30 | 32 | |
|
31 | 33 | >>> with open('.hg/store/00changelog.i', 'wb') as fh: |
|
32 | 34 | ... fh.write(b'\x00\x04\xde\xad') |
|
33 | 35 | |
|
34 | 36 | $ hg log |
|
35 | 37 | abort: unknown flags (0x04) in version 57005 revlog 00changelog.i! |
|
36 | 38 | [255] |
|
37 | 39 | |
|
38 | 40 | $ cd .. |
|
39 | 41 | |
|
40 | 42 | Writing a simple revlog v2 works |
|
41 | 43 | |
|
42 | 44 | $ hg init simple |
|
43 | 45 | $ cd simple |
|
44 | 46 | $ touch foo |
|
45 | 47 | $ hg -q commit -A -m initial |
|
46 | 48 | |
|
47 | 49 | $ hg log |
|
48 | 50 | changeset: 0:96ee1d7354c4 |
|
49 | 51 | tag: tip |
|
50 | 52 | user: test |
|
51 | 53 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
52 | 54 | summary: initial |
|
53 | 55 | |
|
54 | 56 | Header written as expected (changelog always disables generaldelta) |
|
55 | 57 | |
|
56 | 58 | $ f --hexdump --bytes 4 .hg/store/00changelog.i |
|
57 | 59 | .hg/store/00changelog.i: |
|
58 | 60 | 0000: 00 01 de ad |....| |
|
59 | 61 | |
|
60 | 62 | $ f --hexdump --bytes 4 .hg/store/data/foo.i |
|
61 | 63 | .hg/store/data/foo.i: |
|
62 | 64 | 0000: 00 03 de ad |....| |
General Comments 0
You need to be logged in to leave comments.
Login now