##// END OF EJS Templates
test: enable sparse-revlog for test-revlog-v2.t...
test: enable sparse-revlog for test-revlog-v2.t We are about to enable sparse-revlog globally. To help with reviewing the tests change, we isolate them in individual changesets. Differential Revision: https://phab.mercurial-scm.org/D5333

File last commit:

r40942:27fa1d2b default
r40942:27fa1d2b default
Show More
test-revlog-v2.t
71 lines | 1.6 KiB | text/troff | Tads3Lexer
Boris Feld
test: enable sparse-revlog for test-revlog-v2.t...
r40942 TRANSITIONAL CONFIG
$ cat << EOF >> $HGRCPATH
> [format]
> sparse-revlog = yes
> EOF
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
abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown!
(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
exp-revlogv2.0
fncache
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:
Pulkit Goyal
py3: suppress the output of .write() calls in tests/test-revlog-v2.t...
r38382 ... fh.write(b'\x00\x04\xde\xad') and None
Gregory Szorc
revlog: skeleton support for version 2 revlogs...
r32697
$ hg log
abort: unknown flags (0x04) in version 57005 revlog 00changelog.i!
[255]
$ 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
Header written as expected (changelog always disables generaldelta)
$ 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:
0000: 00 03 de ad |....|