evolve: revert amend

anatoly techtonik techtonik at gmail.com
Mon Aug 11 09:37:31 CDT 2014


On Mon, Aug 11, 2014 at 5:31 PM, Augie Fackler <lists at durin42.com> wrote:
> On Mon, Aug 11, 2014 at 10:26 AM, Matt Mackall <mpm at selenic.com> wrote:
>>> @  changeset:   3173:79c37431f559
>>> |  tag:         tip
>>> |  parent:      3170:4d0047e4dd50
>>> |
>>> | x  changeset:   3172:1a7eaca96f66
>>> | |  temporary amend commit for 60196217f989
>>> | |
>>> | x  changeset:   3171:60196217f989
>>> |/
>>> |
>>> o    changeset:   3170:4d0047e4dd50
>>> |\   parent:      3169:fcf21e6806af
>>
>> Always remember, everything in version control is just fancy diff and
>> patch:
>>
>> hg diff --hidden -r 3171:3173 > prematurecommit
>> hg diff --hidden -r 3173:3171 > gobackwards
>> hg import --no-commit gobackwards
>> hg amend
>> hg import --no-commit prematurecommit
>>
>> ..or whatever it is you're trying to do.
>
>
> I'd spell what he wants as
>
> hg touch --hidden 60196217f989
> hg co tip # probably don't need this
> hg revert --all -r 79c37431f559
> hg prune 79c37431f559
>
> which should effectively undo the bad amend. For paranoia, start from
> a clean working copy.

Hmm. I fail to see how that changes the status of files to
"modified". The problem started when changes from modified files
slipped into amended commit, because I didn't pay attention there
are more changes in repo and forgot to choose only needed ones.

Right now I had to rollback the commit with MQ and repeat change
selection, but "hg undo" command would be more intuitive (a safe
"panic button").
-- 
anatoly t.


More information about the Mercurial-devel mailing list