This is an archive of the discontinued Mercurial Phabricator instance.

rebase: remove complex unhiding code
ClosedPublic

Authored by quark on Sep 6 2017, 7:52 PM.

Details

Summary

This is similar to Martin von Zweigbergk's previous patch [1].

Previous patches are adding more .unfiltered() to the rebase code. So I
wonder: are we playing whack-a-mole regarding on unfiltered() in rebase?

Thinking about it, I believe most of the rebase code *should* just use an
unfiltered repo. The only exception is before we figuring out a
rebasestate. This patch makes it so. See added comment in code for why
that's more reasonable.

This would make the code base cleaner (not mangling the repo object),
faster (no need to invalidate caches), simpler (less LOC), less error-prone
(no need to think about what to unhide, ex. should we unhide wdir p2? how
about destinations?), and future proof (other code may change visibility in
an unexpected way, ex. directaccess may make the destination only visible
when it's in "--dest" revset tree).

[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/094277.html

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

quark created this revision.Sep 6 2017, 7:52 PM
quark updated this revision to Diff 1644.Sep 6 2017, 7:55 PM
quark edited the summary of this revision. (Show Details)Sep 6 2017, 7:58 PM
durham added a subscriber: durham.Sep 7 2017, 8:43 PM

This sound reasonable, assuming all descendant/children computations are done before prepared is set. Could you run the fb-hgext inhibit/fbamend tests with this change? Since they might do some more interesting acrobatics around visibility changes.

durham added a comment.Sep 7 2017, 8:45 PM

I'd love to get rid of hidden filtering everywhere. Just limit knowledge of "hidden" to getting the list of visible heads, and algorithms that need to traverse children.

quark added a comment.Sep 11 2017, 1:50 PM

In theory things would be fine because fbamend and inhibit is to make things more visible, not invisible. This patch also makes things from invisible to visible so they do not conflict.

I have run ./run-tests.py --extra-config-opt=extensions.fbamend= --extra-config-opt=extensions.inhibit= --extra-config-opt=fbamend.safestrip=0 --extra-config-opt=fbamend.userestack=1 -l test-rebase-*.t and only test-rebase-obsolete.t has changed due to the "use restck" hint and an update to obsoleted wd makes it visible. They are both expected behavior differences.

durham accepted this revision.Sep 11 2017, 2:00 PM
This revision was automatically updated to reflect the committed changes.