( )⚙ D1095 amend: add a flag `-n/--note` to store note with amend

This is an archive of the discontinued Mercurial Phabricator instance.

amend: add a flag `-n/--note` to store note with amend
ClosedPublic

Authored by pulkit on Oct 15 2017, 10:28 AM.

Details

Summary

This patch utilises the functionality added in previous patches and adds a flag
to amend command in hgext/amend to add a note to the amend. Since the note is
stored in the obsmarker metadata, this will only be useful when obsmarker
creation is enabled, otherwise this is no-op.

Not adding releasenotes part as we yet don't have a functionality in core to
show the note.

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

pulkit created this revision.Oct 15 2017, 10:28 AM
dlax accepted this revision.Oct 16 2017, 4:27 AM
yuja accepted this revision.Oct 16 2017, 9:22 AM
yuja added a subscriber: yuja.

Seems fine, though I don't know how the note will be displayed.

FWIW, note cannot be a long sentence due to the storage limit.

$ hg amend --note "$(yes | head -300 | tr -d '\n')"
...
ProgrammingError: obsstore metadata value cannot be longer than 255 bytes ...
This revision is now accepted and ready to land.Oct 16 2017, 9:22 AM
In D1095#18504, @yuja wrote:

Seems fine, though I don't know how the note will be displayed.

We don't have a UI to display obsmarker in core, so for now extensions has to do this.

FWIW, note cannot be a long sentence due to the storage limit.

$ hg amend --note "$(yes | head -300 | tr -d '\n')"
...
ProgrammingError: obsstore metadata value cannot be longer than 255 bytes ...

I will follow up to make sure we catch this before.

yuja added a comment.Oct 16 2017, 10:50 AM

We don't have a UI to display obsmarker in core, so for now extensions has to do this.

I know. It would be nice if reviewers can know how the planned UI will be
to determine whether only --note option should be in the next release or not.

In D1095#18566, @yuja wrote:

We don't have a UI to display obsmarker in core, so for now extensions has to do this.

I know. It would be nice if reviewers can know how the planned UI will be
to determine whether only --note option should be in the next release or not.

The UI is not completely planned. What I have in my mind is that it will be good thing to show in obsfate, may be smartlog and definitely it will be in obslog. The note can serve better than messages like "rewritten x,y,z". I will be working on improving the UI around obsolete markers thing in the next cycle and will be discussing these all with everyone interested.

durin42 accepted this revision.Oct 16 2017, 9:37 PM

(Thanks to @yuja for reviewing this new feature so I could have more confidence landing the patch this late in the cycle.)

This revision was automatically updated to reflect the committed changes.