Page MenuHomePhabricator

scmutil: add formatter a optional arg to cleanupnodes to show hash changes

Authored by pulkit on Aug 31 2017, 11:32 AM.


Group Reviewers

scmutil.cleanupnodes is used by rebase, histedit and amend to do create
obsmarkers or strip nodes. This patch adds functionality to cleanupnodes to take
a formatter and if a formatter is passed, it will show the hash changes also.

The formatter is a optional argument, so if a command needs to show the hash
changes it can pass a formatter and if not, things work.

Diff Detail

rHG Mercurial
Lint Skipped
Unit Tests Skipped

Event Timeline

pulkit created this revision.Aug 31 2017, 11:32 AM
akushner added inline comments.

Some typos in the comment. Is this what you meant?

# If a formatter object is passed, display the hash changes

or was this a question for the reviewers?

pulkit planned changes to this revision.Aug 31 2017, 12:54 PM
pulkit added inline comments.

Oops, yes I meant that. Was in a hurry and left that comment. Thanks for catching.

pulkit updated this revision to Diff 1473.Aug 31 2017, 12:56 PM
akushner added inline comments.Aug 31 2017, 12:56 PM

Perhaps "is changed to" should be:


or even


pulkit updated this revision to Diff 1474.Aug 31 2017, 1:03 PM
pulkit marked 2 inline comments as done.Aug 31 2017, 1:04 PM
quark added a subscriber: quark.Aug 31 2017, 1:26 PM

In the previous version, I have suggested making changes part of template language instead of a flag, like -T '{changes|json}' instead of --changes -T 'json'. That's generally more flexible because people can use the template language (ex. if they only want newnode, or they want colors, etc.). Have you considered that? Or does that have some technical difficulties?

pulkit planned changes to this revision.Aug 31 2017, 4:25 PM

As per discussion with @quark , "-T should be specifying the template content, instead of just the template type".

pulkit abandoned this revision.Oct 4 2017, 2:18 PM

Send an updated version as D933 and D934.