debugchangelog: migrate from lazy to lazy is not an error

Summary: Migrating from the lazy backend to lazy backend should be a no-op.

Reviewed By: liubov-dmitrieva

Differential Revision: D28554382

fbshipit-source-id: 71c06584f6f7a89096ce4a94843c88cbea542475
This commit is contained in:
Jun Wu 2021-05-20 09:41:13 -07:00 committed by Facebook GitHub Bot
parent b10a056737
commit 5f9559ad99
2 changed files with 19 additions and 7 deletions

View File

@ -675,8 +675,12 @@ def migrateto(repo, name):
"lazy",
}:
raise error.Abort(_("cannot migrate away from lazytext backend"))
if "lazychangelog" in repo.storerequirements and name != "lazy":
raise error.Abort(_("cannot migrate away from lazy backend"))
if "lazychangelog" in repo.storerequirements:
if name != "lazy":
raise error.Abort(_("cannot migrate away from lazy backend"))
else:
# No need to migrate.
return
if name == "revlog":
migratetorevlog(repo)
elif name == "rustrevlog":

View File

@ -175,10 +175,18 @@ The revlog backend does not need segmented data.
o D
Cannot migrate hgsql repos
To lazy:
$ echo hgsql >> .hg/requires
$ hg debugchangelog --migrate lazytext
abort: lazytext backend can only be migrated from hybrid or doublewrite
[255]
(filters out hgsql mysql import errors)
$ hg debugchangelog --migrate revlog --config extensions.hgsql= --config hgsql.bypass=1 2>&1 | grep migrate
abort: cannot migrate hgsql repo
$ hg debugchangelog --migrate doublewrite
$ setconfig paths.default=test:server1
$ hg debugchangelog --migrate lazytext
$ hg debugchangelog --migrate lazy
$ hg debugchangelog --migrate lazy