This is an archive of the discontinued Mercurial Phabricator instance.

[PoC] scmutil: support local only obsolescence
Needs RevisionPublic

Authored by indygreg on Mar 4 2018, 7:42 PM.

Details

Reviewers
baymax
Group Reviewers
hg-reviewers
Summary

Now that we have a config option for enabling local-only obsolescence,
it is time to do something with it.

This commit teaches cleanupnodes() - which is called after rewrite
operations - to handle local only obsolescence mode.

In this mode, we create a backup bundle of the obsoleted changesets -
just like what happens if obsolescence is disabled. But we don't strip
the repo: we keep the original changesets around in a non-visible state.

The new code verifies that no unstable changesets are introduced in
local-only obsolescence mode.

The new code hackily only runs if the action is "amend." The intent
is to make this conditional only on the feature option. However,
doing that would have significant test fallout. So we limit to "amend"
for now.

TODO:

  • Better test coverage (I think the "(testcase !)" syntax might be subtly wrong by flagging output as optional and not required).
  • Delete obsolescence markers when we pull and unbundle from the bundle.
  • Support pulling locally-hidden heads.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Mar 4 2018, 7:42 PM

re: the "(testcase !)" syntax- I agree that it would be better if "(false !)" means the line is *not* present, instead of optional.

I made an attempt to do that, but somehow I came up with a test in test-run-tests.t that failed there, but the exact same test ran fine in another *.t. I wondered if it was a case of run-tests.py processing it for a test inside test-run-tests.t, and then the main instance of run-tests.py re-processing it. If I can find that code, I can post it if you think it might be useful. But I've long forgotten the nuance in that code.

baymax requested changes to this revision.Jan 24 2020, 12:33 PM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.

:baymax:need-review-idle:

This revision now requires changes to proceed.Jan 24 2020, 12:33 PM