It is impossible to amend the tip to its parent's state using GUI

Issue #2172 open
Ruslan Yushchenko
created an issue

Consider following repository:

hg init
echo "Original string" > a
hg add a
hg ci -m "Initial"
echo "Changed string" > a
hg ci -m "Changed"
echo "Original string" > a

Next, in TortoiseHG commit window try to select "Amend" option. There is no files marked as changed. If I unfilter 'clean' files and select file 'a', nothing will be amended also.

On the other hand, using Mercurial command line: hg ci --amend -m "Something" will do as it should.

Comments (13)

  1. Angel Ezquerra

    There are several issues here:

    1. Why doesn't TortoiseHg show the a file in the example as modified? 2. Why doesn't TortoiseHg not take into account the selected "Clean" file?

    1. 2 is easy, the commit method of the CommitWidget ignores clean files. I think that makes sense even when amending, since amend does not let you "remove" a file from the amended revision, which means that amending a clean file (if it is really clean) will do nothing at all.

    So the key is to fix #1. Unfortunately I still do not have an answer for that one.

  2. Ruslan Yushchenko reporter

    @Steve Hu Borho: No, this problem appears every time a file to be amended is the same as its grandparent, but not the same as its parent.

    I believe that the issue it related to the fact that in while Amend mode, commit dialog shows the diff between grandparent revision and the working directory. It should instead somehow "unite" the diff from grandparent to parent with the diff from parent to the working directory.

  3. Log in to comment