Page MenuHomePhabricator

dirstate-v2: Add `hg debugupgraderepo` command support
ClosedPublic

Authored by SimonSapin on May 25 2021, 2:11 AM.

Details

Summary

This command changes changes the file formats used inside an existing
repository to what they would be in a new repository with the current config.

For example:

hg debugupgraderepo --config format.exp-dirstate-v2=1 --run
hg debugupgraderepo --config format.exp-dirstate-v2=0 --run

If a repository has a dirstate in v1 format, the first command would upgrade it
to dirstate-v2. Conversely, if a repository has a dirstate in v2 format, the
second command would downgrade it to v1. (Both may also run some unrelated
upgrades.)

Since format.exp-dirstate-v2 is currently disabled by default, not specifying
it in --config or any configuration file would result in the second command.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.May 25 2021, 2:11 AM
SimonSapin updated this revision to Diff 28205.May 26 2021, 5:16 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.