##// END OF EJS Templates
upgrade: don't perform anything if nothing to do...
Pulkit Goyal -
r46848:d3113c4c default
parent child Browse files
Show More
@@ -1,231 +1,234 b''
1 1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 2 #
3 3 # Copyright (c) 2016-present, Gregory Szorc
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from __future__ import absolute_import
9 9
10 10 from .i18n import _
11 11 from . import (
12 12 error,
13 13 hg,
14 14 localrepo,
15 15 pycompat,
16 16 )
17 17
18 18 from .upgrade_utils import (
19 19 actions as upgrade_actions,
20 20 engine as upgrade_engine,
21 21 )
22 22
23 23 allformatvariant = upgrade_actions.allformatvariant
24 24
25 25
26 26 def upgraderepo(
27 27 ui,
28 28 repo,
29 29 run=False,
30 30 optimize=None,
31 31 backup=True,
32 32 manifest=None,
33 33 changelog=None,
34 34 filelogs=None,
35 35 ):
36 36 """Upgrade a repository in place."""
37 37 if optimize is None:
38 38 optimize = {}
39 39 repo = repo.unfiltered()
40 40
41 41 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
42 42 specentries = (
43 43 (upgrade_engine.UPGRADE_CHANGELOG, changelog),
44 44 (upgrade_engine.UPGRADE_MANIFEST, manifest),
45 45 (upgrade_engine.UPGRADE_FILELOGS, filelogs),
46 46 )
47 47 specified = [(y, x) for (y, x) in specentries if x is not None]
48 48 if specified:
49 49 # we have some limitation on revlogs to be recloned
50 50 if any(x for y, x in specified):
51 51 revlogs = set()
52 52 for upgrade, enabled in specified:
53 53 if enabled:
54 54 revlogs.add(upgrade)
55 55 else:
56 56 # none are enabled
57 57 for upgrade, __ in specified:
58 58 revlogs.discard(upgrade)
59 59
60 60 # Ensure the repository can be upgraded.
61 61 upgrade_actions.check_source_requirements(repo)
62 62
63 63 default_options = localrepo.defaultcreateopts(repo.ui)
64 64 newreqs = localrepo.newreporequirements(repo.ui, default_options)
65 65 newreqs.update(upgrade_actions.preservedrequirements(repo))
66 66
67 67 upgrade_actions.check_requirements_changes(repo, newreqs)
68 68
69 69 # Find and validate all improvements that can be made.
70 70 alloptimizations = upgrade_actions.findoptimizations(repo)
71 71
72 72 # Apply and Validate arguments.
73 73 optimizations = []
74 74 for o in alloptimizations:
75 75 if o.name in optimize:
76 76 optimizations.append(o)
77 77 optimize.discard(o.name)
78 78
79 79 if optimize: # anything left is unknown
80 80 raise error.Abort(
81 81 _(b'unknown optimization action requested: %s')
82 82 % b', '.join(sorted(optimize)),
83 83 hint=_(b'run without arguments to see valid optimizations'),
84 84 )
85 85
86 86 format_upgrades = upgrade_actions.find_format_upgrades(repo)
87 87 up_actions = upgrade_actions.determine_upgrade_actions(
88 88 repo, format_upgrades, optimizations, repo.requirements, newreqs
89 89 )
90 90 removed_actions = upgrade_actions.find_format_downgrades(repo)
91 91
92 92 removedreqs = repo.requirements - newreqs
93 93 addedreqs = newreqs - repo.requirements
94 94
95 95 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
96 96 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
97 97 removedreqs | addedreqs
98 98 )
99 99 if incompatible:
100 100 msg = _(
101 101 b'ignoring revlogs selection flags, format requirements '
102 102 b'change: %s\n'
103 103 )
104 104 ui.warn(msg % b', '.join(sorted(incompatible)))
105 105 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
106 106
107 107 upgrade_op = upgrade_actions.UpgradeOperation(
108 108 ui,
109 109 newreqs,
110 110 repo.requirements,
111 111 up_actions,
112 112 removed_actions,
113 113 revlogs,
114 114 )
115 115
116 116 if not run:
117 117 fromconfig = []
118 118 onlydefault = []
119 119
120 120 for d in format_upgrades:
121 121 if d.fromconfig(repo):
122 122 fromconfig.append(d)
123 123 elif d.default:
124 124 onlydefault.append(d)
125 125
126 126 if fromconfig or onlydefault:
127 127
128 128 if fromconfig:
129 129 ui.status(
130 130 _(
131 131 b'repository lacks features recommended by '
132 132 b'current config options:\n\n'
133 133 )
134 134 )
135 135 for i in fromconfig:
136 136 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
137 137
138 138 if onlydefault:
139 139 ui.status(
140 140 _(
141 141 b'repository lacks features used by the default '
142 142 b'config options:\n\n'
143 143 )
144 144 )
145 145 for i in onlydefault:
146 146 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
147 147
148 148 ui.status(b'\n')
149 149 else:
150 150 ui.status(_(b'(no format upgrades found in existing repository)\n'))
151 151
152 152 ui.status(
153 153 _(
154 154 b'performing an upgrade with "--run" will make the following '
155 155 b'changes:\n\n'
156 156 )
157 157 )
158 158
159 159 upgrade_op.print_requirements()
160 160 upgrade_op.print_optimisations()
161 161 upgrade_op.print_upgrade_actions()
162 162 upgrade_op.print_affected_revlogs()
163 163
164 164 if upgrade_op.unused_optimizations:
165 165 ui.status(
166 166 _(
167 167 b'additional optimizations are available by specifying '
168 168 b'"--optimize <name>":\n\n'
169 169 )
170 170 )
171 171 upgrade_op.print_unused_optimizations()
172 172 return
173 173
174 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions):
175 ui.status(_(b'nothing to do\n'))
176 return
174 177 # Else we're in the run=true case.
175 178 ui.write(_(b'upgrade will perform the following actions:\n\n'))
176 179 upgrade_op.print_requirements()
177 180 upgrade_op.print_optimisations()
178 181 upgrade_op.print_upgrade_actions()
179 182 upgrade_op.print_affected_revlogs()
180 183
181 184 ui.status(_(b'beginning upgrade...\n'))
182 185 with repo.wlock(), repo.lock():
183 186 ui.status(_(b'repository locked and read-only\n'))
184 187 # Our strategy for upgrading the repository is to create a new,
185 188 # temporary repository, write data to it, then do a swap of the
186 189 # data. There are less heavyweight ways to do this, but it is easier
187 190 # to create a new repo object than to instantiate all the components
188 191 # (like the store) separately.
189 192 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
190 193 backuppath = None
191 194 try:
192 195 ui.status(
193 196 _(
194 197 b'creating temporary repository to stage upgraded '
195 198 b'data: %s\n'
196 199 )
197 200 % tmppath
198 201 )
199 202
200 203 # clone ui without using ui.copy because repo.ui is protected
201 204 repoui = repo.ui.__class__(repo.ui)
202 205 dstrepo = hg.repository(repoui, path=tmppath, create=True)
203 206
204 207 with dstrepo.wlock(), dstrepo.lock():
205 208 backuppath = upgrade_engine.upgrade(
206 209 ui, repo, dstrepo, upgrade_op
207 210 )
208 211 if not backup:
209 212 ui.status(
210 213 _(b'removing old repository content %s\n') % backuppath
211 214 )
212 215 repo.vfs.rmtree(backuppath, forcibly=True)
213 216 backuppath = None
214 217
215 218 finally:
216 219 ui.status(_(b'removing temporary repository %s\n') % tmppath)
217 220 repo.vfs.rmtree(tmppath, forcibly=True)
218 221
219 222 if backuppath and not ui.quiet:
220 223 ui.warn(
221 224 _(b'copy of old repository backed up at %s\n') % backuppath
222 225 )
223 226 ui.warn(
224 227 _(
225 228 b'the old repository will not be deleted; remove '
226 229 b'it to free up disk space once the upgraded '
227 230 b'repository is verified\n'
228 231 )
229 232 )
230 233
231 234 upgrade_op.print_post_op_messages()
@@ -1,703 +1,693 b''
1 1 #testcases lfsremote-on lfsremote-off
2 2 #require serve no-reposimplestore no-chg
3 3
4 4 This test splits `hg serve` with and without using the extension into separate
5 5 tests cases. The tests are broken down as follows, where "LFS"/"No-LFS"
6 6 indicates whether or not there are commits that use an LFS file, and "D"/"E"
7 7 indicates whether or not the extension is loaded. The "X" cases are not tested
8 8 individually, because the lfs requirement causes the process to bail early if
9 9 the extension is disabled.
10 10
11 11 . Server
12 12 .
13 13 . No-LFS LFS
14 14 . +----------------------------+
15 15 . | || D | E | D | E |
16 16 . |---++=======================|
17 17 . C | D || N/A | #1 | X | #4 |
18 18 . l No +---++-----------------------|
19 19 . i LFS | E || #2 | #2 | X | #5 |
20 20 . e +---++-----------------------|
21 21 . n | D || X | X | X | X |
22 22 . t LFS |---++-----------------------|
23 23 . | E || #3 | #3 | X | #6 |
24 24 . |---++-----------------------+
25 25
26 26 make command server magic visible
27 27
28 28 #if windows
29 29 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
30 30 #else
31 31 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
32 32 #endif
33 33 $ export PYTHONPATH
34 34
35 35 $ hg init server
36 36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires"
37 37
38 38 $ cat > $TESTTMP/debugprocessors.py <<EOF
39 39 > from mercurial import (
40 40 > cmdutil,
41 41 > commands,
42 42 > pycompat,
43 43 > registrar,
44 44 > )
45 45 > cmdtable = {}
46 46 > command = registrar.command(cmdtable)
47 47 > @command(b'debugprocessors', [], b'FILE')
48 48 > def debugprocessors(ui, repo, file_=None, **opts):
49 49 > opts = pycompat.byteskwargs(opts)
50 50 > opts[b'changelog'] = False
51 51 > opts[b'manifest'] = False
52 52 > opts[b'dir'] = False
53 53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts)
54 54 > for flag, proc in rl._flagprocessors.items():
55 55 > ui.status(b"registered processor '%#x'\n" % (flag))
56 56 > EOF
57 57
58 58 Skip the experimental.changegroup3=True config. Failure to agree on this comes
59 59 first, and causes an "abort: no common changegroup version" if the extension is
60 60 only loaded on one side. If that *is* enabled, the subsequent failure is "abort:
61 61 missing processor for flag '0x2000'!" if the extension is only loaded on one side
62 62 (possibly also masked by the Internal Server Error message).
63 63 $ cat >> $HGRCPATH <<EOF
64 64 > [extensions]
65 65 > debugprocessors = $TESTTMP/debugprocessors.py
66 66 > [experimental]
67 67 > lfs.disableusercache = True
68 68 > lfs.worker-enable = False
69 69 > [lfs]
70 70 > threshold=10
71 71 > [web]
72 72 > allow_push=*
73 73 > push_ssl=False
74 74 > EOF
75 75
76 76 $ cp $HGRCPATH $HGRCPATH.orig
77 77
78 78 #if lfsremote-on
79 79 $ hg --config extensions.lfs= -R server \
80 80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
81 81 #else
82 82 $ hg --config extensions.lfs=! -R server \
83 83 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log
84 84 #endif
85 85
86 86 $ cat hg.pid >> $DAEMON_PIDS
87 87 $ hg clone -q http://localhost:$HGPORT client
88 88 $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES
89 89 [1]
90 90
91 91 This trivial repo will force commandserver to load the extension, but not call
92 92 reposetup() on another repo actually being operated on. This gives coverage
93 93 that wrapper functions are not assuming reposetup() was called.
94 94
95 95 $ hg init $TESTTMP/cmdservelfs
96 96 $ cat >> $TESTTMP/cmdservelfs/.hg/hgrc << EOF
97 97 > [extensions]
98 98 > lfs =
99 99 > EOF
100 100
101 101 --------------------------------------------------------------------------------
102 102 Case #1: client with non-lfs content and the extension disabled; server with
103 103 non-lfs content, and the extension enabled.
104 104
105 105 $ cd client
106 106 $ echo 'non-lfs' > nonlfs.txt
107 107 >>> from __future__ import absolute_import
108 108 >>> from hgclient import check, readchannel, runcommand
109 109 >>> @check
110 110 ... def diff(server):
111 111 ... readchannel(server)
112 112 ... # run an arbitrary command in the repo with the extension loaded
113 113 ... runcommand(server, [b'id', b'-R', b'../cmdservelfs'])
114 114 ... # now run a command in a repo without the extension to ensure that
115 115 ... # files are added safely..
116 116 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
117 117 ... # .. and that scmutil.prefetchfiles() safely no-ops..
118 118 ... runcommand(server, [b'diff', b'-r', b'.~1'])
119 119 ... # .. and that debugupgraderepo safely no-ops.
120 120 ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run'])
121 121 *** runcommand id -R ../cmdservelfs
122 122 000000000000 tip
123 123 *** runcommand ci -Aqm non-lfs
124 124 *** runcommand diff -r .~1
125 125 diff -r 000000000000 nonlfs.txt
126 126 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
127 127 +++ b/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
128 128 @@ -0,0 +1,1 @@
129 129 +non-lfs
130 130 *** runcommand debugupgraderepo -q --run
131 upgrade will perform the following actions:
132
133 requirements
134 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
135
136 processed revlogs:
137 - all-filelogs
138 - changelog
139 - manifest
140
141 131
142 132 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
143 133 [1]
144 134
145 135 #if lfsremote-on
146 136
147 137 $ hg push -q
148 138 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
149 139 [1]
150 140
151 141 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
152 142 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
153 143 [1]
154 144
155 145 $ hg init $TESTTMP/client1_pull
156 146 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
157 147 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
158 148 [1]
159 149
160 150 $ hg identify http://localhost:$HGPORT
161 151 d437e1d24fbd
162 152
163 153 #endif
164 154
165 155 --------------------------------------------------------------------------------
166 156 Case #2: client with non-lfs content and the extension enabled; server with
167 157 non-lfs content, and the extension state controlled by #testcases.
168 158
169 159 $ cat >> $HGRCPATH <<EOF
170 160 > [extensions]
171 161 > lfs =
172 162 > EOF
173 163 $ echo 'non-lfs' > nonlfs2.txt
174 164 $ hg ci -Aqm 'non-lfs file with lfs client'
175 165
176 166 Since no lfs content has been added yet, the push is allowed, even when the
177 167 extension is not enabled remotely.
178 168
179 169 $ hg push -q
180 170 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
181 171 [1]
182 172
183 173 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone
184 174 $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES
185 175 [1]
186 176
187 177 $ hg init $TESTTMP/client2_pull
188 178 $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT
189 179 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
190 180 [1]
191 181
192 182 $ hg identify http://localhost:$HGPORT
193 183 1477875038c6
194 184
195 185 --------------------------------------------------------------------------------
196 186 Case #3: client with lfs content and the extension enabled; server with
197 187 non-lfs content, and the extension state controlled by #testcases. The server
198 188 should have an 'lfs' requirement after it picks up its first commit with a blob.
199 189
200 190 $ echo 'this is a big lfs file' > lfs.bin
201 191 $ hg ci -Aqm 'lfs'
202 192 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
203 193 .hg/requires:lfs
204 194
205 195 #if lfsremote-off
206 196 $ hg push -q
207 197 abort: required features are not supported in the destination: lfs
208 198 (enable the lfs extension on the server)
209 199 [255]
210 200 #else
211 201 $ hg push -q
212 202 #endif
213 203 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
214 204 .hg/requires:lfs
215 205 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
216 206
217 207 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone
218 208 $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true
219 209 $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !)
220 210 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
221 211
222 212 $ hg init $TESTTMP/client3_pull
223 213 $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT
224 214 $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true
225 215 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
226 216 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
227 217
228 218 Test that the commit/changegroup requirement check hook can be run multiple
229 219 times.
230 220
231 221 $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3
232 222
233 223 $ cd ../cmdserve_client3
234 224
235 225 >>> from __future__ import absolute_import
236 226 >>> from hgclient import check, readchannel, runcommand
237 227 >>> @check
238 228 ... def addrequirement(server):
239 229 ... readchannel(server)
240 230 ... # change the repo in a way that adds the lfs requirement
241 231 ... runcommand(server, [b'pull', b'-qu'])
242 232 ... # Now cause the requirement adding hook to fire again, without going
243 233 ... # through reposetup() again.
244 234 ... with open('file.txt', 'wb') as fp:
245 235 ... fp.write(b'data')
246 236 ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs'])
247 237 *** runcommand pull -qu
248 238 *** runcommand ci -Aqm non-lfs
249 239
250 240 $ cd ../client
251 241
252 242 The difference here is the push failed above when the extension isn't
253 243 enabled on the server.
254 244 $ hg identify http://localhost:$HGPORT
255 245 8374dc4052cb (lfsremote-on !)
256 246 1477875038c6 (lfsremote-off !)
257 247
258 248 Don't bother testing the lfsremote-off cases- the server won't be able
259 249 to launch if there's lfs content and the extension is disabled.
260 250
261 251 #if lfsremote-on
262 252
263 253 --------------------------------------------------------------------------------
264 254 Case #4: client with non-lfs content and the extension disabled; server with
265 255 lfs content, and the extension enabled.
266 256
267 257 $ cat >> $HGRCPATH <<EOF
268 258 > [extensions]
269 259 > lfs = !
270 260 > EOF
271 261
272 262 $ hg init $TESTTMP/client4
273 263 $ cd $TESTTMP/client4
274 264 $ cat >> .hg/hgrc <<EOF
275 265 > [paths]
276 266 > default = http://localhost:$HGPORT
277 267 > EOF
278 268 $ echo 'non-lfs' > nonlfs2.txt
279 269 $ hg ci -Aqm 'non-lfs'
280 270 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
281 271 $TESTTMP/server/.hg/requires:lfs
282 272
283 273 $ hg push -q --force
284 274 warning: repository is unrelated
285 275 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
286 276 $TESTTMP/server/.hg/requires:lfs
287 277
288 278 $ hg clone http://localhost:$HGPORT $TESTTMP/client4_clone
289 279 (remote is using large file support (lfs), but it is explicitly disabled in the local configuration)
290 280 abort: repository requires features unknown to this Mercurial: lfs
291 281 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
292 282 [255]
293 283 $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES
294 284 grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$
295 285 $TESTTMP/server/.hg/requires:lfs
296 286 [2]
297 287
298 288 TODO: fail more gracefully.
299 289
300 290 $ hg init $TESTTMP/client4_pull
301 291 $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT
302 292 pulling from http://localhost:$HGPORT/
303 293 requesting all changes
304 294 remote: abort: no common changegroup version
305 295 abort: pull failed on remote
306 296 [255]
307 297 $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES
308 298 $TESTTMP/server/.hg/requires:lfs
309 299
310 300 $ hg identify http://localhost:$HGPORT
311 301 03b080fa9d93
312 302
313 303 --------------------------------------------------------------------------------
314 304 Case #5: client with non-lfs content and the extension enabled; server with
315 305 lfs content, and the extension enabled.
316 306
317 307 $ cat >> $HGRCPATH <<EOF
318 308 > [extensions]
319 309 > lfs =
320 310 > EOF
321 311 $ echo 'non-lfs' > nonlfs3.txt
322 312 $ hg ci -Aqm 'non-lfs file with lfs client'
323 313
324 314 $ hg push -q
325 315 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
326 316 $TESTTMP/server/.hg/requires:lfs
327 317
328 318 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone
329 319 $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES
330 320 $TESTTMP/client5_clone/.hg/requires:lfs
331 321 $TESTTMP/server/.hg/requires:lfs
332 322
333 323 $ hg init $TESTTMP/client5_pull
334 324 $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT
335 325 $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES
336 326 $TESTTMP/client5_pull/.hg/requires:lfs
337 327 $TESTTMP/server/.hg/requires:lfs
338 328
339 329 $ hg identify http://localhost:$HGPORT
340 330 c729025cc5e3
341 331
342 332 $ mv $HGRCPATH $HGRCPATH.tmp
343 333 $ cp $HGRCPATH.orig $HGRCPATH
344 334
345 335 >>> from __future__ import absolute_import
346 336 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
347 337 >>> @check
348 338 ... def checkflags(server):
349 339 ... readchannel(server)
350 340 ... bprint(b'')
351 341 ... bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
352 342 ... stdout.flush()
353 343 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
354 344 ... b'../server'])
355 345 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
356 346 ... b'../server'])
357 347 ... runcommand(server, [b'config', b'extensions', b'--cwd',
358 348 ... b'../server'])
359 349 ...
360 350 ... bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
361 351 ... stdout.flush()
362 352 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
363 353 ... runcommand(server, [b'config', b'extensions'])
364 354
365 355 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
366 356 *** runcommand debugprocessors lfs.bin -R ../server
367 357 registered processor '0x8000'
368 358 registered processor '0x800'
369 359 registered processor '0x2000'
370 360 *** runcommand debugprocessors nonlfs2.txt -R ../server
371 361 registered processor '0x8000'
372 362 registered processor '0x800'
373 363 registered processor '0x2000'
374 364 *** runcommand config extensions --cwd ../server
375 365 extensions.debugprocessors=$TESTTMP/debugprocessors.py
376 366 extensions.lfs=
377 367
378 368 # LFS not enabled- revlogs don't have 0x2000 flag
379 369 *** runcommand debugprocessors nonlfs3.txt
380 370 registered processor '0x8000'
381 371 registered processor '0x800'
382 372 *** runcommand config extensions
383 373 extensions.debugprocessors=$TESTTMP/debugprocessors.py
384 374
385 375 $ rm $HGRCPATH
386 376 $ mv $HGRCPATH.tmp $HGRCPATH
387 377
388 378 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs=
389 379 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF
390 380 > [extensions]
391 381 > lfs = !
392 382 > EOF
393 383
394 384 >>> from __future__ import absolute_import, print_function
395 385 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
396 386 >>> @check
397 387 ... def checkflags2(server):
398 388 ... readchannel(server)
399 389 ... bprint(b'')
400 390 ... bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
401 391 ... stdout.flush()
402 392 ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
403 393 ... b'../server'])
404 394 ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
405 395 ... b'../server'])
406 396 ... runcommand(server, [b'config', b'extensions', b'--cwd',
407 397 ... b'../server'])
408 398 ...
409 399 ... bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
410 400 ... stdout.flush()
411 401 ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
412 402 ... runcommand(server, [b'config', b'extensions'])
413 403 ...
414 404 ... bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
415 405 ... stdout.flush()
416 406 ... runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
417 407 ... b'../nonlfs'])
418 408 ... runcommand(server, [b'config', b'extensions', b'--cwd',
419 409 ... b'../nonlfs'])
420 410
421 411 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
422 412 *** runcommand debugprocessors lfs.bin -R ../server
423 413 registered processor '0x8000'
424 414 registered processor '0x800'
425 415 registered processor '0x2000'
426 416 *** runcommand debugprocessors nonlfs2.txt -R ../server
427 417 registered processor '0x8000'
428 418 registered processor '0x800'
429 419 registered processor '0x2000'
430 420 *** runcommand config extensions --cwd ../server
431 421 extensions.debugprocessors=$TESTTMP/debugprocessors.py
432 422 extensions.lfs=
433 423
434 424 # LFS enabled without requirement- revlogs have 0x2000 flag
435 425 *** runcommand debugprocessors nonlfs3.txt
436 426 registered processor '0x8000'
437 427 registered processor '0x800'
438 428 registered processor '0x2000'
439 429 *** runcommand config extensions
440 430 extensions.debugprocessors=$TESTTMP/debugprocessors.py
441 431 extensions.lfs=
442 432
443 433 # LFS disabled locally- revlogs don't have 0x2000 flag
444 434 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
445 435 registered processor '0x8000'
446 436 registered processor '0x800'
447 437 *** runcommand config extensions --cwd ../nonlfs
448 438 extensions.debugprocessors=$TESTTMP/debugprocessors.py
449 439 extensions.lfs=!
450 440
451 441 --------------------------------------------------------------------------------
452 442 Case #6: client with lfs content and the extension enabled; server with
453 443 lfs content, and the extension enabled.
454 444
455 445 $ echo 'this is another lfs file' > lfs2.txt
456 446 $ hg ci -Aqm 'lfs file with lfs client'
457 447
458 448 $ hg --config paths.default= push -v http://localhost:$HGPORT
459 449 pushing to http://localhost:$HGPORT/
460 450 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
461 451 searching for changes
462 452 remote has heads on branch 'default' that are not known locally: 8374dc4052cb
463 453 lfs: uploading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
464 454 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
465 455 lfs: uploaded 1 files (25 bytes)
466 456 1 changesets found
467 457 uncompressed size of bundle content:
468 458 206 (changelog)
469 459 172 (manifests)
470 460 275 lfs2.txt
471 461 remote: adding changesets
472 462 remote: adding manifests
473 463 remote: adding file changes
474 464 remote: added 1 changesets with 1 changes to 1 files
475 465 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
476 466 .hg/requires:lfs
477 467 $TESTTMP/server/.hg/requires:lfs
478 468
479 469 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone
480 470 $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES
481 471 $TESTTMP/client6_clone/.hg/requires:lfs
482 472 $TESTTMP/server/.hg/requires:lfs
483 473
484 474 $ hg init $TESTTMP/client6_pull
485 475 $ hg -R $TESTTMP/client6_pull pull -u -v http://localhost:$HGPORT
486 476 pulling from http://localhost:$HGPORT/
487 477 requesting all changes
488 478 adding changesets
489 479 adding manifests
490 480 adding file changes
491 481 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
492 482 added 6 changesets with 5 changes to 5 files (+1 heads)
493 483 new changesets d437e1d24fbd:d3b84d50eacb
494 484 resolving manifests
495 485 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
496 486 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
497 487 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
498 488 lfs: downloaded 1 files (25 bytes)
499 489 getting lfs2.txt
500 490 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
501 491 getting nonlfs2.txt
502 492 getting nonlfs3.txt
503 493 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 494 updated to "d3b84d50eacb: lfs file with lfs client"
505 495 1 other heads for branch "default"
506 496 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
507 497 $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
508 498 $TESTTMP/client6_pull/.hg/requires:lfs
509 499 $TESTTMP/server/.hg/requires:lfs
510 500
511 501 $ hg identify http://localhost:$HGPORT
512 502 d3b84d50eacb
513 503
514 504 --------------------------------------------------------------------------------
515 505 Misc: process dies early if a requirement exists and the extension is disabled
516 506
517 507 $ hg --config extensions.lfs=! summary
518 508 abort: repository requires features unknown to this Mercurial: lfs
519 509 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
520 510 [255]
521 511
522 512 $ echo 'this is an lfs file' > $TESTTMP/client6_clone/lfspair1.bin
523 513 $ echo 'this is an lfs file too' > $TESTTMP/client6_clone/lfspair2.bin
524 514 $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
525 515 $ hg -R $TESTTMP/client6_clone push -q
526 516
527 517 $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
528 518
529 519 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
530 520
531 521 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
532 522 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
533 523 version https://git-lfs.github.com/spec/v1
534 524 oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
535 525 size 20
536 526 x-is-binary 0
537 527
538 528 lfspair1.bin
539 529
540 530 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
541 531 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
542 532 [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
543 533 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
544 534 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
545 535 lfs: downloaded 1 files (20 bytes)
546 536 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
547 537
548 538 {
549 539 "data": "this is an lfs file\n",
550 540 "path": "lfspair1.bin",
551 541 "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
552 542 }
553 543 ]
554 544
555 545 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
556 546
557 547 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
558 548 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
559 549 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
560 550 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
561 551 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
562 552 lfs: downloaded 1 files (20 bytes)
563 553 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
564 554 this is an lfs file
565 555
566 556 $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
567 557 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
568 558 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
569 559 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
570 560 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
571 561 lfs: downloaded 1 files (24 bytes)
572 562 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
573 563 this is an lfs file too
574 564
575 565 Export will prefetch all needed files across all needed revisions
576 566
577 567 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
578 568 $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
579 569 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
580 570 exporting patches:
581 571 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
582 572 lfs: need to transfer 4 objects (92 bytes)
583 573 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
584 574 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
585 575 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
586 576 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
587 577 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
588 578 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
589 579 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
590 580 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
591 581 lfs: downloaded 4 files (92 bytes)
592 582 all.export
593 583 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
594 584 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
595 585 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
596 586 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
597 587
598 588 Export with selected files is used with `extdiff --patch`
599 589
600 590 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
601 591 $ hg --config extensions.extdiff= \
602 592 > -R $TESTTMP/bulkfetch -v extdiff -r 2:tip --patch $TESTTMP/bulkfetch/lfs.bin
603 593 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
604 594 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
605 595 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
606 596 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
607 597 lfs: downloaded 1 files (23 bytes)
608 598 */hg-8374dc4052cb.patch (glob)
609 599 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
610 600 */hg-9640b57e77b1.patch (glob)
611 601 --- */hg-8374dc4052cb.patch * (glob)
612 602 +++ */hg-9640b57e77b1.patch * (glob)
613 603 @@ -2,12 +2,7 @@
614 604 # User test
615 605 # Date 0 0
616 606 # Thu Jan 01 00:00:00 1970 +0000
617 607 -# Node ID 8374dc4052cbd388e79d9dc4ddb29784097aa354
618 608 -# Parent 1477875038c60152e391238920a16381c627b487
619 609 -lfs
620 610 +# Node ID 9640b57e77b14c3a0144fb4478b6cc13e13ea0d1
621 611 +# Parent d3b84d50eacbd56638e11abce6b8616aaba54420
622 612 +add lfs pair
623 613
624 614 -diff -r 1477875038c6 -r 8374dc4052cb lfs.bin
625 615 ---- /dev/null Thu Jan 01 00:00:00 1970 +0000
626 616 -+++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000
627 617 -@@ -0,0 +1,1 @@
628 618 -+this is a big lfs file
629 619 cleaning up temp directory
630 620 [1]
631 621
632 622 Diff will prefetch files
633 623
634 624 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
635 625 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip
636 626 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
637 627 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
638 628 lfs: need to transfer 4 objects (92 bytes)
639 629 lfs: downloading a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de (25 bytes)
640 630 lfs: processed: a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de
641 631 lfs: downloading bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc (23 bytes)
642 632 lfs: processed: bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc
643 633 lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
644 634 lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
645 635 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
646 636 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
647 637 lfs: downloaded 4 files (92 bytes)
648 638 lfs: found bed80f00180ac404b843628ab56a1c1984d6145c391cd1628a7dd7d2598d71fc in the local lfs store
649 639 lfs: found a82f1c5cea0d40e3bb3a849686bb4e6ae47ca27e614de55c1ed0325698ef68de in the local lfs store
650 640 lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
651 641 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
652 642 diff -r 8374dc4052cb -r 9640b57e77b1 lfs.bin
653 643 --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000
654 644 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
655 645 @@ -1,1 +0,0 @@
656 646 -this is a big lfs file
657 647 diff -r 8374dc4052cb -r 9640b57e77b1 lfs2.txt
658 648 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
659 649 +++ b/lfs2.txt Thu Jan 01 00:00:00 1970 +0000
660 650 @@ -0,0 +1,1 @@
661 651 +this is another lfs file
662 652 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair1.bin
663 653 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
664 654 +++ b/lfspair1.bin Thu Jan 01 00:00:00 1970 +0000
665 655 @@ -0,0 +1,1 @@
666 656 +this is an lfs file
667 657 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
668 658 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
669 659 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
670 660 @@ -0,0 +1,1 @@
671 661 +this is an lfs file too
672 662 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs.txt
673 663 --- a/nonlfs.txt Thu Jan 01 00:00:00 1970 +0000
674 664 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
675 665 @@ -1,1 +0,0 @@
676 666 -non-lfs
677 667 diff -r 8374dc4052cb -r 9640b57e77b1 nonlfs3.txt
678 668 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
679 669 +++ b/nonlfs3.txt Thu Jan 01 00:00:00 1970 +0000
680 670 @@ -0,0 +1,1 @@
681 671 +non-lfs
682 672
683 673 Only the files required by diff are prefetched
684 674
685 675 $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
686 676 $ hg -R $TESTTMP/bulkfetch -v diff -r 2:tip $TESTTMP/bulkfetch/lfspair2.bin
687 677 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
688 678 lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
689 679 lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
690 680 lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
691 681 lfs: downloaded 1 files (24 bytes)
692 682 lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
693 683 diff -r 8374dc4052cb -r 9640b57e77b1 lfspair2.bin
694 684 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
695 685 +++ b/lfspair2.bin Thu Jan 01 00:00:00 1970 +0000
696 686 @@ -0,0 +1,1 @@
697 687 +this is an lfs file too
698 688
699 689 #endif
700 690
701 691 $ "$PYTHON" $TESTDIR/killdaemons.py $DAEMON_PIDS
702 692
703 693 $ cat $TESTTMP/errors.log
@@ -1,1685 +1,1527 b''
1 1 #require no-reposimplestore
2 2
3 3 $ cat >> $HGRCPATH << EOF
4 4 > [extensions]
5 5 > share =
6 6 > EOF
7 7
8 8 store and revlogv1 are required in source
9 9
10 10 $ hg --config format.usestore=false init no-store
11 11 $ hg -R no-store debugupgraderepo
12 12 abort: cannot upgrade repository; requirement missing: store
13 13 [255]
14 14
15 15 $ hg init no-revlogv1
16 16 $ cat > no-revlogv1/.hg/requires << EOF
17 17 > dotencode
18 18 > fncache
19 19 > generaldelta
20 20 > store
21 21 > EOF
22 22
23 23 $ hg -R no-revlogv1 debugupgraderepo
24 24 abort: cannot upgrade repository; requirement missing: revlogv1
25 25 [255]
26 26
27 27 Cannot upgrade shared repositories
28 28
29 29 $ hg init share-parent
30 30 $ hg -q share share-parent share-child
31 31
32 32 $ hg -R share-child debugupgraderepo
33 33 abort: cannot upgrade repository; unsupported source requirement: shared
34 34 [255]
35 35
36 36 Do not yet support upgrading treemanifest repos
37 37
38 38 $ hg --config experimental.treemanifest=true init treemanifest
39 39 $ hg -R treemanifest debugupgraderepo
40 40 abort: cannot upgrade repository; unsupported source requirement: treemanifest
41 41 [255]
42 42
43 43 Cannot add treemanifest requirement during upgrade
44 44
45 45 $ hg init disallowaddedreq
46 46 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
47 47 abort: cannot upgrade repository; do not support adding requirement: treemanifest
48 48 [255]
49 49
50 50 An upgrade of a repository created with recommended settings only suggests optimizations
51 51
52 52 $ hg init empty
53 53 $ cd empty
54 54 $ hg debugformat
55 55 format-variant repo
56 56 fncache: yes
57 57 dotencode: yes
58 58 generaldelta: yes
59 59 exp-sharesafe: no
60 60 sparserevlog: yes
61 61 sidedata: no
62 62 persistent-nodemap: no
63 63 copies-sdc: no
64 64 plain-cl-delta: yes
65 65 compression: zlib
66 66 compression-level: default
67 67 $ hg debugformat --verbose
68 68 format-variant repo config default
69 69 fncache: yes yes yes
70 70 dotencode: yes yes yes
71 71 generaldelta: yes yes yes
72 72 exp-sharesafe: no no no
73 73 sparserevlog: yes yes yes
74 74 sidedata: no no no
75 75 persistent-nodemap: no no no
76 76 copies-sdc: no no no
77 77 plain-cl-delta: yes yes yes
78 78 compression: zlib zlib zlib
79 79 compression-level: default default default
80 80 $ hg debugformat --verbose --config format.usefncache=no
81 81 format-variant repo config default
82 82 fncache: yes no yes
83 83 dotencode: yes no yes
84 84 generaldelta: yes yes yes
85 85 exp-sharesafe: no no no
86 86 sparserevlog: yes yes yes
87 87 sidedata: no no no
88 88 persistent-nodemap: no no no
89 89 copies-sdc: no no no
90 90 plain-cl-delta: yes yes yes
91 91 compression: zlib zlib zlib
92 92 compression-level: default default default
93 93 $ hg debugformat --verbose --config format.usefncache=no --color=debug
94 94 format-variant repo config default
95 95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
97 97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
98 98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
99 99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
100 100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 102 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
103 103 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
104 104 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
105 105 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
106 106 $ hg debugformat -Tjson
107 107 [
108 108 {
109 109 "config": true,
110 110 "default": true,
111 111 "name": "fncache",
112 112 "repo": true
113 113 },
114 114 {
115 115 "config": true,
116 116 "default": true,
117 117 "name": "dotencode",
118 118 "repo": true
119 119 },
120 120 {
121 121 "config": true,
122 122 "default": true,
123 123 "name": "generaldelta",
124 124 "repo": true
125 125 },
126 126 {
127 127 "config": false,
128 128 "default": false,
129 129 "name": "exp-sharesafe",
130 130 "repo": false
131 131 },
132 132 {
133 133 "config": true,
134 134 "default": true,
135 135 "name": "sparserevlog",
136 136 "repo": true
137 137 },
138 138 {
139 139 "config": false,
140 140 "default": false,
141 141 "name": "sidedata",
142 142 "repo": false
143 143 },
144 144 {
145 145 "config": false,
146 146 "default": false,
147 147 "name": "persistent-nodemap",
148 148 "repo": false
149 149 },
150 150 {
151 151 "config": false,
152 152 "default": false,
153 153 "name": "copies-sdc",
154 154 "repo": false
155 155 },
156 156 {
157 157 "config": true,
158 158 "default": true,
159 159 "name": "plain-cl-delta",
160 160 "repo": true
161 161 },
162 162 {
163 163 "config": "zlib",
164 164 "default": "zlib",
165 165 "name": "compression",
166 166 "repo": "zlib"
167 167 },
168 168 {
169 169 "config": "default",
170 170 "default": "default",
171 171 "name": "compression-level",
172 172 "repo": "default"
173 173 }
174 174 ]
175 175 $ hg debugupgraderepo
176 176 (no format upgrades found in existing repository)
177 177 performing an upgrade with "--run" will make the following changes:
178 178
179 179 requirements
180 180 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
181 181
182 182 processed revlogs:
183 183 - all-filelogs
184 184 - changelog
185 185 - manifest
186 186
187 187 additional optimizations are available by specifying "--optimize <name>":
188 188
189 189 re-delta-parent
190 190 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
191 191
192 192 re-delta-multibase
193 193 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
194 194
195 195 re-delta-all
196 196 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
197 197
198 198 re-delta-fulladd
199 199 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
200 200
201 201
202 202 $ hg debugupgraderepo --quiet
203 203 requirements
204 204 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
205 205
206 206 processed revlogs:
207 207 - all-filelogs
208 208 - changelog
209 209 - manifest
210 210
211 211
212 212 --optimize can be used to add optimizations
213 213
214 214 $ hg debugupgrade --optimize 're-delta-parent'
215 215 (no format upgrades found in existing repository)
216 216 performing an upgrade with "--run" will make the following changes:
217 217
218 218 requirements
219 219 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
220 220
221 221 optimisations: re-delta-parent
222 222
223 223 re-delta-parent
224 224 deltas within internal storage will choose a new base revision if needed
225 225
226 226 processed revlogs:
227 227 - all-filelogs
228 228 - changelog
229 229 - manifest
230 230
231 231 additional optimizations are available by specifying "--optimize <name>":
232 232
233 233 re-delta-multibase
234 234 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
235 235
236 236 re-delta-all
237 237 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
238 238
239 239 re-delta-fulladd
240 240 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
241 241
242 242
243 243 modern form of the option
244 244
245 245 $ hg debugupgrade --optimize re-delta-parent
246 246 (no format upgrades found in existing repository)
247 247 performing an upgrade with "--run" will make the following changes:
248 248
249 249 requirements
250 250 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
251 251
252 252 optimisations: re-delta-parent
253 253
254 254 re-delta-parent
255 255 deltas within internal storage will choose a new base revision if needed
256 256
257 257 processed revlogs:
258 258 - all-filelogs
259 259 - changelog
260 260 - manifest
261 261
262 262 additional optimizations are available by specifying "--optimize <name>":
263 263
264 264 re-delta-multibase
265 265 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
266 266
267 267 re-delta-all
268 268 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
269 269
270 270 re-delta-fulladd
271 271 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
272 272
273 273 $ hg debugupgrade --optimize re-delta-parent --quiet
274 274 requirements
275 275 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
276 276
277 277 optimisations: re-delta-parent
278 278
279 279 processed revlogs:
280 280 - all-filelogs
281 281 - changelog
282 282 - manifest
283 283
284 284
285 285 unknown optimization:
286 286
287 287 $ hg debugupgrade --optimize foobar
288 288 abort: unknown optimization action requested: foobar
289 289 (run without arguments to see valid optimizations)
290 290 [255]
291 291
292 292 Various sub-optimal detections work
293 293
294 294 $ cat > .hg/requires << EOF
295 295 > revlogv1
296 296 > store
297 297 > EOF
298 298
299 299 $ hg debugformat
300 300 format-variant repo
301 301 fncache: no
302 302 dotencode: no
303 303 generaldelta: no
304 304 exp-sharesafe: no
305 305 sparserevlog: no
306 306 sidedata: no
307 307 persistent-nodemap: no
308 308 copies-sdc: no
309 309 plain-cl-delta: yes
310 310 compression: zlib
311 311 compression-level: default
312 312 $ hg debugformat --verbose
313 313 format-variant repo config default
314 314 fncache: no yes yes
315 315 dotencode: no yes yes
316 316 generaldelta: no yes yes
317 317 exp-sharesafe: no no no
318 318 sparserevlog: no yes yes
319 319 sidedata: no no no
320 320 persistent-nodemap: no no no
321 321 copies-sdc: no no no
322 322 plain-cl-delta: yes yes yes
323 323 compression: zlib zlib zlib
324 324 compression-level: default default default
325 325 $ hg debugformat --verbose --config format.usegeneraldelta=no
326 326 format-variant repo config default
327 327 fncache: no yes yes
328 328 dotencode: no yes yes
329 329 generaldelta: no no yes
330 330 exp-sharesafe: no no no
331 331 sparserevlog: no no yes
332 332 sidedata: no no no
333 333 persistent-nodemap: no no no
334 334 copies-sdc: no no no
335 335 plain-cl-delta: yes yes yes
336 336 compression: zlib zlib zlib
337 337 compression-level: default default default
338 338 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
339 339 format-variant repo config default
340 340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
342 342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
343 343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
344 344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
345 345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 347 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
348 348 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
349 349 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
350 350 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
351 351 $ hg debugupgraderepo
352 352 repository lacks features recommended by current config options:
353 353
354 354 fncache
355 355 long and reserved filenames may not work correctly; repository performance is sub-optimal
356 356
357 357 dotencode
358 358 storage of filenames beginning with a period or space may not work correctly
359 359
360 360 generaldelta
361 361 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
362 362
363 363 sparserevlog
364 364 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
365 365
366 366
367 367 performing an upgrade with "--run" will make the following changes:
368 368
369 369 requirements
370 370 preserved: revlogv1, store
371 371 added: dotencode, fncache, generaldelta, sparserevlog
372 372
373 373 fncache
374 374 repository will be more resilient to storing certain paths and performance of certain operations should be improved
375 375
376 376 dotencode
377 377 repository will be better able to store files beginning with a space or period
378 378
379 379 generaldelta
380 380 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
381 381
382 382 sparserevlog
383 383 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
384 384
385 385 processed revlogs:
386 386 - all-filelogs
387 387 - changelog
388 388 - manifest
389 389
390 390 additional optimizations are available by specifying "--optimize <name>":
391 391
392 392 re-delta-parent
393 393 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
394 394
395 395 re-delta-multibase
396 396 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
397 397
398 398 re-delta-all
399 399 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
400 400
401 401 re-delta-fulladd
402 402 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
403 403
404 404 $ hg debugupgraderepo --quiet
405 405 requirements
406 406 preserved: revlogv1, store
407 407 added: dotencode, fncache, generaldelta, sparserevlog
408 408
409 409 processed revlogs:
410 410 - all-filelogs
411 411 - changelog
412 412 - manifest
413 413
414 414
415 415 $ hg --config format.dotencode=false debugupgraderepo
416 416 repository lacks features recommended by current config options:
417 417
418 418 fncache
419 419 long and reserved filenames may not work correctly; repository performance is sub-optimal
420 420
421 421 generaldelta
422 422 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
423 423
424 424 sparserevlog
425 425 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
426 426
427 427 repository lacks features used by the default config options:
428 428
429 429 dotencode
430 430 storage of filenames beginning with a period or space may not work correctly
431 431
432 432
433 433 performing an upgrade with "--run" will make the following changes:
434 434
435 435 requirements
436 436 preserved: revlogv1, store
437 437 added: fncache, generaldelta, sparserevlog
438 438
439 439 fncache
440 440 repository will be more resilient to storing certain paths and performance of certain operations should be improved
441 441
442 442 generaldelta
443 443 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
444 444
445 445 sparserevlog
446 446 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
447 447
448 448 processed revlogs:
449 449 - all-filelogs
450 450 - changelog
451 451 - manifest
452 452
453 453 additional optimizations are available by specifying "--optimize <name>":
454 454
455 455 re-delta-parent
456 456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
457 457
458 458 re-delta-multibase
459 459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
460 460
461 461 re-delta-all
462 462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
463 463
464 464 re-delta-fulladd
465 465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
466 466
467 467
468 468 $ cd ..
469 469
470 470 Upgrading a repository that is already modern essentially no-ops
471 471
472 472 $ hg init modern
473 473 $ hg -R modern debugupgraderepo --run
474 upgrade will perform the following actions:
475
476 requirements
477 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
478
479 processed revlogs:
480 - all-filelogs
481 - changelog
482 - manifest
483
484 beginning upgrade...
485 repository locked and read-only
486 creating temporary repository to stage upgraded data: $TESTTMP/modern/.hg/upgrade.* (glob)
487 (it is safe to interrupt this process any time before data migration completes)
488 data fully upgraded in a temporary repository
489 marking source repository as being upgraded; clients will be unable to read from repository
490 starting in-place swap of repository data
491 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
492 replacing store...
493 store replacement complete; repository was inconsistent for *s (glob)
494 finalizing requirements file and making repository readable again
495 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
496 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
497 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
474 nothing to do
498 475
499 476 Upgrading a repository to generaldelta works
500 477
501 478 $ hg --config format.usegeneraldelta=false init upgradegd
502 479 $ cd upgradegd
503 480 $ touch f0
504 481 $ hg -q commit -A -m initial
505 482 $ mkdir FooBarDirectory.d
506 483 $ touch FooBarDirectory.d/f1
507 484 $ hg -q commit -A -m 'add f1'
508 485 $ hg -q up -r 0
509 486 >>> from __future__ import absolute_import, print_function
510 487 >>> import random
511 488 >>> random.seed(0) # have a reproducible content
512 489 >>> with open("f2", "wb") as f:
513 490 ... for i in range(100000):
514 491 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
515 492 $ hg -q commit -A -m 'add f2'
516 493
517 494 make sure we have a .d file
518 495
519 496 $ ls -d .hg/store/data/*
520 497 .hg/store/data/_foo_bar_directory.d.hg
521 498 .hg/store/data/f0.i
522 499 .hg/store/data/f2.d
523 500 .hg/store/data/f2.i
524 501
525 502 $ hg debugupgraderepo --run --config format.sparse-revlog=false
526 503 upgrade will perform the following actions:
527 504
528 505 requirements
529 506 preserved: dotencode, fncache, revlogv1, store
530 507 added: generaldelta
531 508
532 509 generaldelta
533 510 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
534 511
535 512 processed revlogs:
536 513 - all-filelogs
537 514 - changelog
538 515 - manifest
539 516
540 517 beginning upgrade...
541 518 repository locked and read-only
542 519 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
543 520 (it is safe to interrupt this process any time before data migration completes)
544 521 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
545 522 migrating 519 KB in store; 1.05 MB tracked data
546 523 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
547 524 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
548 525 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
549 526 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
550 527 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
551 528 finished migrating 3 changelog revisions; change in size: 0 bytes
552 529 finished migrating 9 total revisions; total change in store size: -17 bytes
553 530 copying phaseroots
554 531 data fully upgraded in a temporary repository
555 532 marking source repository as being upgraded; clients will be unable to read from repository
556 533 starting in-place swap of repository data
557 534 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
558 535 replacing store...
559 536 store replacement complete; repository was inconsistent for *s (glob)
560 537 finalizing requirements file and making repository readable again
561 538 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
562 539 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
563 540 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
564 541
565 542 Original requirements backed up
566 543
567 544 $ cat .hg/upgradebackup.*/requires
568 545 dotencode
569 546 fncache
570 547 revlogv1
571 548 store
572 549
573 550 generaldelta added to original requirements files
574 551
575 552 $ cat .hg/requires
576 553 dotencode
577 554 fncache
578 555 generaldelta
579 556 revlogv1
580 557 store
581 558
582 559 store directory has files we expect
583 560
584 561 $ ls .hg/store
585 562 00changelog.i
586 563 00manifest.i
587 564 data
588 565 fncache
589 566 phaseroots
590 567 undo
591 568 undo.backupfiles
592 569 undo.phaseroots
593 570
594 571 manifest should be generaldelta
595 572
596 573 $ hg debugrevlog -m | grep flags
597 574 flags : inline, generaldelta
598 575
599 576 verify should be happy
600 577
601 578 $ hg verify
602 579 checking changesets
603 580 checking manifests
604 581 crosschecking files in changesets and manifests
605 582 checking files
606 583 checked 3 changesets with 3 changes to 3 files
607 584
608 585 old store should be backed up
609 586
610 587 $ ls -d .hg/upgradebackup.*/
611 588 .hg/upgradebackup.*/ (glob)
612 589 $ ls .hg/upgradebackup.*/store
613 590 00changelog.i
614 591 00manifest.i
615 592 data
616 593 fncache
617 594 phaseroots
618 595 undo
619 596 undo.backup.fncache
620 597 undo.backupfiles
621 598 undo.phaseroots
622 599
623 600 unless --no-backup is passed
624 601
625 602 $ rm -rf .hg/upgradebackup.*/
626 603 $ hg debugupgraderepo --run --no-backup
627 604 upgrade will perform the following actions:
628 605
629 606 requirements
630 607 preserved: dotencode, fncache, generaldelta, revlogv1, store
631 608 added: sparserevlog
632 609
633 610 sparserevlog
634 611 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
635 612
636 613 processed revlogs:
637 614 - all-filelogs
638 615 - changelog
639 616 - manifest
640 617
641 618 beginning upgrade...
642 619 repository locked and read-only
643 620 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
644 621 (it is safe to interrupt this process any time before data migration completes)
645 622 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
646 623 migrating 519 KB in store; 1.05 MB tracked data
647 624 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
648 625 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
649 626 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
650 627 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
651 628 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
652 629 finished migrating 3 changelog revisions; change in size: 0 bytes
653 630 finished migrating 9 total revisions; total change in store size: 0 bytes
654 631 copying phaseroots
655 632 data fully upgraded in a temporary repository
656 633 marking source repository as being upgraded; clients will be unable to read from repository
657 634 starting in-place swap of repository data
658 635 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
659 636 replacing store...
660 637 store replacement complete; repository was inconsistent for * (glob)
661 638 finalizing requirements file and making repository readable again
662 639 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
663 640 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
664 641 $ ls -1 .hg/ | grep upgradebackup
665 642 [1]
666 643
667 644 We can restrict optimization to some revlog:
668 645
669 646 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
670 647 upgrade will perform the following actions:
671 648
672 649 requirements
673 650 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
674 651
675 652 optimisations: re-delta-parent
676 653
677 654 re-delta-parent
678 655 deltas within internal storage will choose a new base revision if needed
679 656
680 657 processed revlogs:
681 658 - manifest
682 659
683 660 beginning upgrade...
684 661 repository locked and read-only
685 662 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
686 663 (it is safe to interrupt this process any time before data migration completes)
687 664 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
688 665 migrating 519 KB in store; 1.05 MB tracked data
689 666 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
690 667 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
691 668 blindly copying data/f0.i containing 1 revisions
692 669 blindly copying data/f2.i containing 1 revisions
693 670 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
694 671 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
695 672 cloning 3 revisions from 00manifest.i
696 673 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
697 674 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
698 675 blindly copying 00changelog.i containing 3 revisions
699 676 finished migrating 3 changelog revisions; change in size: 0 bytes
700 677 finished migrating 9 total revisions; total change in store size: 0 bytes
701 678 copying phaseroots
702 679 data fully upgraded in a temporary repository
703 680 marking source repository as being upgraded; clients will be unable to read from repository
704 681 starting in-place swap of repository data
705 682 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
706 683 replacing store...
707 684 store replacement complete; repository was inconsistent for *s (glob)
708 685 finalizing requirements file and making repository readable again
709 686 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
710 687 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
711 688
712 689 Check that the repo still works fine
713 690
714 691 $ hg log -G --stat
715 692 @ changeset: 2:76d4395f5413 (no-py3 !)
716 693 @ changeset: 2:fca376863211 (py3 !)
717 694 | tag: tip
718 695 | parent: 0:ba592bf28da2
719 696 | user: test
720 697 | date: Thu Jan 01 00:00:00 1970 +0000
721 698 | summary: add f2
722 699 |
723 700 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
724 701 | 1 files changed, 100000 insertions(+), 0 deletions(-)
725 702 |
726 703 | o changeset: 1:2029ce2354e2
727 704 |/ user: test
728 705 | date: Thu Jan 01 00:00:00 1970 +0000
729 706 | summary: add f1
730 707 |
731 708 |
732 709 o changeset: 0:ba592bf28da2
733 710 user: test
734 711 date: Thu Jan 01 00:00:00 1970 +0000
735 712 summary: initial
736 713
737 714
738 715
739 716 $ hg verify
740 717 checking changesets
741 718 checking manifests
742 719 crosschecking files in changesets and manifests
743 720 checking files
744 721 checked 3 changesets with 3 changes to 3 files
745 722
746 723 Check we can select negatively
747 724
748 725 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
749 726 upgrade will perform the following actions:
750 727
751 728 requirements
752 729 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
753 730
754 731 optimisations: re-delta-parent
755 732
756 733 re-delta-parent
757 734 deltas within internal storage will choose a new base revision if needed
758 735
759 736 processed revlogs:
760 737 - all-filelogs
761 738 - changelog
762 739
763 740 beginning upgrade...
764 741 repository locked and read-only
765 742 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
766 743 (it is safe to interrupt this process any time before data migration completes)
767 744 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
768 745 migrating 519 KB in store; 1.05 MB tracked data
769 746 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
770 747 cloning 1 revisions from data/FooBarDirectory.d/f1.i
771 748 cloning 1 revisions from data/f0.i
772 749 cloning 1 revisions from data/f2.i
773 750 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
774 751 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
775 752 blindly copying 00manifest.i containing 3 revisions
776 753 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
777 754 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
778 755 cloning 3 revisions from 00changelog.i
779 756 finished migrating 3 changelog revisions; change in size: 0 bytes
780 757 finished migrating 9 total revisions; total change in store size: 0 bytes
781 758 copying phaseroots
782 759 data fully upgraded in a temporary repository
783 760 marking source repository as being upgraded; clients will be unable to read from repository
784 761 starting in-place swap of repository data
785 762 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
786 763 replacing store...
787 764 store replacement complete; repository was inconsistent for *s (glob)
788 765 finalizing requirements file and making repository readable again
789 766 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
790 767 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
791 768 $ hg verify
792 769 checking changesets
793 770 checking manifests
794 771 crosschecking files in changesets and manifests
795 772 checking files
796 773 checked 3 changesets with 3 changes to 3 files
797 774
798 775 Check that we can select changelog only
799 776
800 777 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
801 778 upgrade will perform the following actions:
802 779
803 780 requirements
804 781 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
805 782
806 783 optimisations: re-delta-parent
807 784
808 785 re-delta-parent
809 786 deltas within internal storage will choose a new base revision if needed
810 787
811 788 processed revlogs:
812 789 - changelog
813 790
814 791 beginning upgrade...
815 792 repository locked and read-only
816 793 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
817 794 (it is safe to interrupt this process any time before data migration completes)
818 795 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
819 796 migrating 519 KB in store; 1.05 MB tracked data
820 797 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
821 798 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
822 799 blindly copying data/f0.i containing 1 revisions
823 800 blindly copying data/f2.i containing 1 revisions
824 801 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
825 802 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
826 803 blindly copying 00manifest.i containing 3 revisions
827 804 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
828 805 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
829 806 cloning 3 revisions from 00changelog.i
830 807 finished migrating 3 changelog revisions; change in size: 0 bytes
831 808 finished migrating 9 total revisions; total change in store size: 0 bytes
832 809 copying phaseroots
833 810 data fully upgraded in a temporary repository
834 811 marking source repository as being upgraded; clients will be unable to read from repository
835 812 starting in-place swap of repository data
836 813 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
837 814 replacing store...
838 815 store replacement complete; repository was inconsistent for *s (glob)
839 816 finalizing requirements file and making repository readable again
840 817 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
841 818 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
842 819 $ hg verify
843 820 checking changesets
844 821 checking manifests
845 822 crosschecking files in changesets and manifests
846 823 checking files
847 824 checked 3 changesets with 3 changes to 3 files
848 825
849 826 Check that we can select filelog only
850 827
851 828 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
852 829 upgrade will perform the following actions:
853 830
854 831 requirements
855 832 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
856 833
857 834 optimisations: re-delta-parent
858 835
859 836 re-delta-parent
860 837 deltas within internal storage will choose a new base revision if needed
861 838
862 839 processed revlogs:
863 840 - all-filelogs
864 841
865 842 beginning upgrade...
866 843 repository locked and read-only
867 844 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
868 845 (it is safe to interrupt this process any time before data migration completes)
869 846 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
870 847 migrating 519 KB in store; 1.05 MB tracked data
871 848 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
872 849 cloning 1 revisions from data/FooBarDirectory.d/f1.i
873 850 cloning 1 revisions from data/f0.i
874 851 cloning 1 revisions from data/f2.i
875 852 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
876 853 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
877 854 blindly copying 00manifest.i containing 3 revisions
878 855 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
879 856 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
880 857 blindly copying 00changelog.i containing 3 revisions
881 858 finished migrating 3 changelog revisions; change in size: 0 bytes
882 859 finished migrating 9 total revisions; total change in store size: 0 bytes
883 860 copying phaseroots
884 861 data fully upgraded in a temporary repository
885 862 marking source repository as being upgraded; clients will be unable to read from repository
886 863 starting in-place swap of repository data
887 864 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
888 865 replacing store...
889 866 store replacement complete; repository was inconsistent for *s (glob)
890 867 finalizing requirements file and making repository readable again
891 868 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
892 869 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
893 870 $ hg verify
894 871 checking changesets
895 872 checking manifests
896 873 crosschecking files in changesets and manifests
897 874 checking files
898 875 checked 3 changesets with 3 changes to 3 files
899 876
900 877
901 878 Check you can't skip revlog clone during important format downgrade
902 879
903 880 $ echo "[format]" > .hg/hgrc
904 881 $ echo "sparse-revlog=no" >> .hg/hgrc
905 882 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
906 883 ignoring revlogs selection flags, format requirements change: sparserevlog
907 884 upgrade will perform the following actions:
908 885
909 886 requirements
910 887 preserved: dotencode, fncache, generaldelta, revlogv1, store
911 888 removed: sparserevlog
912 889
913 890 optimisations: re-delta-parent
914 891
915 892 re-delta-parent
916 893 deltas within internal storage will choose a new base revision if needed
917 894
918 895 processed revlogs:
919 896 - all-filelogs
920 897 - changelog
921 898 - manifest
922 899
923 900 beginning upgrade...
924 901 repository locked and read-only
925 902 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
926 903 (it is safe to interrupt this process any time before data migration completes)
927 904 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
928 905 migrating 519 KB in store; 1.05 MB tracked data
929 906 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
930 907 cloning 1 revisions from data/FooBarDirectory.d/f1.i
931 908 cloning 1 revisions from data/f0.i
932 909 cloning 1 revisions from data/f2.i
933 910 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
934 911 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
935 912 cloning 3 revisions from 00manifest.i
936 913 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
937 914 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
938 915 cloning 3 revisions from 00changelog.i
939 916 finished migrating 3 changelog revisions; change in size: 0 bytes
940 917 finished migrating 9 total revisions; total change in store size: 0 bytes
941 918 copying phaseroots
942 919 data fully upgraded in a temporary repository
943 920 marking source repository as being upgraded; clients will be unable to read from repository
944 921 starting in-place swap of repository data
945 922 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
946 923 replacing store...
947 924 store replacement complete; repository was inconsistent for *s (glob)
948 925 finalizing requirements file and making repository readable again
949 926 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
950 927 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
951 928 $ hg verify
952 929 checking changesets
953 930 checking manifests
954 931 crosschecking files in changesets and manifests
955 932 checking files
956 933 checked 3 changesets with 3 changes to 3 files
957 934
958 935 Check you can't skip revlog clone during important format upgrade
959 936
960 937 $ echo "sparse-revlog=yes" >> .hg/hgrc
961 938 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
962 939 ignoring revlogs selection flags, format requirements change: sparserevlog
963 940 upgrade will perform the following actions:
964 941
965 942 requirements
966 943 preserved: dotencode, fncache, generaldelta, revlogv1, store
967 944 added: sparserevlog
968 945
969 946 optimisations: re-delta-parent
970 947
971 948 sparserevlog
972 949 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
973 950
974 951 re-delta-parent
975 952 deltas within internal storage will choose a new base revision if needed
976 953
977 954 processed revlogs:
978 955 - all-filelogs
979 956 - changelog
980 957 - manifest
981 958
982 959 beginning upgrade...
983 960 repository locked and read-only
984 961 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
985 962 (it is safe to interrupt this process any time before data migration completes)
986 963 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
987 964 migrating 519 KB in store; 1.05 MB tracked data
988 965 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
989 966 cloning 1 revisions from data/FooBarDirectory.d/f1.i
990 967 cloning 1 revisions from data/f0.i
991 968 cloning 1 revisions from data/f2.i
992 969 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
993 970 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
994 971 cloning 3 revisions from 00manifest.i
995 972 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
996 973 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
997 974 cloning 3 revisions from 00changelog.i
998 975 finished migrating 3 changelog revisions; change in size: 0 bytes
999 976 finished migrating 9 total revisions; total change in store size: 0 bytes
1000 977 copying phaseroots
1001 978 data fully upgraded in a temporary repository
1002 979 marking source repository as being upgraded; clients will be unable to read from repository
1003 980 starting in-place swap of repository data
1004 981 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1005 982 replacing store...
1006 983 store replacement complete; repository was inconsistent for *s (glob)
1007 984 finalizing requirements file and making repository readable again
1008 985 removing old repository content $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
1009 986 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1010 987 $ hg verify
1011 988 checking changesets
1012 989 checking manifests
1013 990 crosschecking files in changesets and manifests
1014 991 checking files
1015 992 checked 3 changesets with 3 changes to 3 files
1016 993
1017 994 $ cd ..
1018 995
1019 996 store files with special filenames aren't encoded during copy
1020 997
1021 998 $ hg init store-filenames
1022 999 $ cd store-filenames
1023 1000 $ touch foo
1024 1001 $ hg -q commit -A -m initial
1025 1002 $ touch .hg/store/.XX_special_filename
1026 1003
1027 1004 $ hg debugupgraderepo --run
1028 upgrade will perform the following actions:
1029
1030 requirements
1031 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1032
1033 processed revlogs:
1034 - all-filelogs
1035 - changelog
1036 - manifest
1037
1038 beginning upgrade...
1039 repository locked and read-only
1040 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1041 (it is safe to interrupt this process any time before data migration completes)
1042 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1043 migrating 301 bytes in store; 107 bytes tracked data
1044 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1045 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1046 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1047 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1048 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1049 finished migrating 1 changelog revisions; change in size: 0 bytes
1050 finished migrating 3 total revisions; total change in store size: 0 bytes
1051 copying .XX_special_filename
1052 copying phaseroots
1053 data fully upgraded in a temporary repository
1054 marking source repository as being upgraded; clients will be unable to read from repository
1055 starting in-place swap of repository data
1056 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1057 replacing store...
1058 store replacement complete; repository was inconsistent for *s (glob)
1059 finalizing requirements file and making repository readable again
1060 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1061 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1062 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1005 nothing to do
1063 1006 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1064 1007 upgrade will perform the following actions:
1065 1008
1066 1009 requirements
1067 1010 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1068 1011
1069 1012 optimisations: re-delta-fulladd
1070 1013
1071 1014 re-delta-fulladd
1072 1015 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1073 1016
1074 1017 processed revlogs:
1075 1018 - all-filelogs
1076 1019 - changelog
1077 1020 - manifest
1078 1021
1079 1022 beginning upgrade...
1080 1023 repository locked and read-only
1081 1024 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1082 1025 (it is safe to interrupt this process any time before data migration completes)
1083 1026 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1084 1027 migrating 301 bytes in store; 107 bytes tracked data
1085 1028 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1086 1029 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1087 1030 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1088 1031 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1089 1032 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1090 1033 finished migrating 1 changelog revisions; change in size: 0 bytes
1091 1034 finished migrating 3 total revisions; total change in store size: 0 bytes
1092 1035 copying .XX_special_filename
1093 1036 copying phaseroots
1094 1037 data fully upgraded in a temporary repository
1095 1038 marking source repository as being upgraded; clients will be unable to read from repository
1096 1039 starting in-place swap of repository data
1097 1040 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1098 1041 replacing store...
1099 1042 store replacement complete; repository was inconsistent for *s (glob)
1100 1043 finalizing requirements file and making repository readable again
1101 1044 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1102 1045 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1103 1046 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1104 1047
1105 1048 fncache is valid after upgrade
1106 1049
1107 1050 $ hg debugrebuildfncache
1108 1051 fncache already up to date
1109 1052
1110 1053 $ cd ..
1111 1054
1112 1055 Check upgrading a large file repository
1113 1056 ---------------------------------------
1114 1057
1115 1058 $ hg init largefilesrepo
1116 1059 $ cat << EOF >> largefilesrepo/.hg/hgrc
1117 1060 > [extensions]
1118 1061 > largefiles =
1119 1062 > EOF
1120 1063
1121 1064 $ cd largefilesrepo
1122 1065 $ touch foo
1123 1066 $ hg add --large foo
1124 1067 $ hg -q commit -m initial
1125 1068 $ cat .hg/requires
1126 1069 dotencode
1127 1070 fncache
1128 1071 generaldelta
1129 1072 largefiles
1130 1073 revlogv1
1131 1074 sparserevlog
1132 1075 store
1133 1076
1134 1077 $ hg debugupgraderepo --run
1135 upgrade will perform the following actions:
1136
1137 requirements
1138 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
1139
1140 processed revlogs:
1141 - all-filelogs
1142 - changelog
1143 - manifest
1144
1145 beginning upgrade...
1146 repository locked and read-only
1147 creating temporary repository to stage upgraded data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1148 (it is safe to interrupt this process any time before data migration completes)
1149 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1150 migrating 355 bytes in store; 160 bytes tracked data
1151 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
1152 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1153 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
1154 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1155 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
1156 finished migrating 1 changelog revisions; change in size: 0 bytes
1157 finished migrating 3 total revisions; total change in store size: 0 bytes
1158 copying phaseroots
1159 data fully upgraded in a temporary repository
1160 marking source repository as being upgraded; clients will be unable to read from repository
1161 starting in-place swap of repository data
1162 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1163 replacing store...
1164 store replacement complete; repository was inconsistent for *s (glob)
1165 finalizing requirements file and making repository readable again
1166 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1167 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1168 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1078 nothing to do
1169 1079 $ cat .hg/requires
1170 1080 dotencode
1171 1081 fncache
1172 1082 generaldelta
1173 1083 largefiles
1174 1084 revlogv1
1175 1085 sparserevlog
1176 1086 store
1177 1087
1178 1088 $ cat << EOF >> .hg/hgrc
1179 1089 > [extensions]
1180 1090 > lfs =
1181 1091 > [lfs]
1182 1092 > threshold = 10
1183 1093 > EOF
1184 1094 $ echo '123456789012345' > lfs.bin
1185 1095 $ hg ci -Am 'lfs.bin'
1186 1096 adding lfs.bin
1187 1097 $ grep lfs .hg/requires
1188 1098 lfs
1189 1099 $ find .hg/store/lfs -type f
1190 1100 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1191 1101
1192 1102 $ hg debugupgraderepo --run
1193 upgrade will perform the following actions:
1194
1195 requirements
1196 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
1197
1198 processed revlogs:
1199 - all-filelogs
1200 - changelog
1201 - manifest
1202
1203 beginning upgrade...
1204 repository locked and read-only
1205 creating temporary repository to stage upgraded data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1206 (it is safe to interrupt this process any time before data migration completes)
1207 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
1208 migrating 801 bytes in store; 467 bytes tracked data
1209 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
1210 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
1211 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
1212 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
1213 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
1214 finished migrating 2 changelog revisions; change in size: 0 bytes
1215 finished migrating 6 total revisions; total change in store size: 0 bytes
1216 copying phaseroots
1217 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1218 data fully upgraded in a temporary repository
1219 marking source repository as being upgraded; clients will be unable to read from repository
1220 starting in-place swap of repository data
1221 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1222 replacing store...
1223 store replacement complete; repository was inconsistent for *s (glob)
1224 finalizing requirements file and making repository readable again
1225 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
1226 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
1227 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1103 nothing to do
1228 1104
1229 1105 $ grep lfs .hg/requires
1230 1106 lfs
1231 1107 $ find .hg/store/lfs -type f
1232 1108 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1233 1109 $ hg verify
1234 1110 checking changesets
1235 1111 checking manifests
1236 1112 crosschecking files in changesets and manifests
1237 1113 checking files
1238 1114 checked 2 changesets with 2 changes to 2 files
1239 1115 $ hg debugdata lfs.bin 0
1240 1116 version https://git-lfs.github.com/spec/v1
1241 1117 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1242 1118 size 16
1243 1119 x-is-binary 0
1244 1120
1245 1121 $ cd ..
1246 1122
1247 1123 repository config is taken in account
1248 1124 -------------------------------------
1249 1125
1250 1126 $ cat << EOF >> $HGRCPATH
1251 1127 > [format]
1252 1128 > maxchainlen = 1
1253 1129 > EOF
1254 1130
1255 1131 $ hg init localconfig
1256 1132 $ cd localconfig
1257 1133 $ cat << EOF > file
1258 1134 > some content
1259 1135 > with some length
1260 1136 > to make sure we get a delta
1261 1137 > after changes
1262 1138 > very long
1263 1139 > very long
1264 1140 > very long
1265 1141 > very long
1266 1142 > very long
1267 1143 > very long
1268 1144 > very long
1269 1145 > very long
1270 1146 > very long
1271 1147 > very long
1272 1148 > very long
1273 1149 > EOF
1274 1150 $ hg -q commit -A -m A
1275 1151 $ echo "new line" >> file
1276 1152 $ hg -q commit -m B
1277 1153 $ echo "new line" >> file
1278 1154 $ hg -q commit -m C
1279 1155
1280 1156 $ cat << EOF >> .hg/hgrc
1281 1157 > [format]
1282 1158 > maxchainlen = 9001
1283 1159 > EOF
1284 1160 $ hg config format
1285 1161 format.maxchainlen=9001
1286 1162 $ hg debugdeltachain file
1287 1163 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1288 1164 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1289 1165 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1290 1166 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1291 1167
1292 1168 $ hg debugupgraderepo --run --optimize 're-delta-all'
1293 1169 upgrade will perform the following actions:
1294 1170
1295 1171 requirements
1296 1172 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1297 1173
1298 1174 optimisations: re-delta-all
1299 1175
1300 1176 re-delta-all
1301 1177 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1302 1178
1303 1179 processed revlogs:
1304 1180 - all-filelogs
1305 1181 - changelog
1306 1182 - manifest
1307 1183
1308 1184 beginning upgrade...
1309 1185 repository locked and read-only
1310 1186 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1311 1187 (it is safe to interrupt this process any time before data migration completes)
1312 1188 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1313 1189 migrating 1019 bytes in store; 882 bytes tracked data
1314 1190 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1315 1191 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1316 1192 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1317 1193 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1318 1194 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1319 1195 finished migrating 3 changelog revisions; change in size: 0 bytes
1320 1196 finished migrating 9 total revisions; total change in store size: -9 bytes
1321 1197 copying phaseroots
1322 1198 data fully upgraded in a temporary repository
1323 1199 marking source repository as being upgraded; clients will be unable to read from repository
1324 1200 starting in-place swap of repository data
1325 1201 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1326 1202 replacing store...
1327 1203 store replacement complete; repository was inconsistent for *s (glob)
1328 1204 finalizing requirements file and making repository readable again
1329 1205 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1330 1206 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1331 1207 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1332 1208 $ hg debugdeltachain file
1333 1209 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1334 1210 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1335 1211 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1336 1212 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1337 1213 $ cd ..
1338 1214
1339 1215 $ cat << EOF >> $HGRCPATH
1340 1216 > [format]
1341 1217 > maxchainlen = 9001
1342 1218 > EOF
1343 1219
1344 1220 Check upgrading a sparse-revlog repository
1345 1221 ---------------------------------------
1346 1222
1347 1223 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1348 1224 $ cd sparserevlogrepo
1349 1225 $ touch foo
1350 1226 $ hg add foo
1351 1227 $ hg -q commit -m "foo"
1352 1228 $ cat .hg/requires
1353 1229 dotencode
1354 1230 fncache
1355 1231 generaldelta
1356 1232 revlogv1
1357 1233 store
1358 1234
1359 1235 Check that we can add the sparse-revlog format requirement
1360 1236 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1361 1237 upgrade will perform the following actions:
1362 1238
1363 1239 requirements
1364 1240 preserved: dotencode, fncache, generaldelta, revlogv1, store
1365 1241 added: sparserevlog
1366 1242
1367 1243 processed revlogs:
1368 1244 - all-filelogs
1369 1245 - changelog
1370 1246 - manifest
1371 1247
1372 1248 $ cat .hg/requires
1373 1249 dotencode
1374 1250 fncache
1375 1251 generaldelta
1376 1252 revlogv1
1377 1253 sparserevlog
1378 1254 store
1379 1255
1380 1256 Check that we can remove the sparse-revlog format requirement
1381 1257 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1382 1258 upgrade will perform the following actions:
1383 1259
1384 1260 requirements
1385 1261 preserved: dotencode, fncache, generaldelta, revlogv1, store
1386 1262 removed: sparserevlog
1387 1263
1388 1264 processed revlogs:
1389 1265 - all-filelogs
1390 1266 - changelog
1391 1267 - manifest
1392 1268
1393 1269 $ cat .hg/requires
1394 1270 dotencode
1395 1271 fncache
1396 1272 generaldelta
1397 1273 revlogv1
1398 1274 store
1399 1275
1400 1276 #if zstd
1401 1277
1402 1278 Check upgrading to a zstd revlog
1403 1279 --------------------------------
1404 1280
1405 1281 upgrade
1406 1282
1407 1283 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1408 1284 upgrade will perform the following actions:
1409 1285
1410 1286 requirements
1411 1287 preserved: dotencode, fncache, generaldelta, revlogv1, store
1412 1288 added: revlog-compression-zstd, sparserevlog
1413 1289
1414 1290 processed revlogs:
1415 1291 - all-filelogs
1416 1292 - changelog
1417 1293 - manifest
1418 1294
1419 1295 $ hg debugformat -v
1420 1296 format-variant repo config default
1421 1297 fncache: yes yes yes
1422 1298 dotencode: yes yes yes
1423 1299 generaldelta: yes yes yes
1424 1300 exp-sharesafe: no no no
1425 1301 sparserevlog: yes yes yes
1426 1302 sidedata: no no no
1427 1303 persistent-nodemap: no no no
1428 1304 copies-sdc: no no no
1429 1305 plain-cl-delta: yes yes yes
1430 1306 compression: zstd zlib zlib
1431 1307 compression-level: default default default
1432 1308 $ cat .hg/requires
1433 1309 dotencode
1434 1310 fncache
1435 1311 generaldelta
1436 1312 revlog-compression-zstd
1437 1313 revlogv1
1438 1314 sparserevlog
1439 1315 store
1440 1316
1441 1317 downgrade
1442 1318
1443 1319 $ hg debugupgraderepo --run --no-backup --quiet
1444 1320 upgrade will perform the following actions:
1445 1321
1446 1322 requirements
1447 1323 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1448 1324 removed: revlog-compression-zstd
1449 1325
1450 1326 processed revlogs:
1451 1327 - all-filelogs
1452 1328 - changelog
1453 1329 - manifest
1454 1330
1455 1331 $ hg debugformat -v
1456 1332 format-variant repo config default
1457 1333 fncache: yes yes yes
1458 1334 dotencode: yes yes yes
1459 1335 generaldelta: yes yes yes
1460 1336 exp-sharesafe: no no no
1461 1337 sparserevlog: yes yes yes
1462 1338 sidedata: no no no
1463 1339 persistent-nodemap: no no no
1464 1340 copies-sdc: no no no
1465 1341 plain-cl-delta: yes yes yes
1466 1342 compression: zlib zlib zlib
1467 1343 compression-level: default default default
1468 1344 $ cat .hg/requires
1469 1345 dotencode
1470 1346 fncache
1471 1347 generaldelta
1472 1348 revlogv1
1473 1349 sparserevlog
1474 1350 store
1475 1351
1476 1352 upgrade from hgrc
1477 1353
1478 1354 $ cat >> .hg/hgrc << EOF
1479 1355 > [format]
1480 1356 > revlog-compression=zstd
1481 1357 > EOF
1482 1358 $ hg debugupgraderepo --run --no-backup --quiet
1483 1359 upgrade will perform the following actions:
1484 1360
1485 1361 requirements
1486 1362 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1487 1363 added: revlog-compression-zstd
1488 1364
1489 1365 processed revlogs:
1490 1366 - all-filelogs
1491 1367 - changelog
1492 1368 - manifest
1493 1369
1494 1370 $ hg debugformat -v
1495 1371 format-variant repo config default
1496 1372 fncache: yes yes yes
1497 1373 dotencode: yes yes yes
1498 1374 generaldelta: yes yes yes
1499 1375 exp-sharesafe: no no no
1500 1376 sparserevlog: yes yes yes
1501 1377 sidedata: no no no
1502 1378 persistent-nodemap: no no no
1503 1379 copies-sdc: no no no
1504 1380 plain-cl-delta: yes yes yes
1505 1381 compression: zstd zstd zlib
1506 1382 compression-level: default default default
1507 1383 $ cat .hg/requires
1508 1384 dotencode
1509 1385 fncache
1510 1386 generaldelta
1511 1387 revlog-compression-zstd
1512 1388 revlogv1
1513 1389 sparserevlog
1514 1390 store
1515 1391
1516 1392 #endif
1517 1393
1518 1394 Check upgrading to a side-data revlog
1519 1395 -------------------------------------
1520 1396
1521 1397 upgrade
1522 1398
1523 1399 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1524 1400 upgrade will perform the following actions:
1525 1401
1526 1402 requirements
1527 1403 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-zstd !)
1528 1404 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1529 1405 added: exp-sidedata-flag (zstd !)
1530 1406 added: exp-sidedata-flag, sparserevlog (no-zstd !)
1531 1407
1532 1408 processed revlogs:
1533 1409 - all-filelogs
1534 1410 - changelog
1535 1411 - manifest
1536 1412
1537 1413 $ hg debugformat -v
1538 1414 format-variant repo config default
1539 1415 fncache: yes yes yes
1540 1416 dotencode: yes yes yes
1541 1417 generaldelta: yes yes yes
1542 1418 exp-sharesafe: no no no
1543 1419 sparserevlog: yes yes yes
1544 1420 sidedata: yes no no
1545 1421 persistent-nodemap: no no no
1546 1422 copies-sdc: no no no
1547 1423 plain-cl-delta: yes yes yes
1548 1424 compression: zlib zlib zlib (no-zstd !)
1549 1425 compression: zstd zstd zlib (zstd !)
1550 1426 compression-level: default default default
1551 1427 $ cat .hg/requires
1552 1428 dotencode
1553 1429 exp-sidedata-flag
1554 1430 fncache
1555 1431 generaldelta
1556 1432 revlog-compression-zstd (zstd !)
1557 1433 revlogv1
1558 1434 sparserevlog
1559 1435 store
1560 1436 $ hg debugsidedata -c 0
1561 1437 2 sidedata entries
1562 1438 entry-0001 size 4
1563 1439 entry-0002 size 32
1564 1440
1565 1441 downgrade
1566 1442
1567 1443 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1568 1444 upgrade will perform the following actions:
1569 1445
1570 1446 requirements
1571 1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1572 1448 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1573 1449 removed: exp-sidedata-flag
1574 1450
1575 1451 processed revlogs:
1576 1452 - all-filelogs
1577 1453 - changelog
1578 1454 - manifest
1579 1455
1580 1456 $ hg debugformat -v
1581 1457 format-variant repo config default
1582 1458 fncache: yes yes yes
1583 1459 dotencode: yes yes yes
1584 1460 generaldelta: yes yes yes
1585 1461 exp-sharesafe: no no no
1586 1462 sparserevlog: yes yes yes
1587 1463 sidedata: no no no
1588 1464 persistent-nodemap: no no no
1589 1465 copies-sdc: no no no
1590 1466 plain-cl-delta: yes yes yes
1591 1467 compression: zlib zlib zlib (no-zstd !)
1592 1468 compression: zstd zstd zlib (zstd !)
1593 1469 compression-level: default default default
1594 1470 $ cat .hg/requires
1595 1471 dotencode
1596 1472 fncache
1597 1473 generaldelta
1598 1474 revlog-compression-zstd (zstd !)
1599 1475 revlogv1
1600 1476 sparserevlog
1601 1477 store
1602 1478 $ hg debugsidedata -c 0
1603 1479
1604 1480 upgrade from hgrc
1605 1481
1606 1482 $ cat >> .hg/hgrc << EOF
1607 1483 > [format]
1608 1484 > exp-use-side-data=yes
1609 1485 > EOF
1610 1486 $ hg debugupgraderepo --run --no-backup --quiet
1611 1487 upgrade will perform the following actions:
1612 1488
1613 1489 requirements
1614 1490 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
1615 1491 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
1616 1492 added: exp-sidedata-flag
1617 1493
1618 1494 processed revlogs:
1619 1495 - all-filelogs
1620 1496 - changelog
1621 1497 - manifest
1622 1498
1623 1499 $ hg debugformat -v
1624 1500 format-variant repo config default
1625 1501 fncache: yes yes yes
1626 1502 dotencode: yes yes yes
1627 1503 generaldelta: yes yes yes
1628 1504 exp-sharesafe: no no no
1629 1505 sparserevlog: yes yes yes
1630 1506 sidedata: yes yes no
1631 1507 persistent-nodemap: no no no
1632 1508 copies-sdc: no no no
1633 1509 plain-cl-delta: yes yes yes
1634 1510 compression: zlib zlib zlib (no-zstd !)
1635 1511 compression: zstd zstd zlib (zstd !)
1636 1512 compression-level: default default default
1637 1513 $ cat .hg/requires
1638 1514 dotencode
1639 1515 exp-sidedata-flag
1640 1516 fncache
1641 1517 generaldelta
1642 1518 revlog-compression-zstd (zstd !)
1643 1519 revlogv1
1644 1520 sparserevlog
1645 1521 store
1646 1522 $ hg debugsidedata -c 0
1647 1523
1648 1524 Demonstrate that nothing to perform upgrade will still run all the way through
1649 FIXME: this should return early
1650 1525
1651 1526 $ hg debugupgraderepo --run
1652 upgrade will perform the following actions:
1653
1654 requirements
1655 preserved: dotencode, exp-sidedata-flag, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store
1656
1657 processed revlogs:
1658 - all-filelogs
1659 - changelog
1660 - manifest
1661
1662 beginning upgrade...
1663 repository locked and read-only
1664 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1665 (it is safe to interrupt this process any time before data migration completes)
1666 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1667 migrating 297 bytes in store; 103 bytes tracked data
1668 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1669 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1670 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1671 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1672 migrating changelog containing 1 revisions (123 bytes in store; 58 bytes tracked data)
1673 finished migrating 1 changelog revisions; change in size: 0 bytes
1674 finished migrating 3 total revisions; total change in store size: 0 bytes
1675 copying phaseroots
1676 data fully upgraded in a temporary repository
1677 marking source repository as being upgraded; clients will be unable to read from repository
1678 starting in-place swap of repository data
1679 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1680 replacing store...
1681 store replacement complete; repository was inconsistent for *s (glob)
1682 finalizing requirements file and making repository readable again
1683 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1684 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1685 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1527 nothing to do
General Comments 0
You need to be logged in to leave comments. Login now