This is an archive of the discontinued Mercurial Phabricator instance.

rewriteutil: check for divergence
ClosedPublic

Authored by martinvonz on Apr 27 2021, 6:53 PM.

Details

Summary

This code is adapted from the code in the evolve extension. It seems
to be equivalent as far as the evolve extension's test suite can tell
(the only impact when making their precheck() delegate to our
version is that error messages are less detailed).

I had to change the error message to work with "change branch of"
being inserted as the action.

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

martinvonz created this revision.Apr 27 2021, 6:53 PM
martinvonz edited the summary of this revision. (Show Details)Apr 27 2021, 7:03 PM
pulkit added a subscriber: pulkit.Apr 28 2021, 6:23 AM
pulkit added inline comments.
tests/test-branch-change.t
153–154

s/of of/ of

pulkit accepted this revision.Apr 28 2021, 6:23 AM
This revision is now accepted and ready to land.Apr 28 2021, 6:23 AM
martinvonz added inline comments.Apr 28 2021, 11:43 AM
tests/test-branch-change.t
153–154

Good catch. The bug was actually already there: we sometimes would say "cannot change branch of while merging". It's a consequence of the simplistic way we produce these messages. We simply insert something that should be a verb into a sentence. I assume that's also not great for i18n. I suppose we could change the "verb" from "change branch of" to "branch-change", so it becomes these:

"cannot branch-change the null revision"
"cannot branch-change while merging"
"cannot branch-change public changesets"
"cannot branch-change changeset with children"
"branch-change of 3938acfb5c0f creates content-divergence with 7c1991464886'"

But it's probably better to change the messages to fit better. In
"cannot change branch of the null revision"
"cannot change branch of changeset while merging" (added "changeset")
"cannot change branch of public changesets"
"cannot change branch of changeset with children"
"cannot change branch of 3938acfb5c0f, as that creates content-divergence with 7c1991464886'"

I'll do the latter.

This revision was automatically updated to reflect the committed changes.