call for Emacs testers (and opinion) native support of hg ci -i

Uwe Brauer oub at mat.ucm.es
Mon Oct 10 20:17:18 UTC 2022


Hi 

I am not sure how many mercurial users, also use GNU emacs for their
work. I do, and I am mostly happy with vc-hg.el provided by GNU emacs.

There is however one feature I really miss, 

 hg ci -i 

So that you can just commit certain hunks. 

Well using 
[ui]
interface = curses

The online command is ok, but I'd prefer an emacs interface for that,
since navigation, manipulating hunks (splitting them) is much nicer in
emacs.

One possibility (and I think I mentioned it here) to obtain an  Emacs
Interface is to use 
commit-patch, 

https://porkrind.org/commit-patch

A perl script (also a emacs lisp pkg is included) that allows you to
operate directly in the vc-diff buffer. 
It works in Ubuntu (16.04, but I presume it works on other flavours as
well) and on MacOS if the correct perl module is installed. I have no
idea about windows.

Be it as it may, right now, GNU emacs starts to support that feature
natively!
It is already implemented for git on the master branch for the developer
version.

And just today Dmitry Gutov kindly sent me a patch.


Dmitry unfortunately uses only git and is not very acquainted with
mercurial so he asked me to test it. I did and found a bit strange
behavior that I would like to discuss below. 
So I am looking for mercurial+emacs users who are interested in this
issue and would like to test the patch and send their comments or
recommendations, best would be to the emacs dev list or to me.

Let me describe how is this is supposed to work


    1. In a file of your hg repository you start vc-diff (or
       diff-hl-diff-goto-hunk which is also provided Dmitry and I can
       only recommend).

    2. You visit the diff buffer and manipulates the hunks as you wish:
       delete some, split others etc 

    3. You call  vc-next-action a windows appears for the commit message
       (if you use commit-patch, you would use bound to   C-c C-c)

    4. It seems to work fine, the only problem I faced is that contrary
       to  commit-patch
       @ is *not* updated, that is hg up tip has not been run. I think
       it should, since this is the standard behavior. What do others think


How to test it?

    1. Clone or pull git://git.savannah.gnu.org/emacs.git (I recommend
       to use git, since hg with hg-git needs hours)

    2. Apply the attached patch with git apply

    3. Configure and compiles

    4. Either install it or  cd $HOME/src/emacs-git/src (or wherever you
       have your source code) and run        ./emacs

Regards

Uwe Brauer 





-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vc-hg-checkin-patch.diff
Type: text/x-diff
Size: 1932 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20221010/cdb25035/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5673 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20221010/cdb25035/attachment.p7s>


More information about the Mercurial-devel mailing list