[Updated] D11870: upgrade: issue a message when a revlog type has to be upgraded
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Fri Dec 10 15:47:24 UTC 2021
Closed by commit rHG8405c1bffacf: upgrade: issue a message when a revlog type has to be upgraded (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
CHANGED PRIOR TO COMMIT
https://phab.mercurial-scm.org/D11870?vs=31409&id=31419#toc
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11870?vs=31409&id=31419
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11870/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11870
AFFECTED FILES
mercurial/upgrade.py
tests/test-upgrade-repo.t
CHANGE DETAILS
diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -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:
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -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,24 +109,43 @@
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)
+
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)
+
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)
- if msg_issued:
+ if msg_issued >= 2:
ui.warn((b"\n"))
+ elif msg_issued >= 1:
+ ui.status((b"\n"))
revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
if specified_revlogs:
To: marmoute, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211210/fc03c63b/attachment-0002.html>
More information about the Mercurial-patches
mailing list