Mercurial > hg
annotate tests/test-sidedata.t @ 43040:ba4072c0a911
sidedata: test we can successfully write sidedata
For now we just write them and rejoice on the lack of crashes.
Differential Revision: https://phab.mercurial-scm.org/D6896
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 09 Sep 2019 21:38:29 +0200 |
parents | e16ca9fde7aa |
children | 559ac8411f12 |
rev | line source |
---|---|
43031
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 ========================================================== |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 Test file dedicated to checking side-data related behavior |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 ========================================================== |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 |
43040
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
5 Check data can be written/read from sidedata |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
6 ============================================ |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
7 |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
8 $ cat << EOF >> $HGRCPATH |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
9 > [extensions] |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
10 > testsidedata=$TESTDIR/testlib/ext-sidedata.py |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
11 > EOF |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
12 |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
13 $ hg init test-sidedata --config format.use-side-data=yes |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
14 $ cd test-sidedata |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
15 $ echo aaa > a |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
16 $ hg add a |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
17 $ hg commit -m a --traceback |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
18 $ echo aaa > b |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
19 $ hg add b |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
20 $ hg commit -m b |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
21 $ echo xxx >> a |
ba4072c0a911
sidedata: test we can successfully write sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43031
diff
changeset
|
22 $ hg commit -m aa |
43031
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
23 |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
24 Check upgrade behavior |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
25 ====================== |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
26 |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
27 Right now, sidedata has not upgrade support |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
28 |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
29 Check that we cannot upgrade to sidedata |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
30 ---------------------------------------- |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
31 |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
32 $ hg init up-no-side-data --config format.use-side-data=no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
33 $ hg debugformat -v -R up-no-side-data |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
34 format-variant repo config default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
35 fncache: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
36 dotencode: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
37 generaldelta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
38 sparserevlog: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
39 sidedata: no no no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
40 plain-cl-delta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
41 compression: zlib zlib zlib |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
42 compression-level: default default default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
43 $ hg debugformat -v -R up-no-side-data --config format.use-side-data=yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
44 format-variant repo config default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
45 fncache: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
46 dotencode: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
47 generaldelta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
48 sparserevlog: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
49 sidedata: no yes no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
50 plain-cl-delta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
51 compression: zlib zlib zlib |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
52 compression-level: default default default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
53 $ hg debugupgraderepo -R up-no-side-data --config format.use-side-data=yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
54 abort: cannot upgrade repository; do not support adding requirement: exp-sidedata-flag |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
55 [255] |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
56 |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
57 Check that we cannot upgrade to sidedata |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
58 ---------------------------------------- |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
59 |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
60 $ hg init up-side-data --config format.use-side-data=yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
61 $ hg debugformat -v -R up-side-data |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
62 format-variant repo config default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
63 fncache: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
64 dotencode: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
65 generaldelta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
66 sparserevlog: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
67 sidedata: yes no no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
68 plain-cl-delta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
69 compression: zlib zlib zlib |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
70 compression-level: default default default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
71 $ hg debugformat -v -R up-side-data --config format.use-side-data=no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
72 format-variant repo config default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
73 fncache: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
74 dotencode: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
75 generaldelta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
76 sparserevlog: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
77 sidedata: yes no no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
78 plain-cl-delta: yes yes yes |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
79 compression: zlib zlib zlib |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
80 compression-level: default default default |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
81 $ hg debugupgraderepo -R up-side-data --config format.use-side-data=no |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
82 abort: cannot upgrade repository; requirement would be removed: exp-sidedata-flag |
e16ca9fde7aa
upgrade: detect the side-data format variants
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
83 [255] |