This is an archive of the discontinued Mercurial Phabricator instance.

histedit: import chistedit curses UI from hg-experimental
ClosedPublic

Authored by durin42 on Oct 17 2018, 5:41 PM.

Details

Summary

I don't tend to like curses interfaces, but this gets enough use at
work that it seems like it's worth bringing into core. This is a
minimal import from hg-experimental revision 4c7f33bf5f00, in that
I've done the smallest amount of code movement and editing in order to
import the functionality.

.. feature::

`hg histedit` will now present a curses UI if curses is available
and `ui.interface` or `ui.interface.histedit` is set to `curses`.

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

durin42 created this revision.Oct 17 2018, 5:41 PM
durin42 updated this revision to Diff 12221.Oct 17 2018, 6:11 PM
pulkit added a subscriber: pulkit.Oct 18 2018, 7:02 AM

Is the goal is to include this in 4.8?

pulkit added a comment.

Is the goal is to include this in 4.8?

Yes if possible.

martinvonz accepted this revision.Oct 18 2018, 1:36 PM
martinvonz added a subscriber: martinvonz.

Would be good to have tests, but I guess there are no tests in hg-experimental either? I'm not queuing because I'm biased.

This revision is now accepted and ready to land.Oct 18 2018, 1:36 PM

Correct, no tests in hg-experimental. I did a basic sniff test, but I don't really know how we do curses tests in general.

durin42 updated this revision to Diff 12322.Oct 23 2018, 11:02 AM

I remember using chistedit and finding that the .hg/chisedit file is not deleted after chistedit is completed. Looking at code, I am unable to find code which deletes that file. Can you please have a look and delete that file after a successfull or aborted chistedit?

In D5146#77492, @pulkit wrote:

I remember using chistedit and finding that the .hg/chisedit file is not deleted after chistedit is completed. Looking at code, I am unable to find code which deletes that file. Can you please have a look and delete that file after a successfull or aborted chistedit?

That file is an implementation detail, so that histedit can pass rules to itself. It's a little gross, but not harmful.

Could I persuade you to let us clean that up later as a follow-up?

In D5146#77492, @pulkit wrote:

I remember using chistedit and finding that the .hg/chisedit file is not deleted after chistedit is completed. Looking at code, I am unable to find code which deletes that file. Can you please have a look and delete that file after a successfull or aborted chistedit?

That file is an implementation detail, so that histedit can pass rules to itself. It's a little gross, but not harmful.
Could I persuade you to let us clean that up later as a follow-up?

Yeah sure!

pulkit accepted this revision.Nov 13 2018, 7:12 AM

Queueing this, many thanks for importing this in core.

Can you add some documentation about the new config option to enable curses interface as followup?

Also, how do you feel about histedit using curses interface if ui.interface=curses is set?

This revision was automatically updated to reflect the committed changes.