The --changes flag to rebase will tell user about the hash changes which
happened during the rebase once the rebase completes. The hash changes can also
be outputed as JSON by using --changes -q -Tjson. -q is required so that
things which are outputed by ui.status() are prevented and we get a JSON only
with the hash changes.
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
I think a more general purposed approach is preferred here - see D173. If we make {changes} part of the template language (as suggested by the inline comment), the implementation of {changes} could be shared across multiple commands.
EDIT: the inline comment {changes|"..."} should be changed to {changes%"..."}.
hgext/rebase.py | ||
---|---|---|
487–488 | I think automation may want full hash here. So we might want to allow that somehow. Maybe we can use template to customize the output, like: -T '{changes}' # default -T '{changes|"{oldnode|short} -> {newnode|short}"}' # customized entry -T '{changes|json}' # json formatted |
I like the idea. I will try to send patches to use formatter there instead of using ui.status.
hgext/rebase.py | ||
---|---|---|
487–488 | That looks like a nice idea, but since other outputs are repo.ui.* things and as far as I know, they can be templated, so we are only left with hash change output which we are adding. |
hgext/rebase.py | ||
---|---|---|
487–488 | Definitely make these full hashes, and then have the default template for this output them as short hashes. |
hgext/rebase.py | ||
---|---|---|
487–488 | fm.hexfunc can be used. |
I think automation may want full hash here. So we might want to allow that somehow.
Maybe we can use template to customize the output, like: