##// END OF EJS Templates
upgrade: issue a message when a revlog type has to be upgraded...
marmoute -
r49276:8405c1bf default
parent child Browse files
Show More
@@ -1,399 +1,419 b''
1 # upgrade.py - functions for in place upgrade of Mercurial repository
1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 #
2 #
3 # Copyright (c) 2016-present, Gregory Szorc
3 # Copyright (c) 2016-present, Gregory Szorc
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from . import (
11 from . import (
12 error,
12 error,
13 hg,
13 hg,
14 localrepo,
14 localrepo,
15 lock as lockmod,
15 lock as lockmod,
16 pycompat,
16 pycompat,
17 requirements as requirementsmod,
17 requirements as requirementsmod,
18 scmutil,
18 scmutil,
19 )
19 )
20
20
21 from .upgrade_utils import (
21 from .upgrade_utils import (
22 actions as upgrade_actions,
22 actions as upgrade_actions,
23 engine as upgrade_engine,
23 engine as upgrade_engine,
24 )
24 )
25
25
26 from .utils import (
26 from .utils import (
27 stringutil,
27 stringutil,
28 )
28 )
29
29
30 allformatvariant = upgrade_actions.allformatvariant
30 allformatvariant = upgrade_actions.allformatvariant
31
31
32
32
33 def upgraderepo(
33 def upgraderepo(
34 ui,
34 ui,
35 repo,
35 repo,
36 run=False,
36 run=False,
37 optimize=None,
37 optimize=None,
38 backup=True,
38 backup=True,
39 manifest=None,
39 manifest=None,
40 changelog=None,
40 changelog=None,
41 filelogs=None,
41 filelogs=None,
42 ):
42 ):
43 """Upgrade a repository in place."""
43 """Upgrade a repository in place."""
44 if optimize is None:
44 if optimize is None:
45 optimize = {}
45 optimize = {}
46 repo = repo.unfiltered()
46 repo = repo.unfiltered()
47
47
48 specified_revlogs = {}
48 specified_revlogs = {}
49 if changelog is not None:
49 if changelog is not None:
50 specified_revlogs[upgrade_engine.UPGRADE_CHANGELOG] = changelog
50 specified_revlogs[upgrade_engine.UPGRADE_CHANGELOG] = changelog
51 if manifest is not None:
51 if manifest is not None:
52 specified_revlogs[upgrade_engine.UPGRADE_MANIFEST] = manifest
52 specified_revlogs[upgrade_engine.UPGRADE_MANIFEST] = manifest
53 if filelogs is not None:
53 if filelogs is not None:
54 specified_revlogs[upgrade_engine.UPGRADE_FILELOGS] = filelogs
54 specified_revlogs[upgrade_engine.UPGRADE_FILELOGS] = filelogs
55
55
56 # Ensure the repository can be upgraded.
56 # Ensure the repository can be upgraded.
57 upgrade_actions.check_source_requirements(repo)
57 upgrade_actions.check_source_requirements(repo)
58
58
59 default_options = localrepo.defaultcreateopts(repo.ui)
59 default_options = localrepo.defaultcreateopts(repo.ui)
60 newreqs = localrepo.newreporequirements(repo.ui, default_options)
60 newreqs = localrepo.newreporequirements(repo.ui, default_options)
61 newreqs.update(upgrade_actions.preservedrequirements(repo))
61 newreqs.update(upgrade_actions.preservedrequirements(repo))
62
62
63 upgrade_actions.check_requirements_changes(repo, newreqs)
63 upgrade_actions.check_requirements_changes(repo, newreqs)
64
64
65 # Find and validate all improvements that can be made.
65 # Find and validate all improvements that can be made.
66 alloptimizations = upgrade_actions.findoptimizations(repo)
66 alloptimizations = upgrade_actions.findoptimizations(repo)
67
67
68 # Apply and Validate arguments.
68 # Apply and Validate arguments.
69 optimizations = []
69 optimizations = []
70 for o in alloptimizations:
70 for o in alloptimizations:
71 if o.name in optimize:
71 if o.name in optimize:
72 optimizations.append(o)
72 optimizations.append(o)
73 optimize.discard(o.name)
73 optimize.discard(o.name)
74
74
75 if optimize: # anything left is unknown
75 if optimize: # anything left is unknown
76 raise error.Abort(
76 raise error.Abort(
77 _(b'unknown optimization action requested: %s')
77 _(b'unknown optimization action requested: %s')
78 % b', '.join(sorted(optimize)),
78 % b', '.join(sorted(optimize)),
79 hint=_(b'run without arguments to see valid optimizations'),
79 hint=_(b'run without arguments to see valid optimizations'),
80 )
80 )
81
81
82 format_upgrades = upgrade_actions.find_format_upgrades(repo)
82 format_upgrades = upgrade_actions.find_format_upgrades(repo)
83 up_actions = upgrade_actions.determine_upgrade_actions(
83 up_actions = upgrade_actions.determine_upgrade_actions(
84 repo, format_upgrades, optimizations, repo.requirements, newreqs
84 repo, format_upgrades, optimizations, repo.requirements, newreqs
85 )
85 )
86 removed_actions = upgrade_actions.find_format_downgrades(repo)
86 removed_actions = upgrade_actions.find_format_downgrades(repo)
87
87
88 removedreqs = repo.requirements - newreqs
88 removedreqs = repo.requirements - newreqs
89 addedreqs = newreqs - repo.requirements
89 addedreqs = newreqs - repo.requirements
90
90
91 # check if we need to touch revlog and if so, which ones
91 # check if we need to touch revlog and if so, which ones
92
92
93 touched_revlogs = set()
93 touched_revlogs = set()
94 overwrite_msg = _(b'warning: ignoring %14s, as upgrade is changing: %s\n')
94 overwrite_msg = _(b'warning: ignoring %14s, as upgrade is changing: %s\n')
95 msg_issued = False
95 select_msg = _(b'note: selecting %s for processing to change: %s\n')
96 msg_issued = 0
96
97
97 FL = upgrade_engine.UPGRADE_FILELOGS
98 FL = upgrade_engine.UPGRADE_FILELOGS
98 MN = upgrade_engine.UPGRADE_MANIFEST
99 MN = upgrade_engine.UPGRADE_MANIFEST
99 CL = upgrade_engine.UPGRADE_CHANGELOG
100 CL = upgrade_engine.UPGRADE_CHANGELOG
100
101
101 for action in sorted(up_actions + removed_actions, key=lambda a: a.name):
102 for action in sorted(up_actions + removed_actions, key=lambda a: a.name):
102 # optimisation does not "requires anything, they just needs it.
103 # optimisation does not "requires anything, they just needs it.
103 if action.type != upgrade_actions.FORMAT_VARIANT:
104 if action.type != upgrade_actions.FORMAT_VARIANT:
104 continue
105 continue
105
106
106 if action.touches_filelogs and FL not in touched_revlogs:
107 if action.touches_filelogs and FL not in touched_revlogs:
107 if FL in specified_revlogs:
108 if FL in specified_revlogs:
108 if not specified_revlogs[FL]:
109 if not specified_revlogs[FL]:
109 msg = overwrite_msg % (b'--no-filelogs', action.name)
110 msg = overwrite_msg % (b'--no-filelogs', action.name)
110 ui.warn(msg)
111 ui.warn(msg)
111 msg_issued = True
112 msg_issued = 2
113 else:
114 msg = select_msg % (b'all-filelogs', action.name)
115 ui.status(msg)
116 if not ui.quiet:
117 msg_issued = 1
112 touched_revlogs.add(FL)
118 touched_revlogs.add(FL)
119
113 if action.touches_manifests and MN not in touched_revlogs:
120 if action.touches_manifests and MN not in touched_revlogs:
114 if MN in specified_revlogs:
121 if MN in specified_revlogs:
115 if not specified_revlogs[MN]:
122 if not specified_revlogs[MN]:
116 msg = overwrite_msg % (b'--no-manifest', action.name)
123 msg = overwrite_msg % (b'--no-manifest', action.name)
117 ui.warn(msg)
124 ui.warn(msg)
118 msg_issued = True
125 msg_issued = 2
126 else:
127 msg = select_msg % (b'all-manifestlogs', action.name)
128 ui.status(msg)
129 if not ui.quiet:
130 msg_issued = 1
119 touched_revlogs.add(MN)
131 touched_revlogs.add(MN)
132
120 if action.touches_changelog and CL not in touched_revlogs:
133 if action.touches_changelog and CL not in touched_revlogs:
121 if CL in specified_revlogs:
134 if CL in specified_revlogs:
122 if not specified_revlogs[CL]:
135 if not specified_revlogs[CL]:
123 msg = overwrite_msg % (b'--no-changelog', action.name)
136 msg = overwrite_msg % (b'--no-changelog', action.name)
124 ui.warn(msg)
137 ui.warn(msg)
125 msg_issued = True
138 msg_issued = True
139 else:
140 msg = select_msg % (b'changelog', action.name)
141 ui.status(msg)
142 if not ui.quiet:
143 msg_issued = 1
126 touched_revlogs.add(CL)
144 touched_revlogs.add(CL)
127 if msg_issued:
145 if msg_issued >= 2:
128 ui.warn((b"\n"))
146 ui.warn((b"\n"))
147 elif msg_issued >= 1:
148 ui.status((b"\n"))
129
149
130 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
150 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
131 if specified_revlogs:
151 if specified_revlogs:
132 # we have some limitation on revlogs to be recloned
152 # we have some limitation on revlogs to be recloned
133 if any(specified_revlogs.values()):
153 if any(specified_revlogs.values()):
134 revlogs = set()
154 revlogs = set()
135 for upgrade, enabled in specified_revlogs.items():
155 for upgrade, enabled in specified_revlogs.items():
136 if enabled:
156 if enabled:
137 revlogs.add(upgrade)
157 revlogs.add(upgrade)
138 else:
158 else:
139 # none are enabled
159 # none are enabled
140 for upgrade in specified_revlogs.keys():
160 for upgrade in specified_revlogs.keys():
141 revlogs.discard(upgrade)
161 revlogs.discard(upgrade)
142
162
143 # check the consistency of the revlog selection with the planned action
163 # check the consistency of the revlog selection with the planned action
144
164
145 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
165 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
146 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
166 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
147 removedreqs | addedreqs
167 removedreqs | addedreqs
148 )
168 )
149 if incompatible:
169 if incompatible:
150 msg = _(
170 msg = _(
151 b'ignoring revlogs selection flags, format requirements '
171 b'ignoring revlogs selection flags, format requirements '
152 b'change: %s\n'
172 b'change: %s\n'
153 )
173 )
154 ui.warn(msg % b', '.join(sorted(incompatible)))
174 ui.warn(msg % b', '.join(sorted(incompatible)))
155 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
175 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
156
176
157 upgrade_op = upgrade_actions.UpgradeOperation(
177 upgrade_op = upgrade_actions.UpgradeOperation(
158 ui,
178 ui,
159 newreqs,
179 newreqs,
160 repo.requirements,
180 repo.requirements,
161 up_actions,
181 up_actions,
162 removed_actions,
182 removed_actions,
163 revlogs,
183 revlogs,
164 backup,
184 backup,
165 )
185 )
166
186
167 if not run:
187 if not run:
168 fromconfig = []
188 fromconfig = []
169 onlydefault = []
189 onlydefault = []
170
190
171 for d in format_upgrades:
191 for d in format_upgrades:
172 if d.fromconfig(repo):
192 if d.fromconfig(repo):
173 fromconfig.append(d)
193 fromconfig.append(d)
174 elif d.default:
194 elif d.default:
175 onlydefault.append(d)
195 onlydefault.append(d)
176
196
177 if fromconfig or onlydefault:
197 if fromconfig or onlydefault:
178
198
179 if fromconfig:
199 if fromconfig:
180 ui.status(
200 ui.status(
181 _(
201 _(
182 b'repository lacks features recommended by '
202 b'repository lacks features recommended by '
183 b'current config options:\n\n'
203 b'current config options:\n\n'
184 )
204 )
185 )
205 )
186 for i in fromconfig:
206 for i in fromconfig:
187 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
207 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
188
208
189 if onlydefault:
209 if onlydefault:
190 ui.status(
210 ui.status(
191 _(
211 _(
192 b'repository lacks features used by the default '
212 b'repository lacks features used by the default '
193 b'config options:\n\n'
213 b'config options:\n\n'
194 )
214 )
195 )
215 )
196 for i in onlydefault:
216 for i in onlydefault:
197 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
217 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
198
218
199 ui.status(b'\n')
219 ui.status(b'\n')
200 else:
220 else:
201 ui.status(_(b'(no format upgrades found in existing repository)\n'))
221 ui.status(_(b'(no format upgrades found in existing repository)\n'))
202
222
203 ui.status(
223 ui.status(
204 _(
224 _(
205 b'performing an upgrade with "--run" will make the following '
225 b'performing an upgrade with "--run" will make the following '
206 b'changes:\n\n'
226 b'changes:\n\n'
207 )
227 )
208 )
228 )
209
229
210 upgrade_op.print_requirements()
230 upgrade_op.print_requirements()
211 upgrade_op.print_optimisations()
231 upgrade_op.print_optimisations()
212 upgrade_op.print_upgrade_actions()
232 upgrade_op.print_upgrade_actions()
213 upgrade_op.print_affected_revlogs()
233 upgrade_op.print_affected_revlogs()
214
234
215 if upgrade_op.unused_optimizations:
235 if upgrade_op.unused_optimizations:
216 ui.status(
236 ui.status(
217 _(
237 _(
218 b'additional optimizations are available by specifying '
238 b'additional optimizations are available by specifying '
219 b'"--optimize <name>":\n\n'
239 b'"--optimize <name>":\n\n'
220 )
240 )
221 )
241 )
222 upgrade_op.print_unused_optimizations()
242 upgrade_op.print_unused_optimizations()
223 return
243 return
224
244
225 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions):
245 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions):
226 ui.status(_(b'nothing to do\n'))
246 ui.status(_(b'nothing to do\n'))
227 return
247 return
228 # Else we're in the run=true case.
248 # Else we're in the run=true case.
229 ui.write(_(b'upgrade will perform the following actions:\n\n'))
249 ui.write(_(b'upgrade will perform the following actions:\n\n'))
230 upgrade_op.print_requirements()
250 upgrade_op.print_requirements()
231 upgrade_op.print_optimisations()
251 upgrade_op.print_optimisations()
232 upgrade_op.print_upgrade_actions()
252 upgrade_op.print_upgrade_actions()
233 upgrade_op.print_affected_revlogs()
253 upgrade_op.print_affected_revlogs()
234
254
235 ui.status(_(b'beginning upgrade...\n'))
255 ui.status(_(b'beginning upgrade...\n'))
236 with repo.wlock(), repo.lock():
256 with repo.wlock(), repo.lock():
237 ui.status(_(b'repository locked and read-only\n'))
257 ui.status(_(b'repository locked and read-only\n'))
238 # Our strategy for upgrading the repository is to create a new,
258 # Our strategy for upgrading the repository is to create a new,
239 # temporary repository, write data to it, then do a swap of the
259 # temporary repository, write data to it, then do a swap of the
240 # data. There are less heavyweight ways to do this, but it is easier
260 # data. There are less heavyweight ways to do this, but it is easier
241 # to create a new repo object than to instantiate all the components
261 # to create a new repo object than to instantiate all the components
242 # (like the store) separately.
262 # (like the store) separately.
243 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
263 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
244 backuppath = None
264 backuppath = None
245 try:
265 try:
246 ui.status(
266 ui.status(
247 _(
267 _(
248 b'creating temporary repository to stage upgraded '
268 b'creating temporary repository to stage upgraded '
249 b'data: %s\n'
269 b'data: %s\n'
250 )
270 )
251 % tmppath
271 % tmppath
252 )
272 )
253
273
254 # clone ui without using ui.copy because repo.ui is protected
274 # clone ui without using ui.copy because repo.ui is protected
255 repoui = repo.ui.__class__(repo.ui)
275 repoui = repo.ui.__class__(repo.ui)
256 dstrepo = hg.repository(repoui, path=tmppath, create=True)
276 dstrepo = hg.repository(repoui, path=tmppath, create=True)
257
277
258 with dstrepo.wlock(), dstrepo.lock():
278 with dstrepo.wlock(), dstrepo.lock():
259 backuppath = upgrade_engine.upgrade(
279 backuppath = upgrade_engine.upgrade(
260 ui, repo, dstrepo, upgrade_op
280 ui, repo, dstrepo, upgrade_op
261 )
281 )
262
282
263 finally:
283 finally:
264 ui.status(_(b'removing temporary repository %s\n') % tmppath)
284 ui.status(_(b'removing temporary repository %s\n') % tmppath)
265 repo.vfs.rmtree(tmppath, forcibly=True)
285 repo.vfs.rmtree(tmppath, forcibly=True)
266
286
267 if backuppath and not ui.quiet:
287 if backuppath and not ui.quiet:
268 ui.warn(
288 ui.warn(
269 _(b'copy of old repository backed up at %s\n') % backuppath
289 _(b'copy of old repository backed up at %s\n') % backuppath
270 )
290 )
271 ui.warn(
291 ui.warn(
272 _(
292 _(
273 b'the old repository will not be deleted; remove '
293 b'the old repository will not be deleted; remove '
274 b'it to free up disk space once the upgraded '
294 b'it to free up disk space once the upgraded '
275 b'repository is verified\n'
295 b'repository is verified\n'
276 )
296 )
277 )
297 )
278
298
279 upgrade_op.print_post_op_messages()
299 upgrade_op.print_post_op_messages()
280
300
281
301
282 def upgrade_share_to_safe(
302 def upgrade_share_to_safe(
283 ui,
303 ui,
284 hgvfs,
304 hgvfs,
285 storevfs,
305 storevfs,
286 current_requirements,
306 current_requirements,
287 mismatch_config,
307 mismatch_config,
288 mismatch_warn,
308 mismatch_warn,
289 ):
309 ):
290 """Upgrades a share to use share-safe mechanism"""
310 """Upgrades a share to use share-safe mechanism"""
291 wlock = None
311 wlock = None
292 store_requirements = localrepo._readrequires(storevfs, False)
312 store_requirements = localrepo._readrequires(storevfs, False)
293 original_crequirements = current_requirements.copy()
313 original_crequirements = current_requirements.copy()
294 # after upgrade, store requires will be shared, so lets find
314 # after upgrade, store requires will be shared, so lets find
295 # the requirements which are not present in store and
315 # the requirements which are not present in store and
296 # write them to share's .hg/requires
316 # write them to share's .hg/requires
297 diffrequires = current_requirements - store_requirements
317 diffrequires = current_requirements - store_requirements
298 # add share-safe requirement as it will mark the share as share-safe
318 # add share-safe requirement as it will mark the share as share-safe
299 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
319 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
300 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
320 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
301 # in `allow` case, we don't try to upgrade, we just respect the source
321 # in `allow` case, we don't try to upgrade, we just respect the source
302 # state, update requirements and continue
322 # state, update requirements and continue
303 if mismatch_config == b'allow':
323 if mismatch_config == b'allow':
304 return
324 return
305 try:
325 try:
306 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
326 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
307 # some process might change the requirement in between, re-read
327 # some process might change the requirement in between, re-read
308 # and update current_requirements
328 # and update current_requirements
309 locked_requirements = localrepo._readrequires(hgvfs, True)
329 locked_requirements = localrepo._readrequires(hgvfs, True)
310 if locked_requirements != original_crequirements:
330 if locked_requirements != original_crequirements:
311 removed = current_requirements - locked_requirements
331 removed = current_requirements - locked_requirements
312 # update current_requirements in place because it's passed
332 # update current_requirements in place because it's passed
313 # as reference
333 # as reference
314 current_requirements -= removed
334 current_requirements -= removed
315 current_requirements |= locked_requirements
335 current_requirements |= locked_requirements
316 diffrequires = current_requirements - store_requirements
336 diffrequires = current_requirements - store_requirements
317 # add share-safe requirement as it will mark the share as share-safe
337 # add share-safe requirement as it will mark the share as share-safe
318 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
338 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
319 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
339 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
320 scmutil.writerequires(hgvfs, diffrequires)
340 scmutil.writerequires(hgvfs, diffrequires)
321 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
341 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
322 except error.LockError as e:
342 except error.LockError as e:
323 hint = _(
343 hint = _(
324 "see `hg help config.format.use-share-safe` for more information"
344 "see `hg help config.format.use-share-safe` for more information"
325 )
345 )
326 if mismatch_config == b'upgrade-abort':
346 if mismatch_config == b'upgrade-abort':
327 raise error.Abort(
347 raise error.Abort(
328 _(b'failed to upgrade share, got error: %s')
348 _(b'failed to upgrade share, got error: %s')
329 % stringutil.forcebytestr(e.strerror),
349 % stringutil.forcebytestr(e.strerror),
330 hint=hint,
350 hint=hint,
331 )
351 )
332 elif mismatch_warn:
352 elif mismatch_warn:
333 ui.warn(
353 ui.warn(
334 _(b'failed to upgrade share, got error: %s\n')
354 _(b'failed to upgrade share, got error: %s\n')
335 % stringutil.forcebytestr(e.strerror),
355 % stringutil.forcebytestr(e.strerror),
336 hint=hint,
356 hint=hint,
337 )
357 )
338 finally:
358 finally:
339 if wlock:
359 if wlock:
340 wlock.release()
360 wlock.release()
341
361
342
362
343 def downgrade_share_to_non_safe(
363 def downgrade_share_to_non_safe(
344 ui,
364 ui,
345 hgvfs,
365 hgvfs,
346 sharedvfs,
366 sharedvfs,
347 current_requirements,
367 current_requirements,
348 mismatch_config,
368 mismatch_config,
349 mismatch_warn,
369 mismatch_warn,
350 ):
370 ):
351 """Downgrades a share which use share-safe to not use it"""
371 """Downgrades a share which use share-safe to not use it"""
352 wlock = None
372 wlock = None
353 source_requirements = localrepo._readrequires(sharedvfs, True)
373 source_requirements = localrepo._readrequires(sharedvfs, True)
354 original_crequirements = current_requirements.copy()
374 original_crequirements = current_requirements.copy()
355 # we cannot be 100% sure on which requirements were present in store when
375 # we cannot be 100% sure on which requirements were present in store when
356 # the source supported share-safe. However, we do know that working
376 # the source supported share-safe. However, we do know that working
357 # directory requirements were not there. Hence we remove them
377 # directory requirements were not there. Hence we remove them
358 source_requirements -= requirementsmod.WORKING_DIR_REQUIREMENTS
378 source_requirements -= requirementsmod.WORKING_DIR_REQUIREMENTS
359 current_requirements |= source_requirements
379 current_requirements |= source_requirements
360 current_requirements.remove(requirementsmod.SHARESAFE_REQUIREMENT)
380 current_requirements.remove(requirementsmod.SHARESAFE_REQUIREMENT)
361 if mismatch_config == b'allow':
381 if mismatch_config == b'allow':
362 return
382 return
363
383
364 try:
384 try:
365 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
385 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
366 # some process might change the requirement in between, re-read
386 # some process might change the requirement in between, re-read
367 # and update current_requirements
387 # and update current_requirements
368 locked_requirements = localrepo._readrequires(hgvfs, True)
388 locked_requirements = localrepo._readrequires(hgvfs, True)
369 if locked_requirements != original_crequirements:
389 if locked_requirements != original_crequirements:
370 removed = current_requirements - locked_requirements
390 removed = current_requirements - locked_requirements
371 # update current_requirements in place because it's passed
391 # update current_requirements in place because it's passed
372 # as reference
392 # as reference
373 current_requirements -= removed
393 current_requirements -= removed
374 current_requirements |= locked_requirements
394 current_requirements |= locked_requirements
375 current_requirements |= source_requirements
395 current_requirements |= source_requirements
376 current_requirements -= set(requirementsmod.SHARESAFE_REQUIREMENT)
396 current_requirements -= set(requirementsmod.SHARESAFE_REQUIREMENT)
377 scmutil.writerequires(hgvfs, current_requirements)
397 scmutil.writerequires(hgvfs, current_requirements)
378 ui.warn(_(b'repository downgraded to not use share-safe mode\n'))
398 ui.warn(_(b'repository downgraded to not use share-safe mode\n'))
379 except error.LockError as e:
399 except error.LockError as e:
380 hint = _(
400 hint = _(
381 "see `hg help config.format.use-share-safe` for more information"
401 "see `hg help config.format.use-share-safe` for more information"
382 )
402 )
383 # If upgrade-abort is set, abort when upgrade fails, else let the
403 # If upgrade-abort is set, abort when upgrade fails, else let the
384 # process continue as `upgrade-allow` is set
404 # process continue as `upgrade-allow` is set
385 if mismatch_config == b'downgrade-abort':
405 if mismatch_config == b'downgrade-abort':
386 raise error.Abort(
406 raise error.Abort(
387 _(b'failed to downgrade share, got error: %s')
407 _(b'failed to downgrade share, got error: %s')
388 % stringutil.forcebytestr(e.strerror),
408 % stringutil.forcebytestr(e.strerror),
389 hint=hint,
409 hint=hint,
390 )
410 )
391 elif mismatch_warn:
411 elif mismatch_warn:
392 ui.warn(
412 ui.warn(
393 _(b'failed to downgrade share, got error: %s\n')
413 _(b'failed to downgrade share, got error: %s\n')
394 % stringutil.forcebytestr(e.strerror),
414 % stringutil.forcebytestr(e.strerror),
395 hint=hint,
415 hint=hint,
396 )
416 )
397 finally:
417 finally:
398 if wlock:
418 if wlock:
399 wlock.release()
419 wlock.release()
@@ -1,1782 +1,1804 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > [format]
6 > [format]
7 > # stabilize test accross variant
7 > # stabilize test accross variant
8 > revlog-compression=zlib
8 > revlog-compression=zlib
9 > EOF
9 > EOF
10
10
11 store and revlogv1 are required in source
11 store and revlogv1 are required in source
12
12
13 $ hg --config format.usestore=false init no-store
13 $ hg --config format.usestore=false init no-store
14 $ hg -R no-store debugupgraderepo
14 $ hg -R no-store debugupgraderepo
15 abort: cannot upgrade repository; requirement missing: store
15 abort: cannot upgrade repository; requirement missing: store
16 [255]
16 [255]
17
17
18 $ hg init no-revlogv1
18 $ hg init no-revlogv1
19 $ cat > no-revlogv1/.hg/requires << EOF
19 $ cat > no-revlogv1/.hg/requires << EOF
20 > dotencode
20 > dotencode
21 > fncache
21 > fncache
22 > generaldelta
22 > generaldelta
23 > store
23 > store
24 > EOF
24 > EOF
25
25
26 $ hg -R no-revlogv1 debugupgraderepo
26 $ hg -R no-revlogv1 debugupgraderepo
27 abort: cannot upgrade repository; missing a revlog version
27 abort: cannot upgrade repository; missing a revlog version
28 [255]
28 [255]
29
29
30 Cannot upgrade shared repositories
30 Cannot upgrade shared repositories
31
31
32 $ hg init share-parent
32 $ hg init share-parent
33 $ hg -q share share-parent share-child
33 $ hg -q share share-parent share-child
34
34
35 $ hg -R share-child debugupgraderepo
35 $ hg -R share-child debugupgraderepo
36 abort: cannot upgrade repository; unsupported source requirement: shared
36 abort: cannot upgrade repository; unsupported source requirement: shared
37 [255]
37 [255]
38
38
39 Do not yet support upgrading treemanifest repos
39 Do not yet support upgrading treemanifest repos
40
40
41 $ hg --config experimental.treemanifest=true init treemanifest
41 $ hg --config experimental.treemanifest=true init treemanifest
42 $ hg -R treemanifest debugupgraderepo
42 $ hg -R treemanifest debugupgraderepo
43 abort: cannot upgrade repository; unsupported source requirement: treemanifest
43 abort: cannot upgrade repository; unsupported source requirement: treemanifest
44 [255]
44 [255]
45
45
46 Cannot add treemanifest requirement during upgrade
46 Cannot add treemanifest requirement during upgrade
47
47
48 $ hg init disallowaddedreq
48 $ hg init disallowaddedreq
49 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
49 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
50 abort: cannot upgrade repository; do not support adding requirement: treemanifest
50 abort: cannot upgrade repository; do not support adding requirement: treemanifest
51 [255]
51 [255]
52
52
53 An upgrade of a repository created with recommended settings only suggests optimizations
53 An upgrade of a repository created with recommended settings only suggests optimizations
54
54
55 $ hg init empty
55 $ hg init empty
56 $ cd empty
56 $ cd empty
57 $ hg debugformat
57 $ hg debugformat
58 format-variant repo
58 format-variant repo
59 fncache: yes
59 fncache: yes
60 dirstate-v2: no
60 dirstate-v2: no
61 dotencode: yes
61 dotencode: yes
62 generaldelta: yes
62 generaldelta: yes
63 share-safe: no
63 share-safe: no
64 sparserevlog: yes
64 sparserevlog: yes
65 persistent-nodemap: no (no-rust !)
65 persistent-nodemap: no (no-rust !)
66 persistent-nodemap: yes (rust !)
66 persistent-nodemap: yes (rust !)
67 copies-sdc: no
67 copies-sdc: no
68 revlog-v2: no
68 revlog-v2: no
69 changelog-v2: no
69 changelog-v2: no
70 plain-cl-delta: yes
70 plain-cl-delta: yes
71 compression: zlib
71 compression: zlib
72 compression-level: default
72 compression-level: default
73 $ hg debugformat --verbose
73 $ hg debugformat --verbose
74 format-variant repo config default
74 format-variant repo config default
75 fncache: yes yes yes
75 fncache: yes yes yes
76 dirstate-v2: no no no
76 dirstate-v2: no no no
77 dotencode: yes yes yes
77 dotencode: yes yes yes
78 generaldelta: yes yes yes
78 generaldelta: yes yes yes
79 share-safe: no no no
79 share-safe: no no no
80 sparserevlog: yes yes yes
80 sparserevlog: yes yes yes
81 persistent-nodemap: no no no (no-rust !)
81 persistent-nodemap: no no no (no-rust !)
82 persistent-nodemap: yes yes no (rust !)
82 persistent-nodemap: yes yes no (rust !)
83 copies-sdc: no no no
83 copies-sdc: no no no
84 revlog-v2: no no no
84 revlog-v2: no no no
85 changelog-v2: no no no
85 changelog-v2: no no no
86 plain-cl-delta: yes yes yes
86 plain-cl-delta: yes yes yes
87 compression: zlib zlib zlib (no-zstd !)
87 compression: zlib zlib zlib (no-zstd !)
88 compression: zlib zlib zstd (zstd !)
88 compression: zlib zlib zstd (zstd !)
89 compression-level: default default default
89 compression-level: default default default
90 $ hg debugformat --verbose --config format.usefncache=no
90 $ hg debugformat --verbose --config format.usefncache=no
91 format-variant repo config default
91 format-variant repo config default
92 fncache: yes no yes
92 fncache: yes no yes
93 dirstate-v2: no no no
93 dirstate-v2: no no no
94 dotencode: yes no yes
94 dotencode: yes no yes
95 generaldelta: yes yes yes
95 generaldelta: yes yes yes
96 share-safe: no no no
96 share-safe: no no no
97 sparserevlog: yes yes yes
97 sparserevlog: yes yes yes
98 persistent-nodemap: no no no (no-rust !)
98 persistent-nodemap: no no no (no-rust !)
99 persistent-nodemap: yes yes no (rust !)
99 persistent-nodemap: yes yes no (rust !)
100 copies-sdc: no no no
100 copies-sdc: no no no
101 revlog-v2: no no no
101 revlog-v2: no no no
102 changelog-v2: no no no
102 changelog-v2: no no no
103 plain-cl-delta: yes yes yes
103 plain-cl-delta: yes yes yes
104 compression: zlib zlib zlib (no-zstd !)
104 compression: zlib zlib zlib (no-zstd !)
105 compression: zlib zlib zstd (zstd !)
105 compression: zlib zlib zstd (zstd !)
106 compression-level: default default default
106 compression-level: default default default
107 $ hg debugformat --verbose --config format.usefncache=no --color=debug
107 $ hg debugformat --verbose --config format.usefncache=no --color=debug
108 format-variant repo config default
108 format-variant repo config default
109 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
109 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
110 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
110 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
111 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
111 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
112 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
112 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
113 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
113 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
114 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
114 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
115 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
115 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
116 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
116 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
117 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
117 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
118 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
118 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
119 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
119 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
120 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
120 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
121 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
121 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
122 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
122 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
123 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
123 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
124 $ hg debugformat -Tjson
124 $ hg debugformat -Tjson
125 [
125 [
126 {
126 {
127 "config": true,
127 "config": true,
128 "default": true,
128 "default": true,
129 "name": "fncache",
129 "name": "fncache",
130 "repo": true
130 "repo": true
131 },
131 },
132 {
132 {
133 "config": false,
133 "config": false,
134 "default": false,
134 "default": false,
135 "name": "dirstate-v2",
135 "name": "dirstate-v2",
136 "repo": false
136 "repo": false
137 },
137 },
138 {
138 {
139 "config": true,
139 "config": true,
140 "default": true,
140 "default": true,
141 "name": "dotencode",
141 "name": "dotencode",
142 "repo": true
142 "repo": true
143 },
143 },
144 {
144 {
145 "config": true,
145 "config": true,
146 "default": true,
146 "default": true,
147 "name": "generaldelta",
147 "name": "generaldelta",
148 "repo": true
148 "repo": true
149 },
149 },
150 {
150 {
151 "config": false,
151 "config": false,
152 "default": false,
152 "default": false,
153 "name": "share-safe",
153 "name": "share-safe",
154 "repo": false
154 "repo": false
155 },
155 },
156 {
156 {
157 "config": true,
157 "config": true,
158 "default": true,
158 "default": true,
159 "name": "sparserevlog",
159 "name": "sparserevlog",
160 "repo": true
160 "repo": true
161 },
161 },
162 {
162 {
163 "config": false, (no-rust !)
163 "config": false, (no-rust !)
164 "config": true, (rust !)
164 "config": true, (rust !)
165 "default": false,
165 "default": false,
166 "name": "persistent-nodemap",
166 "name": "persistent-nodemap",
167 "repo": false (no-rust !)
167 "repo": false (no-rust !)
168 "repo": true (rust !)
168 "repo": true (rust !)
169 },
169 },
170 {
170 {
171 "config": false,
171 "config": false,
172 "default": false,
172 "default": false,
173 "name": "copies-sdc",
173 "name": "copies-sdc",
174 "repo": false
174 "repo": false
175 },
175 },
176 {
176 {
177 "config": false,
177 "config": false,
178 "default": false,
178 "default": false,
179 "name": "revlog-v2",
179 "name": "revlog-v2",
180 "repo": false
180 "repo": false
181 },
181 },
182 {
182 {
183 "config": false,
183 "config": false,
184 "default": false,
184 "default": false,
185 "name": "changelog-v2",
185 "name": "changelog-v2",
186 "repo": false
186 "repo": false
187 },
187 },
188 {
188 {
189 "config": true,
189 "config": true,
190 "default": true,
190 "default": true,
191 "name": "plain-cl-delta",
191 "name": "plain-cl-delta",
192 "repo": true
192 "repo": true
193 },
193 },
194 {
194 {
195 "config": "zlib",
195 "config": "zlib",
196 "default": "zlib", (no-zstd !)
196 "default": "zlib", (no-zstd !)
197 "default": "zstd", (zstd !)
197 "default": "zstd", (zstd !)
198 "name": "compression",
198 "name": "compression",
199 "repo": "zlib"
199 "repo": "zlib"
200 },
200 },
201 {
201 {
202 "config": "default",
202 "config": "default",
203 "default": "default",
203 "default": "default",
204 "name": "compression-level",
204 "name": "compression-level",
205 "repo": "default"
205 "repo": "default"
206 }
206 }
207 ]
207 ]
208 $ hg debugupgraderepo
208 $ hg debugupgraderepo
209 (no format upgrades found in existing repository)
209 (no format upgrades found in existing repository)
210 performing an upgrade with "--run" will make the following changes:
210 performing an upgrade with "--run" will make the following changes:
211
211
212 requirements
212 requirements
213 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
213 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
214 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
214 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
215
215
216 processed revlogs:
216 processed revlogs:
217 - all-filelogs
217 - all-filelogs
218 - changelog
218 - changelog
219 - manifest
219 - manifest
220
220
221 additional optimizations are available by specifying "--optimize <name>":
221 additional optimizations are available by specifying "--optimize <name>":
222
222
223 re-delta-parent
223 re-delta-parent
224 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
224 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
225
225
226 re-delta-multibase
226 re-delta-multibase
227 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
227 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
228
228
229 re-delta-all
229 re-delta-all
230 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
230 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
231
231
232 re-delta-fulladd
232 re-delta-fulladd
233 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.
233 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.
234
234
235
235
236 $ hg debugupgraderepo --quiet
236 $ hg debugupgraderepo --quiet
237 requirements
237 requirements
238 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
238 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
239 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
239 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
240
240
241 processed revlogs:
241 processed revlogs:
242 - all-filelogs
242 - all-filelogs
243 - changelog
243 - changelog
244 - manifest
244 - manifest
245
245
246
246
247 --optimize can be used to add optimizations
247 --optimize can be used to add optimizations
248
248
249 $ hg debugupgrade --optimize 're-delta-parent'
249 $ hg debugupgrade --optimize 're-delta-parent'
250 (no format upgrades found in existing repository)
250 (no format upgrades found in existing repository)
251 performing an upgrade with "--run" will make the following changes:
251 performing an upgrade with "--run" will make the following changes:
252
252
253 requirements
253 requirements
254 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
254 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
255 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
255 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
256
256
257 optimisations: re-delta-parent
257 optimisations: re-delta-parent
258
258
259 re-delta-parent
259 re-delta-parent
260 deltas within internal storage will choose a new base revision if needed
260 deltas within internal storage will choose a new base revision if needed
261
261
262 processed revlogs:
262 processed revlogs:
263 - all-filelogs
263 - all-filelogs
264 - changelog
264 - changelog
265 - manifest
265 - manifest
266
266
267 additional optimizations are available by specifying "--optimize <name>":
267 additional optimizations are available by specifying "--optimize <name>":
268
268
269 re-delta-multibase
269 re-delta-multibase
270 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
270 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
271
271
272 re-delta-all
272 re-delta-all
273 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
273 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
274
274
275 re-delta-fulladd
275 re-delta-fulladd
276 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.
276 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.
277
277
278
278
279 modern form of the option
279 modern form of the option
280
280
281 $ hg debugupgrade --optimize re-delta-parent
281 $ hg debugupgrade --optimize re-delta-parent
282 (no format upgrades found in existing repository)
282 (no format upgrades found in existing repository)
283 performing an upgrade with "--run" will make the following changes:
283 performing an upgrade with "--run" will make the following changes:
284
284
285 requirements
285 requirements
286 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
286 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
287 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
287 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
288
288
289 optimisations: re-delta-parent
289 optimisations: re-delta-parent
290
290
291 re-delta-parent
291 re-delta-parent
292 deltas within internal storage will choose a new base revision if needed
292 deltas within internal storage will choose a new base revision if needed
293
293
294 processed revlogs:
294 processed revlogs:
295 - all-filelogs
295 - all-filelogs
296 - changelog
296 - changelog
297 - manifest
297 - manifest
298
298
299 additional optimizations are available by specifying "--optimize <name>":
299 additional optimizations are available by specifying "--optimize <name>":
300
300
301 re-delta-multibase
301 re-delta-multibase
302 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
302 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
303
303
304 re-delta-all
304 re-delta-all
305 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
305 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
306
306
307 re-delta-fulladd
307 re-delta-fulladd
308 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.
308 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.
309
309
310 $ hg debugupgrade --optimize re-delta-parent --quiet
310 $ hg debugupgrade --optimize re-delta-parent --quiet
311 requirements
311 requirements
312 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
312 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
313 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
313 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
314
314
315 optimisations: re-delta-parent
315 optimisations: re-delta-parent
316
316
317 processed revlogs:
317 processed revlogs:
318 - all-filelogs
318 - all-filelogs
319 - changelog
319 - changelog
320 - manifest
320 - manifest
321
321
322
322
323 unknown optimization:
323 unknown optimization:
324
324
325 $ hg debugupgrade --optimize foobar
325 $ hg debugupgrade --optimize foobar
326 abort: unknown optimization action requested: foobar
326 abort: unknown optimization action requested: foobar
327 (run without arguments to see valid optimizations)
327 (run without arguments to see valid optimizations)
328 [255]
328 [255]
329
329
330 Various sub-optimal detections work
330 Various sub-optimal detections work
331
331
332 $ cat > .hg/requires << EOF
332 $ cat > .hg/requires << EOF
333 > revlogv1
333 > revlogv1
334 > store
334 > store
335 > EOF
335 > EOF
336
336
337 $ hg debugformat
337 $ hg debugformat
338 format-variant repo
338 format-variant repo
339 fncache: no
339 fncache: no
340 dirstate-v2: no
340 dirstate-v2: no
341 dotencode: no
341 dotencode: no
342 generaldelta: no
342 generaldelta: no
343 share-safe: no
343 share-safe: no
344 sparserevlog: no
344 sparserevlog: no
345 persistent-nodemap: no
345 persistent-nodemap: no
346 copies-sdc: no
346 copies-sdc: no
347 revlog-v2: no
347 revlog-v2: no
348 changelog-v2: no
348 changelog-v2: no
349 plain-cl-delta: yes
349 plain-cl-delta: yes
350 compression: zlib
350 compression: zlib
351 compression-level: default
351 compression-level: default
352 $ hg debugformat --verbose
352 $ hg debugformat --verbose
353 format-variant repo config default
353 format-variant repo config default
354 fncache: no yes yes
354 fncache: no yes yes
355 dirstate-v2: no no no
355 dirstate-v2: no no no
356 dotencode: no yes yes
356 dotencode: no yes yes
357 generaldelta: no yes yes
357 generaldelta: no yes yes
358 share-safe: no no no
358 share-safe: no no no
359 sparserevlog: no yes yes
359 sparserevlog: no yes yes
360 persistent-nodemap: no no no (no-rust !)
360 persistent-nodemap: no no no (no-rust !)
361 persistent-nodemap: no yes no (rust !)
361 persistent-nodemap: no yes no (rust !)
362 copies-sdc: no no no
362 copies-sdc: no no no
363 revlog-v2: no no no
363 revlog-v2: no no no
364 changelog-v2: no no no
364 changelog-v2: no no no
365 plain-cl-delta: yes yes yes
365 plain-cl-delta: yes yes yes
366 compression: zlib zlib zlib (no-zstd !)
366 compression: zlib zlib zlib (no-zstd !)
367 compression: zlib zlib zstd (zstd !)
367 compression: zlib zlib zstd (zstd !)
368 compression-level: default default default
368 compression-level: default default default
369 $ hg debugformat --verbose --config format.usegeneraldelta=no
369 $ hg debugformat --verbose --config format.usegeneraldelta=no
370 format-variant repo config default
370 format-variant repo config default
371 fncache: no yes yes
371 fncache: no yes yes
372 dirstate-v2: no no no
372 dirstate-v2: no no no
373 dotencode: no yes yes
373 dotencode: no yes yes
374 generaldelta: no no yes
374 generaldelta: no no yes
375 share-safe: no no no
375 share-safe: no no no
376 sparserevlog: no no yes
376 sparserevlog: no no yes
377 persistent-nodemap: no no no (no-rust !)
377 persistent-nodemap: no no no (no-rust !)
378 persistent-nodemap: no yes no (rust !)
378 persistent-nodemap: no yes no (rust !)
379 copies-sdc: no no no
379 copies-sdc: no no no
380 revlog-v2: no no no
380 revlog-v2: no no no
381 changelog-v2: no no no
381 changelog-v2: no no no
382 plain-cl-delta: yes yes yes
382 plain-cl-delta: yes yes yes
383 compression: zlib zlib zlib (no-zstd !)
383 compression: zlib zlib zlib (no-zstd !)
384 compression: zlib zlib zstd (zstd !)
384 compression: zlib zlib zstd (zstd !)
385 compression-level: default default default
385 compression-level: default default default
386 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
386 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
387 format-variant repo config default
387 format-variant repo config default
388 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
388 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
389 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
389 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
390 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
390 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
391 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
391 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
392 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
392 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
393 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
393 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
394 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
394 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
395 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
395 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
396 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
396 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
397 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
397 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
398 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
398 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
399 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
399 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
400 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
400 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
401 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
401 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
402 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
402 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
403 $ hg debugupgraderepo
403 $ hg debugupgraderepo
404 note: selecting all-filelogs for processing to change: dotencode
405 note: selecting all-manifestlogs for processing to change: dotencode
406 note: selecting changelog for processing to change: dotencode
407
404 repository lacks features recommended by current config options:
408 repository lacks features recommended by current config options:
405
409
406 fncache
410 fncache
407 long and reserved filenames may not work correctly; repository performance is sub-optimal
411 long and reserved filenames may not work correctly; repository performance is sub-optimal
408
412
409 dotencode
413 dotencode
410 storage of filenames beginning with a period or space may not work correctly
414 storage of filenames beginning with a period or space may not work correctly
411
415
412 generaldelta
416 generaldelta
413 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
417 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
414
418
415 sparserevlog
419 sparserevlog
416 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.
420 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.
417
421
418 persistent-nodemap (rust !)
422 persistent-nodemap (rust !)
419 persist the node -> rev mapping on disk to speedup lookup (rust !)
423 persist the node -> rev mapping on disk to speedup lookup (rust !)
420 (rust !)
424 (rust !)
421
425
422 performing an upgrade with "--run" will make the following changes:
426 performing an upgrade with "--run" will make the following changes:
423
427
424 requirements
428 requirements
425 preserved: revlogv1, store
429 preserved: revlogv1, store
426 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
430 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
427 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
431 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
428
432
429 fncache
433 fncache
430 repository will be more resilient to storing certain paths and performance of certain operations should be improved
434 repository will be more resilient to storing certain paths and performance of certain operations should be improved
431
435
432 dotencode
436 dotencode
433 repository will be better able to store files beginning with a space or period
437 repository will be better able to store files beginning with a space or period
434
438
435 generaldelta
439 generaldelta
436 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
440 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
437
441
438 sparserevlog
442 sparserevlog
439 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.
443 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.
440
444
441 persistent-nodemap (rust !)
445 persistent-nodemap (rust !)
442 Speedup revision lookup by node id. (rust !)
446 Speedup revision lookup by node id. (rust !)
443 (rust !)
447 (rust !)
444 processed revlogs:
448 processed revlogs:
445 - all-filelogs
449 - all-filelogs
446 - changelog
450 - changelog
447 - manifest
451 - manifest
448
452
449 additional optimizations are available by specifying "--optimize <name>":
453 additional optimizations are available by specifying "--optimize <name>":
450
454
451 re-delta-parent
455 re-delta-parent
452 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
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
453
457
454 re-delta-multibase
458 re-delta-multibase
455 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
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
456
460
457 re-delta-all
461 re-delta-all
458 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
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
459
463
460 re-delta-fulladd
464 re-delta-fulladd
461 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.
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.
462
466
463 $ hg debugupgraderepo --quiet
467 $ hg debugupgraderepo --quiet
464 requirements
468 requirements
465 preserved: revlogv1, store
469 preserved: revlogv1, store
466 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
470 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
467 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
471 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
468
472
469 processed revlogs:
473 processed revlogs:
470 - all-filelogs
474 - all-filelogs
471 - changelog
475 - changelog
472 - manifest
476 - manifest
473
477
474
478
475 $ hg --config format.dotencode=false debugupgraderepo
479 $ hg --config format.dotencode=false debugupgraderepo
480 note: selecting all-filelogs for processing to change: fncache
481 note: selecting all-manifestlogs for processing to change: fncache
482 note: selecting changelog for processing to change: fncache
483
476 repository lacks features recommended by current config options:
484 repository lacks features recommended by current config options:
477
485
478 fncache
486 fncache
479 long and reserved filenames may not work correctly; repository performance is sub-optimal
487 long and reserved filenames may not work correctly; repository performance is sub-optimal
480
488
481 generaldelta
489 generaldelta
482 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
490 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
483
491
484 sparserevlog
492 sparserevlog
485 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.
493 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.
486
494
487 persistent-nodemap (rust !)
495 persistent-nodemap (rust !)
488 persist the node -> rev mapping on disk to speedup lookup (rust !)
496 persist the node -> rev mapping on disk to speedup lookup (rust !)
489 (rust !)
497 (rust !)
490 repository lacks features used by the default config options:
498 repository lacks features used by the default config options:
491
499
492 dotencode
500 dotencode
493 storage of filenames beginning with a period or space may not work correctly
501 storage of filenames beginning with a period or space may not work correctly
494
502
495
503
496 performing an upgrade with "--run" will make the following changes:
504 performing an upgrade with "--run" will make the following changes:
497
505
498 requirements
506 requirements
499 preserved: revlogv1, store
507 preserved: revlogv1, store
500 added: fncache, generaldelta, sparserevlog (no-rust !)
508 added: fncache, generaldelta, sparserevlog (no-rust !)
501 added: fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
509 added: fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
502
510
503 fncache
511 fncache
504 repository will be more resilient to storing certain paths and performance of certain operations should be improved
512 repository will be more resilient to storing certain paths and performance of certain operations should be improved
505
513
506 generaldelta
514 generaldelta
507 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
515 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
508
516
509 sparserevlog
517 sparserevlog
510 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.
518 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.
511
519
512 persistent-nodemap (rust !)
520 persistent-nodemap (rust !)
513 Speedup revision lookup by node id. (rust !)
521 Speedup revision lookup by node id. (rust !)
514 (rust !)
522 (rust !)
515 processed revlogs:
523 processed revlogs:
516 - all-filelogs
524 - all-filelogs
517 - changelog
525 - changelog
518 - manifest
526 - manifest
519
527
520 additional optimizations are available by specifying "--optimize <name>":
528 additional optimizations are available by specifying "--optimize <name>":
521
529
522 re-delta-parent
530 re-delta-parent
523 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
531 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
524
532
525 re-delta-multibase
533 re-delta-multibase
526 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
534 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
527
535
528 re-delta-all
536 re-delta-all
529 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
537 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
530
538
531 re-delta-fulladd
539 re-delta-fulladd
532 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.
540 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.
533
541
534
542
535 $ cd ..
543 $ cd ..
536
544
537 Upgrading a repository that is already modern essentially no-ops
545 Upgrading a repository that is already modern essentially no-ops
538
546
539 $ hg init modern
547 $ hg init modern
540 $ hg -R modern debugupgraderepo --run
548 $ hg -R modern debugupgraderepo --run
541 nothing to do
549 nothing to do
542
550
543 Upgrading a repository to generaldelta works
551 Upgrading a repository to generaldelta works
544
552
545 $ hg --config format.usegeneraldelta=false init upgradegd
553 $ hg --config format.usegeneraldelta=false init upgradegd
546 $ cd upgradegd
554 $ cd upgradegd
547 $ touch f0
555 $ touch f0
548 $ hg -q commit -A -m initial
556 $ hg -q commit -A -m initial
549 $ mkdir FooBarDirectory.d
557 $ mkdir FooBarDirectory.d
550 $ touch FooBarDirectory.d/f1
558 $ touch FooBarDirectory.d/f1
551 $ hg -q commit -A -m 'add f1'
559 $ hg -q commit -A -m 'add f1'
552 $ hg -q up -r 0
560 $ hg -q up -r 0
553 >>> from __future__ import absolute_import, print_function
561 >>> from __future__ import absolute_import, print_function
554 >>> import random
562 >>> import random
555 >>> random.seed(0) # have a reproducible content
563 >>> random.seed(0) # have a reproducible content
556 >>> with open("f2", "wb") as f:
564 >>> with open("f2", "wb") as f:
557 ... for i in range(100000):
565 ... for i in range(100000):
558 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
566 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
559 $ hg -q commit -A -m 'add f2'
567 $ hg -q commit -A -m 'add f2'
560
568
561 make sure we have a .d file
569 make sure we have a .d file
562
570
563 $ ls -d .hg/store/data/*
571 $ ls -d .hg/store/data/*
564 .hg/store/data/_foo_bar_directory.d.hg
572 .hg/store/data/_foo_bar_directory.d.hg
565 .hg/store/data/f0.i
573 .hg/store/data/f0.i
566 .hg/store/data/f2.d
574 .hg/store/data/f2.d
567 .hg/store/data/f2.i
575 .hg/store/data/f2.i
568
576
569 $ hg debugupgraderepo --run --config format.sparse-revlog=false
577 $ hg debugupgraderepo --run --config format.sparse-revlog=false
578 note: selecting all-filelogs for processing to change: generaldelta
579 note: selecting all-manifestlogs for processing to change: generaldelta
580 note: selecting changelog for processing to change: generaldelta
581
570 upgrade will perform the following actions:
582 upgrade will perform the following actions:
571
583
572 requirements
584 requirements
573 preserved: dotencode, fncache, revlogv1, store (no-rust !)
585 preserved: dotencode, fncache, revlogv1, store (no-rust !)
574 preserved: dotencode, fncache, persistent-nodemap, revlogv1, store (rust !)
586 preserved: dotencode, fncache, persistent-nodemap, revlogv1, store (rust !)
575 added: generaldelta
587 added: generaldelta
576
588
577 generaldelta
589 generaldelta
578 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
590 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
579
591
580 processed revlogs:
592 processed revlogs:
581 - all-filelogs
593 - all-filelogs
582 - changelog
594 - changelog
583 - manifest
595 - manifest
584
596
585 beginning upgrade...
597 beginning upgrade...
586 repository locked and read-only
598 repository locked and read-only
587 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
599 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
588 (it is safe to interrupt this process any time before data migration completes)
600 (it is safe to interrupt this process any time before data migration completes)
589 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
601 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
590 migrating 519 KB in store; 1.05 MB tracked data
602 migrating 519 KB in store; 1.05 MB tracked data
591 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
603 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
592 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
604 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
593 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
605 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
594 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
606 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
595 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
607 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
596 finished migrating 3 changelog revisions; change in size: 0 bytes
608 finished migrating 3 changelog revisions; change in size: 0 bytes
597 finished migrating 9 total revisions; total change in store size: -17 bytes
609 finished migrating 9 total revisions; total change in store size: -17 bytes
598 copying phaseroots
610 copying phaseroots
599 data fully upgraded in a temporary repository
611 data fully upgraded in a temporary repository
600 marking source repository as being upgraded; clients will be unable to read from repository
612 marking source repository as being upgraded; clients will be unable to read from repository
601 starting in-place swap of repository data
613 starting in-place swap of repository data
602 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
614 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
603 replacing store...
615 replacing store...
604 store replacement complete; repository was inconsistent for *s (glob)
616 store replacement complete; repository was inconsistent for *s (glob)
605 finalizing requirements file and making repository readable again
617 finalizing requirements file and making repository readable again
606 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
618 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
607 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
619 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
608 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
620 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
609
621
610 Original requirements backed up
622 Original requirements backed up
611
623
612 $ cat .hg/upgradebackup.*/requires
624 $ cat .hg/upgradebackup.*/requires
613 dotencode
625 dotencode
614 fncache
626 fncache
615 persistent-nodemap (rust !)
627 persistent-nodemap (rust !)
616 revlogv1
628 revlogv1
617 store
629 store
618
630
619 generaldelta added to original requirements files
631 generaldelta added to original requirements files
620
632
621 $ cat .hg/requires
633 $ cat .hg/requires
622 dotencode
634 dotencode
623 fncache
635 fncache
624 generaldelta
636 generaldelta
625 persistent-nodemap (rust !)
637 persistent-nodemap (rust !)
626 revlogv1
638 revlogv1
627 store
639 store
628
640
629 store directory has files we expect
641 store directory has files we expect
630
642
631 $ ls .hg/store
643 $ ls .hg/store
632 00changelog.i
644 00changelog.i
633 00manifest.i
645 00manifest.i
634 data
646 data
635 fncache
647 fncache
636 phaseroots
648 phaseroots
637 undo
649 undo
638 undo.backupfiles
650 undo.backupfiles
639 undo.phaseroots
651 undo.phaseroots
640
652
641 manifest should be generaldelta
653 manifest should be generaldelta
642
654
643 $ hg debugrevlog -m | grep flags
655 $ hg debugrevlog -m | grep flags
644 flags : inline, generaldelta
656 flags : inline, generaldelta
645
657
646 verify should be happy
658 verify should be happy
647
659
648 $ hg verify
660 $ hg verify
649 checking changesets
661 checking changesets
650 checking manifests
662 checking manifests
651 crosschecking files in changesets and manifests
663 crosschecking files in changesets and manifests
652 checking files
664 checking files
653 checked 3 changesets with 3 changes to 3 files
665 checked 3 changesets with 3 changes to 3 files
654
666
655 old store should be backed up
667 old store should be backed up
656
668
657 $ ls -d .hg/upgradebackup.*/
669 $ ls -d .hg/upgradebackup.*/
658 .hg/upgradebackup.*/ (glob)
670 .hg/upgradebackup.*/ (glob)
659 $ ls .hg/upgradebackup.*/store
671 $ ls .hg/upgradebackup.*/store
660 00changelog.i
672 00changelog.i
661 00manifest.i
673 00manifest.i
662 data
674 data
663 fncache
675 fncache
664 phaseroots
676 phaseroots
665 undo
677 undo
666 undo.backup.fncache
678 undo.backup.fncache
667 undo.backupfiles
679 undo.backupfiles
668 undo.phaseroots
680 undo.phaseroots
669
681
670 unless --no-backup is passed
682 unless --no-backup is passed
671
683
672 $ rm -rf .hg/upgradebackup.*/
684 $ rm -rf .hg/upgradebackup.*/
673 $ hg debugupgraderepo --run --no-backup
685 $ hg debugupgraderepo --run --no-backup
686 note: selecting all-filelogs for processing to change: sparserevlog
687 note: selecting all-manifestlogs for processing to change: sparserevlog
688 note: selecting changelog for processing to change: sparserevlog
689
674 upgrade will perform the following actions:
690 upgrade will perform the following actions:
675
691
676 requirements
692 requirements
677 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
693 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
678 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
694 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
679 added: sparserevlog
695 added: sparserevlog
680
696
681 sparserevlog
697 sparserevlog
682 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.
698 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.
683
699
684 processed revlogs:
700 processed revlogs:
685 - all-filelogs
701 - all-filelogs
686 - changelog
702 - changelog
687 - manifest
703 - manifest
688
704
689 beginning upgrade...
705 beginning upgrade...
690 repository locked and read-only
706 repository locked and read-only
691 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
707 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
692 (it is safe to interrupt this process any time before data migration completes)
708 (it is safe to interrupt this process any time before data migration completes)
693 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
709 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
694 migrating 519 KB in store; 1.05 MB tracked data
710 migrating 519 KB in store; 1.05 MB tracked data
695 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
711 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
696 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
712 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
697 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
713 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
698 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
714 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
699 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
715 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
700 finished migrating 3 changelog revisions; change in size: 0 bytes
716 finished migrating 3 changelog revisions; change in size: 0 bytes
701 finished migrating 9 total revisions; total change in store size: 0 bytes
717 finished migrating 9 total revisions; total change in store size: 0 bytes
702 copying phaseroots
718 copying phaseroots
703 data fully upgraded in a temporary repository
719 data fully upgraded in a temporary repository
704 marking source repository as being upgraded; clients will be unable to read from repository
720 marking source repository as being upgraded; clients will be unable to read from repository
705 starting in-place swap of repository data
721 starting in-place swap of repository data
706 replacing store...
722 replacing store...
707 store replacement complete; repository was inconsistent for * (glob)
723 store replacement complete; repository was inconsistent for * (glob)
708 finalizing requirements file and making repository readable again
724 finalizing requirements file and making repository readable again
709 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
725 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
710 $ ls -1 .hg/ | grep upgradebackup
726 $ ls -1 .hg/ | grep upgradebackup
711 [1]
727 [1]
712
728
713 We can restrict optimization to some revlog:
729 We can restrict optimization to some revlog:
714
730
715 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
731 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
716 upgrade will perform the following actions:
732 upgrade will perform the following actions:
717
733
718 requirements
734 requirements
719 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
735 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
720 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
736 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
721
737
722 optimisations: re-delta-parent
738 optimisations: re-delta-parent
723
739
724 re-delta-parent
740 re-delta-parent
725 deltas within internal storage will choose a new base revision if needed
741 deltas within internal storage will choose a new base revision if needed
726
742
727 processed revlogs:
743 processed revlogs:
728 - manifest
744 - manifest
729
745
730 beginning upgrade...
746 beginning upgrade...
731 repository locked and read-only
747 repository locked and read-only
732 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
748 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
733 (it is safe to interrupt this process any time before data migration completes)
749 (it is safe to interrupt this process any time before data migration completes)
734 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
750 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
735 migrating 519 KB in store; 1.05 MB tracked data
751 migrating 519 KB in store; 1.05 MB tracked data
736 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
752 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
737 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
753 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
738 blindly copying data/f0.i containing 1 revisions
754 blindly copying data/f0.i containing 1 revisions
739 blindly copying data/f2.i containing 1 revisions
755 blindly copying data/f2.i containing 1 revisions
740 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
756 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
741 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
757 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
742 cloning 3 revisions from 00manifest.i
758 cloning 3 revisions from 00manifest.i
743 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
759 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
744 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
760 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
745 blindly copying 00changelog.i containing 3 revisions
761 blindly copying 00changelog.i containing 3 revisions
746 finished migrating 3 changelog revisions; change in size: 0 bytes
762 finished migrating 3 changelog revisions; change in size: 0 bytes
747 finished migrating 9 total revisions; total change in store size: 0 bytes
763 finished migrating 9 total revisions; total change in store size: 0 bytes
748 copying phaseroots
764 copying phaseroots
749 data fully upgraded in a temporary repository
765 data fully upgraded in a temporary repository
750 marking source repository as being upgraded; clients will be unable to read from repository
766 marking source repository as being upgraded; clients will be unable to read from repository
751 starting in-place swap of repository data
767 starting in-place swap of repository data
752 replacing store...
768 replacing store...
753 store replacement complete; repository was inconsistent for *s (glob)
769 store replacement complete; repository was inconsistent for *s (glob)
754 finalizing requirements file and making repository readable again
770 finalizing requirements file and making repository readable again
755 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
771 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
756
772
757 Check that the repo still works fine
773 Check that the repo still works fine
758
774
759 $ hg log -G --stat
775 $ hg log -G --stat
760 @ changeset: 2:76d4395f5413 (no-py3 !)
776 @ changeset: 2:76d4395f5413 (no-py3 !)
761 @ changeset: 2:fca376863211 (py3 !)
777 @ changeset: 2:fca376863211 (py3 !)
762 | tag: tip
778 | tag: tip
763 | parent: 0:ba592bf28da2
779 | parent: 0:ba592bf28da2
764 | user: test
780 | user: test
765 | date: Thu Jan 01 00:00:00 1970 +0000
781 | date: Thu Jan 01 00:00:00 1970 +0000
766 | summary: add f2
782 | summary: add f2
767 |
783 |
768 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
784 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
769 | 1 files changed, 100000 insertions(+), 0 deletions(-)
785 | 1 files changed, 100000 insertions(+), 0 deletions(-)
770 |
786 |
771 | o changeset: 1:2029ce2354e2
787 | o changeset: 1:2029ce2354e2
772 |/ user: test
788 |/ user: test
773 | date: Thu Jan 01 00:00:00 1970 +0000
789 | date: Thu Jan 01 00:00:00 1970 +0000
774 | summary: add f1
790 | summary: add f1
775 |
791 |
776 |
792 |
777 o changeset: 0:ba592bf28da2
793 o changeset: 0:ba592bf28da2
778 user: test
794 user: test
779 date: Thu Jan 01 00:00:00 1970 +0000
795 date: Thu Jan 01 00:00:00 1970 +0000
780 summary: initial
796 summary: initial
781
797
782
798
783
799
784 $ hg verify
800 $ hg verify
785 checking changesets
801 checking changesets
786 checking manifests
802 checking manifests
787 crosschecking files in changesets and manifests
803 crosschecking files in changesets and manifests
788 checking files
804 checking files
789 checked 3 changesets with 3 changes to 3 files
805 checked 3 changesets with 3 changes to 3 files
790
806
791 Check we can select negatively
807 Check we can select negatively
792
808
793 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
809 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
794 upgrade will perform the following actions:
810 upgrade will perform the following actions:
795
811
796 requirements
812 requirements
797 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
813 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
798 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
814 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
799
815
800 optimisations: re-delta-parent
816 optimisations: re-delta-parent
801
817
802 re-delta-parent
818 re-delta-parent
803 deltas within internal storage will choose a new base revision if needed
819 deltas within internal storage will choose a new base revision if needed
804
820
805 processed revlogs:
821 processed revlogs:
806 - all-filelogs
822 - all-filelogs
807 - changelog
823 - changelog
808
824
809 beginning upgrade...
825 beginning upgrade...
810 repository locked and read-only
826 repository locked and read-only
811 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
827 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
812 (it is safe to interrupt this process any time before data migration completes)
828 (it is safe to interrupt this process any time before data migration completes)
813 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
829 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
814 migrating 519 KB in store; 1.05 MB tracked data
830 migrating 519 KB in store; 1.05 MB tracked data
815 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
831 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
816 cloning 1 revisions from data/FooBarDirectory.d/f1.i
832 cloning 1 revisions from data/FooBarDirectory.d/f1.i
817 cloning 1 revisions from data/f0.i
833 cloning 1 revisions from data/f0.i
818 cloning 1 revisions from data/f2.i
834 cloning 1 revisions from data/f2.i
819 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
835 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
820 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
836 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
821 blindly copying 00manifest.i containing 3 revisions
837 blindly copying 00manifest.i containing 3 revisions
822 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
838 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
823 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
839 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
824 cloning 3 revisions from 00changelog.i
840 cloning 3 revisions from 00changelog.i
825 finished migrating 3 changelog revisions; change in size: 0 bytes
841 finished migrating 3 changelog revisions; change in size: 0 bytes
826 finished migrating 9 total revisions; total change in store size: 0 bytes
842 finished migrating 9 total revisions; total change in store size: 0 bytes
827 copying phaseroots
843 copying phaseroots
828 data fully upgraded in a temporary repository
844 data fully upgraded in a temporary repository
829 marking source repository as being upgraded; clients will be unable to read from repository
845 marking source repository as being upgraded; clients will be unable to read from repository
830 starting in-place swap of repository data
846 starting in-place swap of repository data
831 replacing store...
847 replacing store...
832 store replacement complete; repository was inconsistent for *s (glob)
848 store replacement complete; repository was inconsistent for *s (glob)
833 finalizing requirements file and making repository readable again
849 finalizing requirements file and making repository readable again
834 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
850 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
835 $ hg verify
851 $ hg verify
836 checking changesets
852 checking changesets
837 checking manifests
853 checking manifests
838 crosschecking files in changesets and manifests
854 crosschecking files in changesets and manifests
839 checking files
855 checking files
840 checked 3 changesets with 3 changes to 3 files
856 checked 3 changesets with 3 changes to 3 files
841
857
842 Check that we can select changelog only
858 Check that we can select changelog only
843
859
844 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
860 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
845 upgrade will perform the following actions:
861 upgrade will perform the following actions:
846
862
847 requirements
863 requirements
848 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
864 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
849 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
865 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
850
866
851 optimisations: re-delta-parent
867 optimisations: re-delta-parent
852
868
853 re-delta-parent
869 re-delta-parent
854 deltas within internal storage will choose a new base revision if needed
870 deltas within internal storage will choose a new base revision if needed
855
871
856 processed revlogs:
872 processed revlogs:
857 - changelog
873 - changelog
858
874
859 beginning upgrade...
875 beginning upgrade...
860 repository locked and read-only
876 repository locked and read-only
861 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
877 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
862 (it is safe to interrupt this process any time before data migration completes)
878 (it is safe to interrupt this process any time before data migration completes)
863 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
879 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
864 migrating 519 KB in store; 1.05 MB tracked data
880 migrating 519 KB in store; 1.05 MB tracked data
865 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
881 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
866 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
882 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
867 blindly copying data/f0.i containing 1 revisions
883 blindly copying data/f0.i containing 1 revisions
868 blindly copying data/f2.i containing 1 revisions
884 blindly copying data/f2.i containing 1 revisions
869 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
885 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
870 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
886 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
871 blindly copying 00manifest.i containing 3 revisions
887 blindly copying 00manifest.i containing 3 revisions
872 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
888 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
873 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
889 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
874 cloning 3 revisions from 00changelog.i
890 cloning 3 revisions from 00changelog.i
875 finished migrating 3 changelog revisions; change in size: 0 bytes
891 finished migrating 3 changelog revisions; change in size: 0 bytes
876 finished migrating 9 total revisions; total change in store size: 0 bytes
892 finished migrating 9 total revisions; total change in store size: 0 bytes
877 copying phaseroots
893 copying phaseroots
878 data fully upgraded in a temporary repository
894 data fully upgraded in a temporary repository
879 marking source repository as being upgraded; clients will be unable to read from repository
895 marking source repository as being upgraded; clients will be unable to read from repository
880 starting in-place swap of repository data
896 starting in-place swap of repository data
881 replacing store...
897 replacing store...
882 store replacement complete; repository was inconsistent for *s (glob)
898 store replacement complete; repository was inconsistent for *s (glob)
883 finalizing requirements file and making repository readable again
899 finalizing requirements file and making repository readable again
884 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
900 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
885 $ hg verify
901 $ hg verify
886 checking changesets
902 checking changesets
887 checking manifests
903 checking manifests
888 crosschecking files in changesets and manifests
904 crosschecking files in changesets and manifests
889 checking files
905 checking files
890 checked 3 changesets with 3 changes to 3 files
906 checked 3 changesets with 3 changes to 3 files
891
907
892 Check that we can select filelog only
908 Check that we can select filelog only
893
909
894 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
910 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
895 upgrade will perform the following actions:
911 upgrade will perform the following actions:
896
912
897 requirements
913 requirements
898 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
914 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
899 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
915 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
900
916
901 optimisations: re-delta-parent
917 optimisations: re-delta-parent
902
918
903 re-delta-parent
919 re-delta-parent
904 deltas within internal storage will choose a new base revision if needed
920 deltas within internal storage will choose a new base revision if needed
905
921
906 processed revlogs:
922 processed revlogs:
907 - all-filelogs
923 - all-filelogs
908
924
909 beginning upgrade...
925 beginning upgrade...
910 repository locked and read-only
926 repository locked and read-only
911 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
927 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
912 (it is safe to interrupt this process any time before data migration completes)
928 (it is safe to interrupt this process any time before data migration completes)
913 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
929 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
914 migrating 519 KB in store; 1.05 MB tracked data
930 migrating 519 KB in store; 1.05 MB tracked data
915 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
931 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
916 cloning 1 revisions from data/FooBarDirectory.d/f1.i
932 cloning 1 revisions from data/FooBarDirectory.d/f1.i
917 cloning 1 revisions from data/f0.i
933 cloning 1 revisions from data/f0.i
918 cloning 1 revisions from data/f2.i
934 cloning 1 revisions from data/f2.i
919 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
935 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
920 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
936 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
921 blindly copying 00manifest.i containing 3 revisions
937 blindly copying 00manifest.i containing 3 revisions
922 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
938 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
923 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
939 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
924 blindly copying 00changelog.i containing 3 revisions
940 blindly copying 00changelog.i containing 3 revisions
925 finished migrating 3 changelog revisions; change in size: 0 bytes
941 finished migrating 3 changelog revisions; change in size: 0 bytes
926 finished migrating 9 total revisions; total change in store size: 0 bytes
942 finished migrating 9 total revisions; total change in store size: 0 bytes
927 copying phaseroots
943 copying phaseroots
928 data fully upgraded in a temporary repository
944 data fully upgraded in a temporary repository
929 marking source repository as being upgraded; clients will be unable to read from repository
945 marking source repository as being upgraded; clients will be unable to read from repository
930 starting in-place swap of repository data
946 starting in-place swap of repository data
931 replacing store...
947 replacing store...
932 store replacement complete; repository was inconsistent for *s (glob)
948 store replacement complete; repository was inconsistent for *s (glob)
933 finalizing requirements file and making repository readable again
949 finalizing requirements file and making repository readable again
934 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
950 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
935 $ hg verify
951 $ hg verify
936 checking changesets
952 checking changesets
937 checking manifests
953 checking manifests
938 crosschecking files in changesets and manifests
954 crosschecking files in changesets and manifests
939 checking files
955 checking files
940 checked 3 changesets with 3 changes to 3 files
956 checked 3 changesets with 3 changes to 3 files
941
957
942
958
943 Check you can't skip revlog clone during important format downgrade
959 Check you can't skip revlog clone during important format downgrade
944
960
945 $ echo "[format]" > .hg/hgrc
961 $ echo "[format]" > .hg/hgrc
946 $ echo "sparse-revlog=no" >> .hg/hgrc
962 $ echo "sparse-revlog=no" >> .hg/hgrc
947 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
963 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
948 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
964 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
949
965
950 ignoring revlogs selection flags, format requirements change: sparserevlog
966 ignoring revlogs selection flags, format requirements change: sparserevlog
951 requirements
967 requirements
952 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
968 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
953 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
969 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
954 removed: sparserevlog
970 removed: sparserevlog
955
971
956 optimisations: re-delta-parent
972 optimisations: re-delta-parent
957
973
958 processed revlogs:
974 processed revlogs:
959 - all-filelogs
975 - all-filelogs
960 - changelog
976 - changelog
961 - manifest
977 - manifest
962
978
963 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
979 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
980 note: selecting all-filelogs for processing to change: sparserevlog
981 note: selecting changelog for processing to change: sparserevlog
982
964 ignoring revlogs selection flags, format requirements change: sparserevlog
983 ignoring revlogs selection flags, format requirements change: sparserevlog
965 upgrade will perform the following actions:
984 upgrade will perform the following actions:
966
985
967 requirements
986 requirements
968 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
987 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
969 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
988 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
970 removed: sparserevlog
989 removed: sparserevlog
971
990
972 optimisations: re-delta-parent
991 optimisations: re-delta-parent
973
992
974 re-delta-parent
993 re-delta-parent
975 deltas within internal storage will choose a new base revision if needed
994 deltas within internal storage will choose a new base revision if needed
976
995
977 processed revlogs:
996 processed revlogs:
978 - all-filelogs
997 - all-filelogs
979 - changelog
998 - changelog
980 - manifest
999 - manifest
981
1000
982 beginning upgrade...
1001 beginning upgrade...
983 repository locked and read-only
1002 repository locked and read-only
984 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1003 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
985 (it is safe to interrupt this process any time before data migration completes)
1004 (it is safe to interrupt this process any time before data migration completes)
986 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1005 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
987 migrating 519 KB in store; 1.05 MB tracked data
1006 migrating 519 KB in store; 1.05 MB tracked data
988 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1007 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
989 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1008 cloning 1 revisions from data/FooBarDirectory.d/f1.i
990 cloning 1 revisions from data/f0.i
1009 cloning 1 revisions from data/f0.i
991 cloning 1 revisions from data/f2.i
1010 cloning 1 revisions from data/f2.i
992 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1011 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
993 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1012 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
994 cloning 3 revisions from 00manifest.i
1013 cloning 3 revisions from 00manifest.i
995 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1014 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
996 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1015 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
997 cloning 3 revisions from 00changelog.i
1016 cloning 3 revisions from 00changelog.i
998 finished migrating 3 changelog revisions; change in size: 0 bytes
1017 finished migrating 3 changelog revisions; change in size: 0 bytes
999 finished migrating 9 total revisions; total change in store size: 0 bytes
1018 finished migrating 9 total revisions; total change in store size: 0 bytes
1000 copying phaseroots
1019 copying phaseroots
1001 data fully upgraded in a temporary repository
1020 data fully upgraded in a temporary repository
1002 marking source repository as being upgraded; clients will be unable to read from repository
1021 marking source repository as being upgraded; clients will be unable to read from repository
1003 starting in-place swap of repository data
1022 starting in-place swap of repository data
1004 replacing store...
1023 replacing store...
1005 store replacement complete; repository was inconsistent for *s (glob)
1024 store replacement complete; repository was inconsistent for *s (glob)
1006 finalizing requirements file and making repository readable again
1025 finalizing requirements file and making repository readable again
1007 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1026 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1008 $ hg verify
1027 $ hg verify
1009 checking changesets
1028 checking changesets
1010 checking manifests
1029 checking manifests
1011 crosschecking files in changesets and manifests
1030 crosschecking files in changesets and manifests
1012 checking files
1031 checking files
1013 checked 3 changesets with 3 changes to 3 files
1032 checked 3 changesets with 3 changes to 3 files
1014
1033
1015 Check you can't skip revlog clone during important format upgrade
1034 Check you can't skip revlog clone during important format upgrade
1016
1035
1017 $ echo "sparse-revlog=yes" >> .hg/hgrc
1036 $ echo "sparse-revlog=yes" >> .hg/hgrc
1018 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1037 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1038 note: selecting all-filelogs for processing to change: sparserevlog
1039 note: selecting changelog for processing to change: sparserevlog
1040
1019 ignoring revlogs selection flags, format requirements change: sparserevlog
1041 ignoring revlogs selection flags, format requirements change: sparserevlog
1020 upgrade will perform the following actions:
1042 upgrade will perform the following actions:
1021
1043
1022 requirements
1044 requirements
1023 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1045 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1024 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1046 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1025 added: sparserevlog
1047 added: sparserevlog
1026
1048
1027 optimisations: re-delta-parent
1049 optimisations: re-delta-parent
1028
1050
1029 sparserevlog
1051 sparserevlog
1030 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.
1052 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.
1031
1053
1032 re-delta-parent
1054 re-delta-parent
1033 deltas within internal storage will choose a new base revision if needed
1055 deltas within internal storage will choose a new base revision if needed
1034
1056
1035 processed revlogs:
1057 processed revlogs:
1036 - all-filelogs
1058 - all-filelogs
1037 - changelog
1059 - changelog
1038 - manifest
1060 - manifest
1039
1061
1040 beginning upgrade...
1062 beginning upgrade...
1041 repository locked and read-only
1063 repository locked and read-only
1042 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1064 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1043 (it is safe to interrupt this process any time before data migration completes)
1065 (it is safe to interrupt this process any time before data migration completes)
1044 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1066 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1045 migrating 519 KB in store; 1.05 MB tracked data
1067 migrating 519 KB in store; 1.05 MB tracked data
1046 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1068 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1047 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1069 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1048 cloning 1 revisions from data/f0.i
1070 cloning 1 revisions from data/f0.i
1049 cloning 1 revisions from data/f2.i
1071 cloning 1 revisions from data/f2.i
1050 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1072 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1051 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1073 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1052 cloning 3 revisions from 00manifest.i
1074 cloning 3 revisions from 00manifest.i
1053 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1075 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1054 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1076 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1055 cloning 3 revisions from 00changelog.i
1077 cloning 3 revisions from 00changelog.i
1056 finished migrating 3 changelog revisions; change in size: 0 bytes
1078 finished migrating 3 changelog revisions; change in size: 0 bytes
1057 finished migrating 9 total revisions; total change in store size: 0 bytes
1079 finished migrating 9 total revisions; total change in store size: 0 bytes
1058 copying phaseroots
1080 copying phaseroots
1059 data fully upgraded in a temporary repository
1081 data fully upgraded in a temporary repository
1060 marking source repository as being upgraded; clients will be unable to read from repository
1082 marking source repository as being upgraded; clients will be unable to read from repository
1061 starting in-place swap of repository data
1083 starting in-place swap of repository data
1062 replacing store...
1084 replacing store...
1063 store replacement complete; repository was inconsistent for *s (glob)
1085 store replacement complete; repository was inconsistent for *s (glob)
1064 finalizing requirements file and making repository readable again
1086 finalizing requirements file and making repository readable again
1065 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1087 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1066 $ hg verify
1088 $ hg verify
1067 checking changesets
1089 checking changesets
1068 checking manifests
1090 checking manifests
1069 crosschecking files in changesets and manifests
1091 crosschecking files in changesets and manifests
1070 checking files
1092 checking files
1071 checked 3 changesets with 3 changes to 3 files
1093 checked 3 changesets with 3 changes to 3 files
1072
1094
1073 $ cd ..
1095 $ cd ..
1074
1096
1075 store files with special filenames aren't encoded during copy
1097 store files with special filenames aren't encoded during copy
1076
1098
1077 $ hg init store-filenames
1099 $ hg init store-filenames
1078 $ cd store-filenames
1100 $ cd store-filenames
1079 $ touch foo
1101 $ touch foo
1080 $ hg -q commit -A -m initial
1102 $ hg -q commit -A -m initial
1081 $ touch .hg/store/.XX_special_filename
1103 $ touch .hg/store/.XX_special_filename
1082
1104
1083 $ hg debugupgraderepo --run
1105 $ hg debugupgraderepo --run
1084 nothing to do
1106 nothing to do
1085 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1107 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1086 upgrade will perform the following actions:
1108 upgrade will perform the following actions:
1087
1109
1088 requirements
1110 requirements
1089 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1111 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1090 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1112 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1091
1113
1092 optimisations: re-delta-fulladd
1114 optimisations: re-delta-fulladd
1093
1115
1094 re-delta-fulladd
1116 re-delta-fulladd
1095 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
1117 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
1096
1118
1097 processed revlogs:
1119 processed revlogs:
1098 - all-filelogs
1120 - all-filelogs
1099 - changelog
1121 - changelog
1100 - manifest
1122 - manifest
1101
1123
1102 beginning upgrade...
1124 beginning upgrade...
1103 repository locked and read-only
1125 repository locked and read-only
1104 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1126 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1105 (it is safe to interrupt this process any time before data migration completes)
1127 (it is safe to interrupt this process any time before data migration completes)
1106 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1128 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1107 migrating 301 bytes in store; 107 bytes tracked data
1129 migrating 301 bytes in store; 107 bytes tracked data
1108 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1130 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1109 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1131 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1110 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1132 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1111 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1133 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1112 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1134 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1113 finished migrating 1 changelog revisions; change in size: 0 bytes
1135 finished migrating 1 changelog revisions; change in size: 0 bytes
1114 finished migrating 3 total revisions; total change in store size: 0 bytes
1136 finished migrating 3 total revisions; total change in store size: 0 bytes
1115 copying .XX_special_filename
1137 copying .XX_special_filename
1116 copying phaseroots
1138 copying phaseroots
1117 data fully upgraded in a temporary repository
1139 data fully upgraded in a temporary repository
1118 marking source repository as being upgraded; clients will be unable to read from repository
1140 marking source repository as being upgraded; clients will be unable to read from repository
1119 starting in-place swap of repository data
1141 starting in-place swap of repository data
1120 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1142 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1121 replacing store...
1143 replacing store...
1122 store replacement complete; repository was inconsistent for *s (glob)
1144 store replacement complete; repository was inconsistent for *s (glob)
1123 finalizing requirements file and making repository readable again
1145 finalizing requirements file and making repository readable again
1124 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1146 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1125 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1147 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1126 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1148 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1127
1149
1128 fncache is valid after upgrade
1150 fncache is valid after upgrade
1129
1151
1130 $ hg debugrebuildfncache
1152 $ hg debugrebuildfncache
1131 fncache already up to date
1153 fncache already up to date
1132
1154
1133 $ cd ..
1155 $ cd ..
1134
1156
1135 Check upgrading a large file repository
1157 Check upgrading a large file repository
1136 ---------------------------------------
1158 ---------------------------------------
1137
1159
1138 $ hg init largefilesrepo
1160 $ hg init largefilesrepo
1139 $ cat << EOF >> largefilesrepo/.hg/hgrc
1161 $ cat << EOF >> largefilesrepo/.hg/hgrc
1140 > [extensions]
1162 > [extensions]
1141 > largefiles =
1163 > largefiles =
1142 > EOF
1164 > EOF
1143
1165
1144 $ cd largefilesrepo
1166 $ cd largefilesrepo
1145 $ touch foo
1167 $ touch foo
1146 $ hg add --large foo
1168 $ hg add --large foo
1147 $ hg -q commit -m initial
1169 $ hg -q commit -m initial
1148 $ cat .hg/requires
1170 $ cat .hg/requires
1149 dotencode
1171 dotencode
1150 fncache
1172 fncache
1151 generaldelta
1173 generaldelta
1152 largefiles
1174 largefiles
1153 persistent-nodemap (rust !)
1175 persistent-nodemap (rust !)
1154 revlogv1
1176 revlogv1
1155 sparserevlog
1177 sparserevlog
1156 store
1178 store
1157
1179
1158 $ hg debugupgraderepo --run
1180 $ hg debugupgraderepo --run
1159 nothing to do
1181 nothing to do
1160 $ cat .hg/requires
1182 $ cat .hg/requires
1161 dotencode
1183 dotencode
1162 fncache
1184 fncache
1163 generaldelta
1185 generaldelta
1164 largefiles
1186 largefiles
1165 persistent-nodemap (rust !)
1187 persistent-nodemap (rust !)
1166 revlogv1
1188 revlogv1
1167 sparserevlog
1189 sparserevlog
1168 store
1190 store
1169
1191
1170 $ cat << EOF >> .hg/hgrc
1192 $ cat << EOF >> .hg/hgrc
1171 > [extensions]
1193 > [extensions]
1172 > lfs =
1194 > lfs =
1173 > [lfs]
1195 > [lfs]
1174 > threshold = 10
1196 > threshold = 10
1175 > EOF
1197 > EOF
1176 $ echo '123456789012345' > lfs.bin
1198 $ echo '123456789012345' > lfs.bin
1177 $ hg ci -Am 'lfs.bin'
1199 $ hg ci -Am 'lfs.bin'
1178 adding lfs.bin
1200 adding lfs.bin
1179 $ grep lfs .hg/requires
1201 $ grep lfs .hg/requires
1180 lfs
1202 lfs
1181 $ find .hg/store/lfs -type f
1203 $ find .hg/store/lfs -type f
1182 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1204 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1183
1205
1184 $ hg debugupgraderepo --run
1206 $ hg debugupgraderepo --run
1185 nothing to do
1207 nothing to do
1186
1208
1187 $ grep lfs .hg/requires
1209 $ grep lfs .hg/requires
1188 lfs
1210 lfs
1189 $ find .hg/store/lfs -type f
1211 $ find .hg/store/lfs -type f
1190 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1212 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1191 $ hg verify
1213 $ hg verify
1192 checking changesets
1214 checking changesets
1193 checking manifests
1215 checking manifests
1194 crosschecking files in changesets and manifests
1216 crosschecking files in changesets and manifests
1195 checking files
1217 checking files
1196 checked 2 changesets with 2 changes to 2 files
1218 checked 2 changesets with 2 changes to 2 files
1197 $ hg debugdata lfs.bin 0
1219 $ hg debugdata lfs.bin 0
1198 version https://git-lfs.github.com/spec/v1
1220 version https://git-lfs.github.com/spec/v1
1199 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1221 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1200 size 16
1222 size 16
1201 x-is-binary 0
1223 x-is-binary 0
1202
1224
1203 $ cd ..
1225 $ cd ..
1204
1226
1205 repository config is taken in account
1227 repository config is taken in account
1206 -------------------------------------
1228 -------------------------------------
1207
1229
1208 $ cat << EOF >> $HGRCPATH
1230 $ cat << EOF >> $HGRCPATH
1209 > [format]
1231 > [format]
1210 > maxchainlen = 1
1232 > maxchainlen = 1
1211 > EOF
1233 > EOF
1212
1234
1213 $ hg init localconfig
1235 $ hg init localconfig
1214 $ cd localconfig
1236 $ cd localconfig
1215 $ cat << EOF > file
1237 $ cat << EOF > file
1216 > some content
1238 > some content
1217 > with some length
1239 > with some length
1218 > to make sure we get a delta
1240 > to make sure we get a delta
1219 > after changes
1241 > after changes
1220 > very long
1242 > very long
1221 > very long
1243 > very long
1222 > very long
1244 > very long
1223 > very long
1245 > very long
1224 > very long
1246 > very long
1225 > very long
1247 > very long
1226 > very long
1248 > very long
1227 > very long
1249 > very long
1228 > very long
1250 > very long
1229 > very long
1251 > very long
1230 > very long
1252 > very long
1231 > EOF
1253 > EOF
1232 $ hg -q commit -A -m A
1254 $ hg -q commit -A -m A
1233 $ echo "new line" >> file
1255 $ echo "new line" >> file
1234 $ hg -q commit -m B
1256 $ hg -q commit -m B
1235 $ echo "new line" >> file
1257 $ echo "new line" >> file
1236 $ hg -q commit -m C
1258 $ hg -q commit -m C
1237
1259
1238 $ cat << EOF >> .hg/hgrc
1260 $ cat << EOF >> .hg/hgrc
1239 > [format]
1261 > [format]
1240 > maxchainlen = 9001
1262 > maxchainlen = 9001
1241 > EOF
1263 > EOF
1242 $ hg config format
1264 $ hg config format
1243 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1265 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1244 format.maxchainlen=9001
1266 format.maxchainlen=9001
1245 $ hg debugdeltachain file
1267 $ hg debugdeltachain file
1246 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1268 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1247 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1269 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1248 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1270 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1249 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1271 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1250
1272
1251 $ hg debugupgraderepo --run --optimize 're-delta-all'
1273 $ hg debugupgraderepo --run --optimize 're-delta-all'
1252 upgrade will perform the following actions:
1274 upgrade will perform the following actions:
1253
1275
1254 requirements
1276 requirements
1255 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1277 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1256 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1278 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1257
1279
1258 optimisations: re-delta-all
1280 optimisations: re-delta-all
1259
1281
1260 re-delta-all
1282 re-delta-all
1261 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1283 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1262
1284
1263 processed revlogs:
1285 processed revlogs:
1264 - all-filelogs
1286 - all-filelogs
1265 - changelog
1287 - changelog
1266 - manifest
1288 - manifest
1267
1289
1268 beginning upgrade...
1290 beginning upgrade...
1269 repository locked and read-only
1291 repository locked and read-only
1270 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1292 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1271 (it is safe to interrupt this process any time before data migration completes)
1293 (it is safe to interrupt this process any time before data migration completes)
1272 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1294 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1273 migrating 1019 bytes in store; 882 bytes tracked data
1295 migrating 1019 bytes in store; 882 bytes tracked data
1274 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1296 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1275 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1297 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1276 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1298 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1277 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1299 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1278 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1300 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1279 finished migrating 3 changelog revisions; change in size: 0 bytes
1301 finished migrating 3 changelog revisions; change in size: 0 bytes
1280 finished migrating 9 total revisions; total change in store size: -9 bytes
1302 finished migrating 9 total revisions; total change in store size: -9 bytes
1281 copying phaseroots
1303 copying phaseroots
1282 data fully upgraded in a temporary repository
1304 data fully upgraded in a temporary repository
1283 marking source repository as being upgraded; clients will be unable to read from repository
1305 marking source repository as being upgraded; clients will be unable to read from repository
1284 starting in-place swap of repository data
1306 starting in-place swap of repository data
1285 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1307 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1286 replacing store...
1308 replacing store...
1287 store replacement complete; repository was inconsistent for *s (glob)
1309 store replacement complete; repository was inconsistent for *s (glob)
1288 finalizing requirements file and making repository readable again
1310 finalizing requirements file and making repository readable again
1289 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1311 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1290 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1312 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1291 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1313 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1292 $ hg debugdeltachain file
1314 $ hg debugdeltachain file
1293 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1315 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1294 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1316 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1295 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1317 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1296 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1318 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1297 $ cd ..
1319 $ cd ..
1298
1320
1299 $ cat << EOF >> $HGRCPATH
1321 $ cat << EOF >> $HGRCPATH
1300 > [format]
1322 > [format]
1301 > maxchainlen = 9001
1323 > maxchainlen = 9001
1302 > EOF
1324 > EOF
1303
1325
1304 Check upgrading a sparse-revlog repository
1326 Check upgrading a sparse-revlog repository
1305 ---------------------------------------
1327 ---------------------------------------
1306
1328
1307 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1329 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1308 $ cd sparserevlogrepo
1330 $ cd sparserevlogrepo
1309 $ touch foo
1331 $ touch foo
1310 $ hg add foo
1332 $ hg add foo
1311 $ hg -q commit -m "foo"
1333 $ hg -q commit -m "foo"
1312 $ cat .hg/requires
1334 $ cat .hg/requires
1313 dotencode
1335 dotencode
1314 fncache
1336 fncache
1315 generaldelta
1337 generaldelta
1316 persistent-nodemap (rust !)
1338 persistent-nodemap (rust !)
1317 revlogv1
1339 revlogv1
1318 store
1340 store
1319
1341
1320 Check that we can add the sparse-revlog format requirement
1342 Check that we can add the sparse-revlog format requirement
1321 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1343 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1322 upgrade will perform the following actions:
1344 upgrade will perform the following actions:
1323
1345
1324 requirements
1346 requirements
1325 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1347 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1326 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1348 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1327 added: sparserevlog
1349 added: sparserevlog
1328
1350
1329 processed revlogs:
1351 processed revlogs:
1330 - all-filelogs
1352 - all-filelogs
1331 - changelog
1353 - changelog
1332 - manifest
1354 - manifest
1333
1355
1334 $ cat .hg/requires
1356 $ cat .hg/requires
1335 dotencode
1357 dotencode
1336 fncache
1358 fncache
1337 generaldelta
1359 generaldelta
1338 persistent-nodemap (rust !)
1360 persistent-nodemap (rust !)
1339 revlogv1
1361 revlogv1
1340 sparserevlog
1362 sparserevlog
1341 store
1363 store
1342
1364
1343 Check that we can remove the sparse-revlog format requirement
1365 Check that we can remove the sparse-revlog format requirement
1344 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1366 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1345 upgrade will perform the following actions:
1367 upgrade will perform the following actions:
1346
1368
1347 requirements
1369 requirements
1348 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1370 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1349 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1371 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1350 removed: sparserevlog
1372 removed: sparserevlog
1351
1373
1352 processed revlogs:
1374 processed revlogs:
1353 - all-filelogs
1375 - all-filelogs
1354 - changelog
1376 - changelog
1355 - manifest
1377 - manifest
1356
1378
1357 $ cat .hg/requires
1379 $ cat .hg/requires
1358 dotencode
1380 dotencode
1359 fncache
1381 fncache
1360 generaldelta
1382 generaldelta
1361 persistent-nodemap (rust !)
1383 persistent-nodemap (rust !)
1362 revlogv1
1384 revlogv1
1363 store
1385 store
1364
1386
1365 #if zstd
1387 #if zstd
1366
1388
1367 Check upgrading to a zstd revlog
1389 Check upgrading to a zstd revlog
1368 --------------------------------
1390 --------------------------------
1369
1391
1370 upgrade
1392 upgrade
1371
1393
1372 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1394 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1373 upgrade will perform the following actions:
1395 upgrade will perform the following actions:
1374
1396
1375 requirements
1397 requirements
1376 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1398 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1377 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1399 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1378 added: revlog-compression-zstd, sparserevlog
1400 added: revlog-compression-zstd, sparserevlog
1379
1401
1380 processed revlogs:
1402 processed revlogs:
1381 - all-filelogs
1403 - all-filelogs
1382 - changelog
1404 - changelog
1383 - manifest
1405 - manifest
1384
1406
1385 $ hg debugformat -v
1407 $ hg debugformat -v
1386 format-variant repo config default
1408 format-variant repo config default
1387 fncache: yes yes yes
1409 fncache: yes yes yes
1388 dirstate-v2: no no no
1410 dirstate-v2: no no no
1389 dotencode: yes yes yes
1411 dotencode: yes yes yes
1390 generaldelta: yes yes yes
1412 generaldelta: yes yes yes
1391 share-safe: no no no
1413 share-safe: no no no
1392 sparserevlog: yes yes yes
1414 sparserevlog: yes yes yes
1393 persistent-nodemap: no no no (no-rust !)
1415 persistent-nodemap: no no no (no-rust !)
1394 persistent-nodemap: yes yes no (rust !)
1416 persistent-nodemap: yes yes no (rust !)
1395 copies-sdc: no no no
1417 copies-sdc: no no no
1396 revlog-v2: no no no
1418 revlog-v2: no no no
1397 changelog-v2: no no no
1419 changelog-v2: no no no
1398 plain-cl-delta: yes yes yes
1420 plain-cl-delta: yes yes yes
1399 compression: zlib zlib zlib (no-zstd !)
1421 compression: zlib zlib zlib (no-zstd !)
1400 compression: zstd zlib zstd (zstd !)
1422 compression: zstd zlib zstd (zstd !)
1401 compression-level: default default default
1423 compression-level: default default default
1402 $ cat .hg/requires
1424 $ cat .hg/requires
1403 dotencode
1425 dotencode
1404 fncache
1426 fncache
1405 generaldelta
1427 generaldelta
1406 persistent-nodemap (rust !)
1428 persistent-nodemap (rust !)
1407 revlog-compression-zstd
1429 revlog-compression-zstd
1408 revlogv1
1430 revlogv1
1409 sparserevlog
1431 sparserevlog
1410 store
1432 store
1411
1433
1412 downgrade
1434 downgrade
1413
1435
1414 $ hg debugupgraderepo --run --no-backup --quiet
1436 $ hg debugupgraderepo --run --no-backup --quiet
1415 upgrade will perform the following actions:
1437 upgrade will perform the following actions:
1416
1438
1417 requirements
1439 requirements
1418 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1440 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1419 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1441 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1420 removed: revlog-compression-zstd
1442 removed: revlog-compression-zstd
1421
1443
1422 processed revlogs:
1444 processed revlogs:
1423 - all-filelogs
1445 - all-filelogs
1424 - changelog
1446 - changelog
1425 - manifest
1447 - manifest
1426
1448
1427 $ hg debugformat -v
1449 $ hg debugformat -v
1428 format-variant repo config default
1450 format-variant repo config default
1429 fncache: yes yes yes
1451 fncache: yes yes yes
1430 dirstate-v2: no no no
1452 dirstate-v2: no no no
1431 dotencode: yes yes yes
1453 dotencode: yes yes yes
1432 generaldelta: yes yes yes
1454 generaldelta: yes yes yes
1433 share-safe: no no no
1455 share-safe: no no no
1434 sparserevlog: yes yes yes
1456 sparserevlog: yes yes yes
1435 persistent-nodemap: no no no (no-rust !)
1457 persistent-nodemap: no no no (no-rust !)
1436 persistent-nodemap: yes yes no (rust !)
1458 persistent-nodemap: yes yes no (rust !)
1437 copies-sdc: no no no
1459 copies-sdc: no no no
1438 revlog-v2: no no no
1460 revlog-v2: no no no
1439 changelog-v2: no no no
1461 changelog-v2: no no no
1440 plain-cl-delta: yes yes yes
1462 plain-cl-delta: yes yes yes
1441 compression: zlib zlib zlib (no-zstd !)
1463 compression: zlib zlib zlib (no-zstd !)
1442 compression: zlib zlib zstd (zstd !)
1464 compression: zlib zlib zstd (zstd !)
1443 compression-level: default default default
1465 compression-level: default default default
1444 $ cat .hg/requires
1466 $ cat .hg/requires
1445 dotencode
1467 dotencode
1446 fncache
1468 fncache
1447 generaldelta
1469 generaldelta
1448 persistent-nodemap (rust !)
1470 persistent-nodemap (rust !)
1449 revlogv1
1471 revlogv1
1450 sparserevlog
1472 sparserevlog
1451 store
1473 store
1452
1474
1453 upgrade from hgrc
1475 upgrade from hgrc
1454
1476
1455 $ cat >> .hg/hgrc << EOF
1477 $ cat >> .hg/hgrc << EOF
1456 > [format]
1478 > [format]
1457 > revlog-compression=zstd
1479 > revlog-compression=zstd
1458 > EOF
1480 > EOF
1459 $ hg debugupgraderepo --run --no-backup --quiet
1481 $ hg debugupgraderepo --run --no-backup --quiet
1460 upgrade will perform the following actions:
1482 upgrade will perform the following actions:
1461
1483
1462 requirements
1484 requirements
1463 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1485 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1464 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1486 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1465 added: revlog-compression-zstd
1487 added: revlog-compression-zstd
1466
1488
1467 processed revlogs:
1489 processed revlogs:
1468 - all-filelogs
1490 - all-filelogs
1469 - changelog
1491 - changelog
1470 - manifest
1492 - manifest
1471
1493
1472 $ hg debugformat -v
1494 $ hg debugformat -v
1473 format-variant repo config default
1495 format-variant repo config default
1474 fncache: yes yes yes
1496 fncache: yes yes yes
1475 dirstate-v2: no no no
1497 dirstate-v2: no no no
1476 dotencode: yes yes yes
1498 dotencode: yes yes yes
1477 generaldelta: yes yes yes
1499 generaldelta: yes yes yes
1478 share-safe: no no no
1500 share-safe: no no no
1479 sparserevlog: yes yes yes
1501 sparserevlog: yes yes yes
1480 persistent-nodemap: no no no (no-rust !)
1502 persistent-nodemap: no no no (no-rust !)
1481 persistent-nodemap: yes yes no (rust !)
1503 persistent-nodemap: yes yes no (rust !)
1482 copies-sdc: no no no
1504 copies-sdc: no no no
1483 revlog-v2: no no no
1505 revlog-v2: no no no
1484 changelog-v2: no no no
1506 changelog-v2: no no no
1485 plain-cl-delta: yes yes yes
1507 plain-cl-delta: yes yes yes
1486 compression: zlib zlib zlib (no-zstd !)
1508 compression: zlib zlib zlib (no-zstd !)
1487 compression: zstd zstd zstd (zstd !)
1509 compression: zstd zstd zstd (zstd !)
1488 compression-level: default default default
1510 compression-level: default default default
1489 $ cat .hg/requires
1511 $ cat .hg/requires
1490 dotencode
1512 dotencode
1491 fncache
1513 fncache
1492 generaldelta
1514 generaldelta
1493 persistent-nodemap (rust !)
1515 persistent-nodemap (rust !)
1494 revlog-compression-zstd
1516 revlog-compression-zstd
1495 revlogv1
1517 revlogv1
1496 sparserevlog
1518 sparserevlog
1497 store
1519 store
1498
1520
1499 #endif
1521 #endif
1500
1522
1501 Check upgrading to a revlog format supporting sidedata
1523 Check upgrading to a revlog format supporting sidedata
1502 ------------------------------------------------------
1524 ------------------------------------------------------
1503
1525
1504 upgrade
1526 upgrade
1505
1527
1506 $ hg debugsidedata -c 0
1528 $ hg debugsidedata -c 0
1507 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1529 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1508 upgrade will perform the following actions:
1530 upgrade will perform the following actions:
1509
1531
1510 requirements
1532 requirements
1511 preserved: dotencode, fncache, generaldelta, store (no-zstd !)
1533 preserved: dotencode, fncache, generaldelta, store (no-zstd !)
1512 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1534 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1513 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1535 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1514 removed: revlogv1
1536 removed: revlogv1
1515 added: exp-revlogv2.2 (zstd !)
1537 added: exp-revlogv2.2 (zstd !)
1516 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1538 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1517
1539
1518 processed revlogs:
1540 processed revlogs:
1519 - all-filelogs
1541 - all-filelogs
1520 - changelog
1542 - changelog
1521 - manifest
1543 - manifest
1522
1544
1523 $ hg debugformat -v
1545 $ hg debugformat -v
1524 format-variant repo config default
1546 format-variant repo config default
1525 fncache: yes yes yes
1547 fncache: yes yes yes
1526 dirstate-v2: no no no
1548 dirstate-v2: no no no
1527 dotencode: yes yes yes
1549 dotencode: yes yes yes
1528 generaldelta: yes yes yes
1550 generaldelta: yes yes yes
1529 share-safe: no no no
1551 share-safe: no no no
1530 sparserevlog: yes yes yes
1552 sparserevlog: yes yes yes
1531 persistent-nodemap: no no no (no-rust !)
1553 persistent-nodemap: no no no (no-rust !)
1532 persistent-nodemap: yes yes no (rust !)
1554 persistent-nodemap: yes yes no (rust !)
1533 copies-sdc: no no no
1555 copies-sdc: no no no
1534 revlog-v2: yes no no
1556 revlog-v2: yes no no
1535 changelog-v2: no no no
1557 changelog-v2: no no no
1536 plain-cl-delta: yes yes yes
1558 plain-cl-delta: yes yes yes
1537 compression: zlib zlib zlib (no-zstd !)
1559 compression: zlib zlib zlib (no-zstd !)
1538 compression: zstd zstd zstd (zstd !)
1560 compression: zstd zstd zstd (zstd !)
1539 compression-level: default default default
1561 compression-level: default default default
1540 $ cat .hg/requires
1562 $ cat .hg/requires
1541 dotencode
1563 dotencode
1542 exp-revlogv2.2
1564 exp-revlogv2.2
1543 fncache
1565 fncache
1544 generaldelta
1566 generaldelta
1545 persistent-nodemap (rust !)
1567 persistent-nodemap (rust !)
1546 revlog-compression-zstd (zstd !)
1568 revlog-compression-zstd (zstd !)
1547 sparserevlog
1569 sparserevlog
1548 store
1570 store
1549 $ hg debugsidedata -c 0
1571 $ hg debugsidedata -c 0
1550 2 sidedata entries
1572 2 sidedata entries
1551 entry-0001 size 4
1573 entry-0001 size 4
1552 entry-0002 size 32
1574 entry-0002 size 32
1553
1575
1554 downgrade
1576 downgrade
1555
1577
1556 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1578 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1557 upgrade will perform the following actions:
1579 upgrade will perform the following actions:
1558
1580
1559 requirements
1581 requirements
1560 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1582 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1561 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1583 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1562 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1584 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1563 removed: exp-revlogv2.2
1585 removed: exp-revlogv2.2
1564 added: revlogv1
1586 added: revlogv1
1565
1587
1566 processed revlogs:
1588 processed revlogs:
1567 - all-filelogs
1589 - all-filelogs
1568 - changelog
1590 - changelog
1569 - manifest
1591 - manifest
1570
1592
1571 $ hg debugformat -v
1593 $ hg debugformat -v
1572 format-variant repo config default
1594 format-variant repo config default
1573 fncache: yes yes yes
1595 fncache: yes yes yes
1574 dirstate-v2: no no no
1596 dirstate-v2: no no no
1575 dotencode: yes yes yes
1597 dotencode: yes yes yes
1576 generaldelta: yes yes yes
1598 generaldelta: yes yes yes
1577 share-safe: no no no
1599 share-safe: no no no
1578 sparserevlog: yes yes yes
1600 sparserevlog: yes yes yes
1579 persistent-nodemap: no no no (no-rust !)
1601 persistent-nodemap: no no no (no-rust !)
1580 persistent-nodemap: yes yes no (rust !)
1602 persistent-nodemap: yes yes no (rust !)
1581 copies-sdc: no no no
1603 copies-sdc: no no no
1582 revlog-v2: no no no
1604 revlog-v2: no no no
1583 changelog-v2: no no no
1605 changelog-v2: no no no
1584 plain-cl-delta: yes yes yes
1606 plain-cl-delta: yes yes yes
1585 compression: zlib zlib zlib (no-zstd !)
1607 compression: zlib zlib zlib (no-zstd !)
1586 compression: zstd zstd zstd (zstd !)
1608 compression: zstd zstd zstd (zstd !)
1587 compression-level: default default default
1609 compression-level: default default default
1588 $ cat .hg/requires
1610 $ cat .hg/requires
1589 dotencode
1611 dotencode
1590 fncache
1612 fncache
1591 generaldelta
1613 generaldelta
1592 persistent-nodemap (rust !)
1614 persistent-nodemap (rust !)
1593 revlog-compression-zstd (zstd !)
1615 revlog-compression-zstd (zstd !)
1594 revlogv1
1616 revlogv1
1595 sparserevlog
1617 sparserevlog
1596 store
1618 store
1597 $ hg debugsidedata -c 0
1619 $ hg debugsidedata -c 0
1598
1620
1599 upgrade from hgrc
1621 upgrade from hgrc
1600
1622
1601 $ cat >> .hg/hgrc << EOF
1623 $ cat >> .hg/hgrc << EOF
1602 > [experimental]
1624 > [experimental]
1603 > revlogv2=enable-unstable-format-and-corrupt-my-data
1625 > revlogv2=enable-unstable-format-and-corrupt-my-data
1604 > EOF
1626 > EOF
1605 $ hg debugupgraderepo --run --no-backup --quiet
1627 $ hg debugupgraderepo --run --no-backup --quiet
1606 upgrade will perform the following actions:
1628 upgrade will perform the following actions:
1607
1629
1608 requirements
1630 requirements
1609 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1631 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1610 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1632 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1611 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1633 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1612 removed: revlogv1
1634 removed: revlogv1
1613 added: exp-revlogv2.2
1635 added: exp-revlogv2.2
1614
1636
1615 processed revlogs:
1637 processed revlogs:
1616 - all-filelogs
1638 - all-filelogs
1617 - changelog
1639 - changelog
1618 - manifest
1640 - manifest
1619
1641
1620 $ hg debugformat -v
1642 $ hg debugformat -v
1621 format-variant repo config default
1643 format-variant repo config default
1622 fncache: yes yes yes
1644 fncache: yes yes yes
1623 dirstate-v2: no no no
1645 dirstate-v2: no no no
1624 dotencode: yes yes yes
1646 dotencode: yes yes yes
1625 generaldelta: yes yes yes
1647 generaldelta: yes yes yes
1626 share-safe: no no no
1648 share-safe: no no no
1627 sparserevlog: yes yes yes
1649 sparserevlog: yes yes yes
1628 persistent-nodemap: no no no (no-rust !)
1650 persistent-nodemap: no no no (no-rust !)
1629 persistent-nodemap: yes yes no (rust !)
1651 persistent-nodemap: yes yes no (rust !)
1630 copies-sdc: no no no
1652 copies-sdc: no no no
1631 revlog-v2: yes yes no
1653 revlog-v2: yes yes no
1632 changelog-v2: no no no
1654 changelog-v2: no no no
1633 plain-cl-delta: yes yes yes
1655 plain-cl-delta: yes yes yes
1634 compression: zlib zlib zlib (no-zstd !)
1656 compression: zlib zlib zlib (no-zstd !)
1635 compression: zstd zstd zstd (zstd !)
1657 compression: zstd zstd zstd (zstd !)
1636 compression-level: default default default
1658 compression-level: default default default
1637 $ cat .hg/requires
1659 $ cat .hg/requires
1638 dotencode
1660 dotencode
1639 exp-revlogv2.2
1661 exp-revlogv2.2
1640 fncache
1662 fncache
1641 generaldelta
1663 generaldelta
1642 persistent-nodemap (rust !)
1664 persistent-nodemap (rust !)
1643 revlog-compression-zstd (zstd !)
1665 revlog-compression-zstd (zstd !)
1644 sparserevlog
1666 sparserevlog
1645 store
1667 store
1646 $ hg debugsidedata -c 0
1668 $ hg debugsidedata -c 0
1647
1669
1648 Demonstrate that nothing to perform upgrade will still run all the way through
1670 Demonstrate that nothing to perform upgrade will still run all the way through
1649
1671
1650 $ hg debugupgraderepo --run
1672 $ hg debugupgraderepo --run
1651 nothing to do
1673 nothing to do
1652
1674
1653 #if no-rust
1675 #if no-rust
1654
1676
1655 $ cat << EOF >> $HGRCPATH
1677 $ cat << EOF >> $HGRCPATH
1656 > [storage]
1678 > [storage]
1657 > dirstate-v2.slow-path = allow
1679 > dirstate-v2.slow-path = allow
1658 > EOF
1680 > EOF
1659
1681
1660 #endif
1682 #endif
1661
1683
1662 Upgrade to dirstate-v2
1684 Upgrade to dirstate-v2
1663
1685
1664 $ hg debugformat -v --config format.exp-rc-dirstate-v2=1 | grep dirstate-v2
1686 $ hg debugformat -v --config format.exp-rc-dirstate-v2=1 | grep dirstate-v2
1665 dirstate-v2: no yes no
1687 dirstate-v2: no yes no
1666 $ hg debugupgraderepo --config format.exp-rc-dirstate-v2=1 --run
1688 $ hg debugupgraderepo --config format.exp-rc-dirstate-v2=1 --run
1667 upgrade will perform the following actions:
1689 upgrade will perform the following actions:
1668
1690
1669 requirements
1691 requirements
1670 preserved: * (glob)
1692 preserved: * (glob)
1671 added: dirstate-v2
1693 added: dirstate-v2
1672
1694
1673 dirstate-v2
1695 dirstate-v2
1674 "hg status" will be faster
1696 "hg status" will be faster
1675
1697
1676 processed revlogs:
1698 processed revlogs:
1677 - all-filelogs
1699 - all-filelogs
1678 - changelog
1700 - changelog
1679 - manifest
1701 - manifest
1680
1702
1681 beginning upgrade...
1703 beginning upgrade...
1682 repository locked and read-only
1704 repository locked and read-only
1683 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1705 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1684 (it is safe to interrupt this process any time before data migration completes)
1706 (it is safe to interrupt this process any time before data migration completes)
1685 upgrading to dirstate-v2 from v1
1707 upgrading to dirstate-v2 from v1
1686 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1708 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1687 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1709 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1688 $ ls .hg/upgradebackup.*/dirstate
1710 $ ls .hg/upgradebackup.*/dirstate
1689 .hg/upgradebackup.*/dirstate (glob)
1711 .hg/upgradebackup.*/dirstate (glob)
1690 $ hg debugformat -v | grep dirstate-v2
1712 $ hg debugformat -v | grep dirstate-v2
1691 dirstate-v2: yes no no
1713 dirstate-v2: yes no no
1692 $ hg status
1714 $ hg status
1693 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1715 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1694 dirstate-v2
1716 dirstate-v2
1695
1717
1696 Downgrade from dirstate-v2
1718 Downgrade from dirstate-v2
1697
1719
1698 $ hg debugupgraderepo --run
1720 $ hg debugupgraderepo --run
1699 upgrade will perform the following actions:
1721 upgrade will perform the following actions:
1700
1722
1701 requirements
1723 requirements
1702 preserved: * (glob)
1724 preserved: * (glob)
1703 removed: dirstate-v2
1725 removed: dirstate-v2
1704
1726
1705 processed revlogs:
1727 processed revlogs:
1706 - all-filelogs
1728 - all-filelogs
1707 - changelog
1729 - changelog
1708 - manifest
1730 - manifest
1709
1731
1710 beginning upgrade...
1732 beginning upgrade...
1711 repository locked and read-only
1733 repository locked and read-only
1712 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1734 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1713 (it is safe to interrupt this process any time before data migration completes)
1735 (it is safe to interrupt this process any time before data migration completes)
1714 downgrading from dirstate-v2 to v1
1736 downgrading from dirstate-v2 to v1
1715 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1737 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1716 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1738 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1717 $ hg debugformat -v | grep dirstate-v2
1739 $ hg debugformat -v | grep dirstate-v2
1718 dirstate-v2: no no no
1740 dirstate-v2: no no no
1719 $ hg status
1741 $ hg status
1720
1742
1721 $ cd ..
1743 $ cd ..
1722
1744
1723 dirstate-v2: upgrade and downgrade from and empty repository:
1745 dirstate-v2: upgrade and downgrade from and empty repository:
1724 -------------------------------------------------------------
1746 -------------------------------------------------------------
1725
1747
1726 $ hg init --config format.exp-rc-dirstate-v2=no dirstate-v2-empty
1748 $ hg init --config format.exp-rc-dirstate-v2=no dirstate-v2-empty
1727 $ cd dirstate-v2-empty
1749 $ cd dirstate-v2-empty
1728 $ hg debugformat | grep dirstate-v2
1750 $ hg debugformat | grep dirstate-v2
1729 dirstate-v2: no
1751 dirstate-v2: no
1730
1752
1731 upgrade
1753 upgrade
1732
1754
1733 $ hg debugupgraderepo --run --config format.exp-rc-dirstate-v2=yes
1755 $ hg debugupgraderepo --run --config format.exp-rc-dirstate-v2=yes
1734 upgrade will perform the following actions:
1756 upgrade will perform the following actions:
1735
1757
1736 requirements
1758 requirements
1737 preserved: * (glob)
1759 preserved: * (glob)
1738 added: dirstate-v2
1760 added: dirstate-v2
1739
1761
1740 dirstate-v2
1762 dirstate-v2
1741 "hg status" will be faster
1763 "hg status" will be faster
1742
1764
1743 processed revlogs:
1765 processed revlogs:
1744 - all-filelogs
1766 - all-filelogs
1745 - changelog
1767 - changelog
1746 - manifest
1768 - manifest
1747
1769
1748 beginning upgrade...
1770 beginning upgrade...
1749 repository locked and read-only
1771 repository locked and read-only
1750 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1772 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1751 (it is safe to interrupt this process any time before data migration completes)
1773 (it is safe to interrupt this process any time before data migration completes)
1752 upgrading to dirstate-v2 from v1
1774 upgrading to dirstate-v2 from v1
1753 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1775 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1754 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1776 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1755 $ hg debugformat | grep dirstate-v2
1777 $ hg debugformat | grep dirstate-v2
1756 dirstate-v2: yes
1778 dirstate-v2: yes
1757
1779
1758 downgrade
1780 downgrade
1759
1781
1760 $ hg debugupgraderepo --run --config format.exp-rc-dirstate-v2=no
1782 $ hg debugupgraderepo --run --config format.exp-rc-dirstate-v2=no
1761 upgrade will perform the following actions:
1783 upgrade will perform the following actions:
1762
1784
1763 requirements
1785 requirements
1764 preserved: * (glob)
1786 preserved: * (glob)
1765 removed: dirstate-v2
1787 removed: dirstate-v2
1766
1788
1767 processed revlogs:
1789 processed revlogs:
1768 - all-filelogs
1790 - all-filelogs
1769 - changelog
1791 - changelog
1770 - manifest
1792 - manifest
1771
1793
1772 beginning upgrade...
1794 beginning upgrade...
1773 repository locked and read-only
1795 repository locked and read-only
1774 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1796 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1775 (it is safe to interrupt this process any time before data migration completes)
1797 (it is safe to interrupt this process any time before data migration completes)
1776 downgrading from dirstate-v2 to v1
1798 downgrading from dirstate-v2 to v1
1777 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1799 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1778 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1800 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1779 $ hg debugformat | grep dirstate-v2
1801 $ hg debugformat | grep dirstate-v2
1780 dirstate-v2: no
1802 dirstate-v2: no
1781
1803
1782 $ cd ..
1804 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now