##// END OF EJS Templates
requirements: no longer drop `generaldelta` requirement with revlogv2...
requirements: no longer drop `generaldelta` requirement with revlogv2 A repository could use a mix of revlogv1 and revlogv2, making the requirements still necessary. Overall we should move away from the "requirements" file being used a way to configure the repository and stick to it "what do you need to access this repository". However this is a wider work for another time. In addition the logic we just dropped was confusing the `hg debugformat` command, breaking the upgrade code and inconsistent (eg: `sparse-revlog` is also implied by `revlogv2`). Finally, multiple other config option would imply the use of the `revlogv2` requirements, without drop the `generaldelta` one, leading to more inconsistency. Differential Revision: https://phab.mercurial-scm.org/D10612

File last commit:

r47995:5eb5b866 default
r47995:5eb5b866 default
Show More
test-revlog-v2.t
68 lines | 1.5 KiB | text/troff | Tads3Lexer
Gregory Szorc
tests: disable test-revlog-v2 when using simple store...
r37363 #require reporevlogstore
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697 A repo with unknown revlogv2 requirement string cannot be opened
$ hg init invalidreq
$ cd invalidreq
$ echo exp-revlogv2.unknown >> .hg/requires
$ hg log
Martin von Zweigbergk
errors: remove trailing "!" from some error messages for consistency...
r46518 abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
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
Raphaël Gomès
revlog: introduce v2 format...
r47438 exp-revlogv2.2
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697 fncache
requirements: no longer drop `generaldelta` requirement with revlogv2...
r47995 generaldelta
persistent-nodemap: enable the feature by default when using Rust...
r47646 persistent-nodemap (rust !)
revlog-compression: use zstd by default (if available)...
r47636 revlog-compression-zstd (zstd !)
Boris Feld
test: enable sparse-revlog for test-revlog-v2.t...
r40942 sparserevlog
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697 store
$ hg log
Unknown flags to revlog are rejected
>>> with open('.hg/store/00changelog.i', 'wb') as fh:
Joerg Sonnenberger
tests: make flag parsing test more future safe...
r45929 ... fh.write(b'\xff\x00\xde\xad') and None
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ hg log
revlog: use revlog.display_id in format related errors...
r47928 abort: unknown flags (0xff00) in version 57005 revlog 00changelog
Martin von Zweigbergk
errors: use detailed exit code 50 for StorageError...
r46732 [50]
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
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
Gregory Szorc
revlog: always enable generaldelta on version 2 revlogs...
r41238 Header written as expected
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ f --hexdump --bytes 4 .hg/store/00changelog.i
.hg/store/00changelog.i:
0000: 00 01 de ad |....|
$ f --hexdump --bytes 4 .hg/store/data/foo.i
.hg/store/data/foo.i:
Gregory Szorc
revlog: always enable generaldelta on version 2 revlogs...
r41238 0000: 00 01 de ad |....|