( )⚙ D1173 rebase: add support to output nodechanges

This is an archive of the discontinued Mercurial Phabricator instance.

rebase: add support to output nodechanges
ClosedPublic

Authored by pulkit on Oct 17 2017, 7:12 PM.

Details

Summary

This patch adds support to rebase to show the changes in node once the rebase is
complete. This will be extremely helpful for automation purposes and editors
such as Nuclide.

The output is a dictionary of predecessor hash as key and a list of successors'
hashes. The successors one is a list as there can be many successors for a single
predecessor in case of split and it will good to have a generic output format.

This patch adds tests for the same. A new file is created for the patch as
existing files related to rebase has their own purpose and there will be more
formatter support coming for rebase in next cycle.

Thanks to Jun for suggesting to use fm.data().

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 17 2017, 7:12 PM
dlax edited the summary of this revision. (Show Details)Oct 18 2017, 3:00 AM
dlax accepted this revision.
dlax added a subscriber: dlax.

Looks good to me, much nicer than the previous version.

Much improved, thanks.

durin42 accepted this revision.Oct 18 2017, 4:08 PM
This revision is now accepted and ready to land.Oct 18 2017, 4:08 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Oct 19 2017, 11:02 AM
yuja added inline comments.
hgext/rebase.py
597

I'm surprised that the rebase command does have -T and --style
options from the very start. No idea how they would work, though.

1549

fm.hexfunc() could be used.

1551

Needs to wrap dict/list by fm.formatdict()/fm.formatlist()
to support -T "{user template}".

Can you send a follow up after 4.4 release?

pulkit added inline comments.Oct 19 2017, 2:46 PM
hgext/rebase.py
597

I am also surprised by this.

1551

Yeah sure. I will.