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