File: test-store-plain-encoding.t

package info (click to toggle)
mercurial 7.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 45,080 kB
  • sloc: python: 208,589; ansic: 56,460; tcl: 3,715; sh: 1,839; lisp: 1,483; cpp: 864; makefile: 769; javascript: 649; xml: 36
file content (204 lines) | stat: -rw-r--r-- 5,565 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
Test the "plain encoding" feature
=================================

This test the "plain" encoding for store where not much is actually encoding for filelog


Setup
-----


  $ cat >> $HGRCPATH << EOF
  > [format]
  > dotencode=no
  > exp-use-very-fragile-and-unsafe-plain-store-encoding=yes
  > EOF


Create a plain-encoded repository

  $ hg init plain-encoded
  $ cd plain-encoded

create some files and directory

  $ echo foo > foo
  $ mkdir toto
  $ echo bar > toto/bar
  $ mkdir toto/tutu
  $ echo fuz > toto/tutu/fuz
  $ mkdir rc.d
  $ echo baz >rc.d/baz
  $ hg addremove .
  adding foo
  adding rc.d/baz
  adding toto/bar
  adding toto/tutu/fuz
  $ hg commit -m 'initial commit'

verify that basic operations works
----------------------------------

  $ hg export
  # HG changeset patch
  # User test
  # Date 0 0
  #      Thu Jan 01 00:00:00 1970 +0000
  # Node ID b41a27cd96f26122b2178745540aa1f515bb02f3
  # Parent  0000000000000000000000000000000000000000
  initial commit
  
  diff -r 000000000000 -r b41a27cd96f2 foo
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
  @@ -0,0 +1,1 @@
  +foo
  diff -r 000000000000 -r b41a27cd96f2 rc.d/baz
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/rc.d/baz	Thu Jan 01 00:00:00 1970 +0000
  @@ -0,0 +1,1 @@
  +baz
  diff -r 000000000000 -r b41a27cd96f2 toto/bar
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/toto/bar	Thu Jan 01 00:00:00 1970 +0000
  @@ -0,0 +1,1 @@
  +bar
  diff -r 000000000000 -r b41a27cd96f2 toto/tutu/fuz
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/toto/tutu/fuz	Thu Jan 01 00:00:00 1970 +0000
  @@ -0,0 +1,1 @@
  +fuz

  $ env RHG_ON_UNSUPPORTED=abort hg cat -r 0 rc.d/baz
  baz

  $ hg verify
  checking changesets
  checking manifests
  crosschecking files in changesets and manifests
  checking files
  checking dirstate
  checked 1 changesets with 4 changes to 4 files
  $ cd ..

verify that thing listing the repository content works
------------------------------------------------------


local clone

  $ hg clone plain-encoded local-cloned --debug --noupdate
  linked 10 files (no-rust !)
  linked 12 files (rust !)
  updating the branch cache
  $ hg verify -R local-cloned
  checking changesets
  checking manifests
  crosschecking files in changesets and manifests
  checking files
  checking dirstate
  checked 1 changesets with 4 changes to 4 files
  $ hg update -R local-cloned
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved

stream clone

  $ hg clone --stream ssh://user@dummy/plain-encoded stream-cloned --noupdate
  streaming all changes
  10 files to transfer, * (glob) (no-rust !)
  stream-cloned 10 files / * (glob) (no-rust !)
  12 files to transfer, * (glob) (rust !)
  stream-cloned 12 files / * (glob) (rust !)
  $ hg verify -R stream-cloned
  checking changesets
  checking manifests
  crosschecking files in changesets and manifests
  checking files
  checking dirstate
  checked 1 changesets with 4 changes to 4 files
  $ hg update -R stream-cloned
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved

Verify store layout
-------------------

  $ cd plain-encoded

  $ f --recurse .hg/store/data
  .hg/store/data: directory with 3 files
  .hg/store/data/foo.i:
  .hg/store/data/rc.d_: directory with 1 files
  .hg/store/data/rc.d_/baz.i:
  .hg/store/data/toto_: directory with 2 files
  .hg/store/data/toto_/bar.i:
  .hg/store/data/toto_/tutu_: directory with 1 files
  .hg/store/data/toto_/tutu_/fuz.i:

Downgrade/Upgrade
-----------------

downgrade

  $ hg debugformat fragile-plain-encode dotencode fncache
  format-variant                 repo
  fncache:                        yes
  dotencode:                       no
  fragile-plain-encode:           yes
  $ hg debugupgraderepo --quiet --run \
  >     --config format.dotencode=yes \
  >     --config format.exp-use-very-fragile-and-unsafe-plain-store-encoding=no
  upgrade will perform the following actions:
  
  requirements
     preserved: * (glob)
     removed: exp-very-fragile-and-unsafe-plain-store-encoding
     added: dotencode
  
  processed revlogs:
    - all-filelogs
  
  $ hg debugformat fragile-plain-encode dotencode fncache
  format-variant                 repo
  fncache:                        yes
  dotencode:                      yes
  fragile-plain-encode:            no
  $ hg verify
  checking changesets
  checking manifests
  crosschecking files in changesets and manifests
  checking files
  checking dirstate
  checked 1 changesets with 4 changes to 4 files

upgrade

  $ hg debugformat fragile-plain-encode dotencode fncache
  format-variant                 repo
  fncache:                        yes
  dotencode:                      yes
  fragile-plain-encode:            no
  $ hg debugupgraderepo --quiet --run \
  >     --config format.dotencode=no \
  >     --config format.exp-use-very-fragile-and-unsafe-plain-store-encoding=yes
  upgrade will perform the following actions:
  
  requirements
     preserved: * (glob)
     removed: dotencode
     added: exp-very-fragile-and-unsafe-plain-store-encoding
  
  processed revlogs:
    - all-filelogs
  
  $ hg debugformat fragile-plain-encode dotencode fncache
  format-variant                 repo
  fncache:                        yes
  dotencode:                       no
  fragile-plain-encode:           yes
  $ hg verify
  checking changesets
  checking manifests
  crosschecking files in changesets and manifests
  checking files
  checking dirstate
  checked 1 changesets with 4 changes to 4 files