commit --amend creates a different changeset ID than when MQ is used

Kaminar Kaminar at seznam.cz
Tue Jun 27 19:04:28 UTC 2017


Hi,

I found during amending a changeset something weird which seems to be a bug.
I tried it on Mercurial 4.2.1. I will show it on simple example.

Firstly, I create simple repository repo1:

$ hg init repo1
$ cd repo1
$ echo "Hello" > file.txt
$ hg add
$ hg commit -d "2017-01-01" -m "Message"
$ hg log -T "{node}\n"
17731128c8db3022b3a83f1a0e23601e8b490da7

Now I create the second repository repo2 witch should be same as repo1:

$ hg init repo2
$ cd repo2
$ echo "Helo" > file.txt
$ hg add
$ hg commit -d "2017-01-01" -m "Message"

In file file.txt I introduced mistake "Helo" --> "Hello". I will fix it with
commit --amend.

$ echo "Hello" > file.txt
$ hg commit --amend -d "2017-01-01" -m "Message"
$ hg log -T "{node}\n"
ebf71e8762e89cf1eb541e32dfe14a558b61f09f

But changeset ID of amended changeset differs from repo1 changeset ID.

Now I will use MQ for amend mistake. (When continuing from the repo2 state, 
it is enough to refresh patch only.)

$ hg qimport -r 0
$ hg qrefresh -d "2017-01-01"
$ hg qfinish -a
$ hg log -T "{node}\n"
17731128c8db3022b3a83f1a0e23601e8b490da7

If MQ used for amend, changeset ID in repo2 equals to changeset ID in repo1.

Obviously, commit --amend doesn't produce equal changeset IDs even when the 
content and history should be identical in both repositories.

Is it bug?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20170627/3107241e/attachment.html>


More information about the Mercurial mailing list