test-revlog-v2.t
94 lines
| 2.1 KiB
| text/troff
|
Tads3Lexer
/ tests / test-revlog-v2.t
|
r37363 | #require reporevlogstore | ||
|
r32697 | A repo with unknown revlogv2 requirement string cannot be opened | ||
$ hg init invalidreq | ||||
$ cd invalidreq | ||||
$ echo exp-revlogv2.unknown >> .hg/requires | ||||
$ hg log | ||||
|
r46518 | abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown | ||
|
r32697 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | ||
[255] | ||||
$ cd .. | ||||
Can create and open repo with revlog v2 requirement | ||||
$ cat >> $HGRCPATH << EOF | ||||
> [experimental] | ||||
> revlogv2 = enable-unstable-format-and-corrupt-my-data | ||||
> EOF | ||||
$ hg init empty-repo | ||||
$ cd empty-repo | ||||
$ cat .hg/requires | ||||
dotencode | ||||
|
r48054 | exp-dirstate-v2 (dirstate-v2 !) | ||
|
r47438 | exp-revlogv2.2 | ||
|
r32697 | fncache | ||
r47995 | generaldelta | |||
r47646 | persistent-nodemap (rust !) | |||
r47636 | revlog-compression-zstd (zstd !) | |||
|
r40942 | sparserevlog | ||
|
r32697 | store | ||
$ hg log | ||||
Unknown flags to revlog are rejected | ||||
>>> with open('.hg/store/00changelog.i', 'wb') as fh: | ||||
|
r45929 | ... fh.write(b'\xff\x00\xde\xad') and None | ||
|
r32697 | |||
$ hg log | ||||
r47928 | abort: unknown flags (0xff00) in version 57005 revlog 00changelog | |||
|
r46732 | [50] | ||
|
r32697 | |||
$ cd .. | ||||
Writing a simple revlog v2 works | ||||
$ hg init simple | ||||
$ cd simple | ||||
$ touch foo | ||||
$ hg -q commit -A -m initial | ||||
$ hg log | ||||
changeset: 0:96ee1d7354c4 | ||||
tag: tip | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: initial | ||||
r48115 | ||||
|
r41238 | Header written as expected | ||
|
r32697 | |||
$ f --hexdump --bytes 4 .hg/store/00changelog.i | ||||
.hg/store/00changelog.i: | ||||
r48035 | 0000: 00 00 de ad |....| | |||
|
r32697 | |||
$ f --hexdump --bytes 4 .hg/store/data/foo.i | ||||
.hg/store/data/foo.i: | ||||
r48035 | 0000: 00 00 de ad |....| | |||
r48114 | ||||
r48133 | Bundle use a compatible changegroup format | |||
------------------------------------------ | ||||
$ hg bundle --all ../basic.hg | ||||
1 changesets found | ||||
$ hg debugbundle --spec ../basic.hg | ||||
bzip2-v2 | ||||
r48114 | The expected files are generated | |||
-------------------------------- | ||||
We should have have: | ||||
- a docket | ||||
- a index file with a unique name | ||||
- a data file | ||||
$ ls .hg/store/00changelog* .hg/store/00manifest* | ||||
r48115 | .hg/store/00changelog-6b8ab34b.dat | |||
.hg/store/00changelog-88698448.idx | ||||
r48114 | .hg/store/00changelog.i | |||
r48115 | .hg/store/00manifest-1335303a.dat | |||
.hg/store/00manifest-b875dfc5.idx | ||||
r48114 | .hg/store/00manifest.i | |||