1. TortoiseHg
  2. TortoiseHg
  3. thg
  4. Issues
Issue #2172 open

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

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 (11)

  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 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. Angel Ezquerra

    ruslan Yushchenko, I believe that is correct. I have not tested this but unless TortoiseHg is doing something special when working with MQ patches this problem should also happen when using QRefresh.

  4. Log in to comment