This is an archive of the discontinued Mercurial Phabricator instance.

upgrade: explicitly warn when a `--no-xxx` flag is overwritten
ClosedPublic

Authored by marmoute on Dec 7 2021, 3:53 AM.

Details

Summary

Some format upgrade/downgrades -needs- revlog to be recomputed. So we now
detect that individually and warn when it contradict explicitly passed flag.

This is part of a larger series to make debugupgraderepo smarter about which
revlog it picks by default.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

marmoute created this revision.Dec 7 2021, 3:53 AM
marmoute updated this revision to Diff 31339.Dec 7 2021, 4:13 AM
Alphare requested changes to this revision.Dec 10 2021, 4:54 AM
Alphare added a subscriber: Alphare.

There is also a typo in the commit message: s/server/series/

mercurial/upgrade.py
107

I think it would be simpler (and technically faster even though it most likely doesn't matter here) to say if not specified_revlogs.get(FL) (same for the other two similar places)

This revision now requires changes to proceed.Dec 10 2021, 4:54 AM
marmoute added inline comments.Dec 10 2021, 5:14 AM
mercurial/upgrade.py
107

There is a semantic difference between the lack of value (None, no flag passed) and an explicite "False" (--no-xxx) flag passed.

So this does not seems an option here.

Alphare added inline comments.Dec 10 2021, 5:16 AM
mercurial/upgrade.py
107

Would if specified_revlogs.get(FL) == False work?

marmoute added inline comments.Dec 10 2021, 5:18 AM
mercurial/upgrade.py
107

This is a forbidden construct. I'll have to report your proposal to the local python inquisition.

Alphare added inline comments.Dec 10 2021, 5:20 AM
mercurial/upgrade.py
107

*sighs in dynamic typing*

marmoute edited the summary of this revision. (Show Details)Dec 10 2021, 6:24 AM
This revision was not accepted when it landed; it landed in state Needs Revision.
This revision was automatically updated to reflect the committed changes.