( )⚙ D6880 rebase: track new nodes when --keep is set

This is an archive of the discontinued Mercurial Phabricator instance.

rebase: track new nodes when --keep is set
ClosedPublic

Authored by pgossman on Sep 25 2019, 11:35 AM.

Details

Summary

When --keep is passed with rebase, the new nodes created are not
accessible from templates.

This change enables accessing the newly-created nodes from nodechanges,
just as if --keep was not set.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pgossman created this revision.Sep 25 2019, 11:35 AM
pulkit accepted this revision.Sep 25 2019, 11:38 AM
This revision is now accepted and ready to land.Sep 25 2019, 11:38 AM
pgossman updated this revision to Diff 16609.Sep 25 2019, 11:38 AM
This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.Sep 26 2019, 7:20 PM
hgext/rebase.py
1808–1810

It looks like this still moves bookmarks, right (in the moves dict)? Should scmutil.cleanupnodes() simply only be called if not keepf?

pgossman added inline comments.Sep 26 2019, 7:29 PM
hgext/rebase.py
1808–1810

Yes this moves them. With --keep, bookmarks should still be moved.

See rebase help or https://bz.mercurial-scm.org/show_bug.cgi?id=5682

martinvonz added inline comments.Sep 26 2019, 8:16 PM
hgext/rebase.py
1808–1810

Oh, right, that bug... I agree that it's good that this patch preserves that behavior to avoid doing multiple things in one patch. But I think the current behavior is pretty surprising. I'm curious what you think since you apparently use hg rebase --keep (I don't).

pgossman added inline comments.Sep 30 2019, 12:23 PM
hgext/rebase.py
1808–1810

Bookmarks don't affect my use case for --keep, however, I agree the behavior was surprising and it would seem more intuitive if --keep did not move bookmarks.