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

Uwe Brauer oub at mat.ucm.es
Sun Oct 16 15:10:53 UTC 2022


> Hi Uwe,
> On 10/10/2022 22:17, Uwe Brauer wrote:

> Sounds really great.

> This is interesting and I'd be happy to test it, if I get the time
> (that is the hard part as you can imagine). Such a feature could even
> get me to actually use `vc-hg`, especially if we can get the variant
> for `hg amend -i`.


> Can you please clarify this last point? Do you mean that the working
> directory parent is not the changeset that has just been created, or
> is that a matter of bookmarks?


Here is a trivial example.


,----
| hg init
| echo "First" > test.org
| hg add test.org
| echo "syntax: glob" > .hgignore
| echo "test-commit-patch.sh" >> .hgignore
| hg add .hgignore
| hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "First"
| echo "Second" >> test.org
| hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "Second"
| echo "Third" >> test.org
| hg commit -u "Bernhard Riemann <bernhard.riemann at gmail.com>" -m "Third"
| echo "Forth" >> test.org
| echo "file 2" > new.org
| hg add new.org
| hg commit -m "Added a new file"
| echo "secrect" >> new.org
| echo "enigma" >> test.org
`----

It is a bit stupid since both files have each only one hunk, but to
explain the point it should be sufficient so the graph looks like

  changeset:   3:dce8786fefc8
│  Branch:      default
│  tag:         tip
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 16 Oct 2022 16:32:49 +0200
│  Phase:       draft
│  Summary:     Added a new file
│
○  changeset:   2:3994d3e01dab
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Sun, 16 Oct 2022 16:32:48 +0200
│  Phase:       draft
│  Summary:     Third
│
○  changeset:   1:cb00bbfae330
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Sun, 16 Oct 2022 16:32:48 +0200
│  Phase:       draft
│  Summary:     Second
│
○  changeset:   0:5fe2ba3f1f90
   Branch:      default
   Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
   Date:        Sun, 16 Oct 2022 16:32:48 +0200
   Phase:       draft
   Summary:     First

hg status gives

M new.org
M test.org


As to be expected. I do 

    - vc-dir

    - select both files and run

    - vc-diff

Now in the diff buffer I delete a hunk of one of these files and then
commit (vc-next-action) or if using commit-patch, the external lisp
package that supports the perl script commit-patch it would be
commit-patch-buffer.

Now the first patch provided by Dimitry results in the graph

○  changeset:   4:29f54cd57709
│  Branch:      default
│  tag:         tip
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 16 Oct 2022 17:03:51 +0200
│  Phase:       draft
│  Summary:     test the first patche from dimitry
│
◍  changeset:   3:dce8786fefc8
│  Branch:      default
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 16 Oct 2022 16:32:49 +0200
│  Phase:       draft
│  Summary:     Added a new file
│
○  changeset:   2:3994d3e01dab
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Sun, 16 Oct 2022 16:32:48 +0200
│  Phase:       draft
│  Summary:     Third
│
○  changeset:   1:cb00bbfae330
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Sun, 16 Oct 2022 16:32:48 +0200
│  Phase:       draft
│  Summary:     Second
│
○  changeset:   0:5fe2ba3f1f90
   Branch:      default
byte 1009                  


And hg status

M new.org
M test.org

So that looks odd, but is solved by 

 hg up tip

◍  changeset:   4:29f54cd57709
│  Branch:      default
│  tag:         tip
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 16 Oct 2022 17:03:51 +0200
│  Phase:       draft
│  Summary:     test the first patche from dimitry
│
○  changeset:   3:dce8786fefc8
│  Branch:      default
│  Author:      Uwe Brauer <oub at mat.ucm.es>
│  Date:        Sun, 16 Oct 2022 16:32:49 +0200
│  Phase:       draft
│  Summary:     Added a new file
│
○  changeset:   2:3994d3e01dab
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Sun, 16 Oct 2022 16:32:48 +0200
│  Phase:       draft
│  Summary:     Third
│
○  changeset:   1:cb00bbfae330
│  Branch:      default
│  Author:      Bernhard Riemann <bernhard.riemann at gmail.com>
│  Date:        Sun, 16 Oct 2022 16:32:48 +0200
│  Phase:       draft
│  Summary:     Second

hg status 

hg status
M new.org


So the status after applying the first patch is a bit odd. 
I proposed to include a simple hg up tip in the lisp code

But Dimitry preferred to use shelve and unshelve, which results in the
same graph and status as commit-patches.

However I tried it out with the converted emacs repository, that is I
run clone with hg and the hg-git plugin, in which case the repository is
instead of 1.1 GB 1.7, but this is to be expected.

Be it as it may, in that case a similar test, result in 20 sec for
commit-patch and 30 sec for Dimitry's second patch, because it used
shelve/unshelve which is slow.

Hopes this helps




Uwe 
-------------- 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/20221016/cb96f9c6/attachment.p7s>


More information about the Mercurial-devel mailing list