Skip to content
Snippets Groups Projects
Commit 8405c1bffacf authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

upgrade: issue a message when a revlog type has to be upgraded

This is more explicite and prepare for a smoother transition to smarter picking
of the revlog we will process.

Differential Revision: https://phab.mercurial-scm.org/D11870
parent 1d0978cfe968
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,8 @@
touched_revlogs = set()
overwrite_msg = _(b'warning: ignoring %14s, as upgrade is changing: %s\n')
msg_issued = False
select_msg = _(b'note: selecting %s for processing to change: %s\n')
msg_issued = 0
FL = upgrade_engine.UPGRADE_FILELOGS
MN = upgrade_engine.UPGRADE_MANIFEST
......@@ -108,5 +109,10 @@
if not specified_revlogs[FL]:
msg = overwrite_msg % (b'--no-filelogs', action.name)
ui.warn(msg)
msg_issued = True
msg_issued = 2
else:
msg = select_msg % (b'all-filelogs', action.name)
ui.status(msg)
if not ui.quiet:
msg_issued = 1
touched_revlogs.add(FL)
......@@ -112,6 +118,7 @@
touched_revlogs.add(FL)
if action.touches_manifests and MN not in touched_revlogs:
if MN in specified_revlogs:
if not specified_revlogs[MN]:
msg = overwrite_msg % (b'--no-manifest', action.name)
ui.warn(msg)
......@@ -113,7 +120,12 @@
if action.touches_manifests and MN not in touched_revlogs:
if MN in specified_revlogs:
if not specified_revlogs[MN]:
msg = overwrite_msg % (b'--no-manifest', action.name)
ui.warn(msg)
msg_issued = True
msg_issued = 2
else:
msg = select_msg % (b'all-manifestlogs', action.name)
ui.status(msg)
if not ui.quiet:
msg_issued = 1
touched_revlogs.add(MN)
......@@ -119,7 +131,8 @@
touched_revlogs.add(MN)
if action.touches_changelog and CL not in touched_revlogs:
if CL in specified_revlogs:
if not specified_revlogs[CL]:
msg = overwrite_msg % (b'--no-changelog', action.name)
ui.warn(msg)
msg_issued = True
......@@ -120,7 +133,12 @@
if action.touches_changelog and CL not in touched_revlogs:
if CL in specified_revlogs:
if not specified_revlogs[CL]:
msg = overwrite_msg % (b'--no-changelog', action.name)
ui.warn(msg)
msg_issued = True
else:
msg = select_msg % (b'changelog', action.name)
ui.status(msg)
if not ui.quiet:
msg_issued = 1
touched_revlogs.add(CL)
......@@ -126,3 +144,3 @@
touched_revlogs.add(CL)
if msg_issued:
if msg_issued >= 2:
ui.warn((b"\n"))
......@@ -128,4 +146,6 @@
ui.warn((b"\n"))
elif msg_issued >= 1:
ui.status((b"\n"))
revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
if specified_revlogs:
......
......@@ -401,6 +401,10 @@
[formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
[formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
$ hg debugupgraderepo
note: selecting all-filelogs for processing to change: dotencode
note: selecting all-manifestlogs for processing to change: dotencode
note: selecting changelog for processing to change: dotencode
repository lacks features recommended by current config options:
fncache
......@@ -473,6 +477,10 @@
$ hg --config format.dotencode=false debugupgraderepo
note: selecting all-filelogs for processing to change: fncache
note: selecting all-manifestlogs for processing to change: fncache
note: selecting changelog for processing to change: fncache
repository lacks features recommended by current config options:
fncache
......@@ -567,6 +575,10 @@
.hg/store/data/f2.i
$ hg debugupgraderepo --run --config format.sparse-revlog=false
note: selecting all-filelogs for processing to change: generaldelta
note: selecting all-manifestlogs for processing to change: generaldelta
note: selecting changelog for processing to change: generaldelta
upgrade will perform the following actions:
requirements
......@@ -671,6 +683,10 @@
$ rm -rf .hg/upgradebackup.*/
$ hg debugupgraderepo --run --no-backup
note: selecting all-filelogs for processing to change: sparserevlog
note: selecting all-manifestlogs for processing to change: sparserevlog
note: selecting changelog for processing to change: sparserevlog
upgrade will perform the following actions:
requirements
......@@ -961,6 +977,9 @@
- manifest
$ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
note: selecting all-filelogs for processing to change: sparserevlog
note: selecting changelog for processing to change: sparserevlog
ignoring revlogs selection flags, format requirements change: sparserevlog
upgrade will perform the following actions:
......@@ -1016,6 +1035,9 @@
$ echo "sparse-revlog=yes" >> .hg/hgrc
$ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
note: selecting all-filelogs for processing to change: sparserevlog
note: selecting changelog for processing to change: sparserevlog
ignoring revlogs selection flags, format requirements change: sparserevlog
upgrade will perform the following actions:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment