evolve: revert amend

anatoly techtonik techtonik at gmail.com
Mon Aug 11 10:15:38 CDT 2014


On Mon, Aug 11, 2014 at 5:39 PM, Augie Fackler <lists at durin42.com> wrote:
> On Mon, Aug 11, 2014 at 10:37 AM, anatoly techtonik <techtonik at gmail.com> wrote:
>>> 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.
>
> The revert step does that. Note that I've made the same mistake at
> least once, and undone it this way.

$ hg revert -h
...
restore files to their checkout state

If I understand correctly 'checkout' state is being Clean, not Modified.


Reading further it appear that this command has behavior that changes
when you supply it with -r. After meditating back and forth I see what it
does a diff between 79c3 and 6019, so almost what I need. Almost,
because revert doesn't change directory back to parent changeset. I
guess that's what 'co tip' does, but then next command reverts to a
future change, which totally breaks my mind.

Although I must admit that it should be marked as accepted solution.
-- 
anatoly t.


More information about the Mercurial-devel mailing list