The difference between update and merge

Martin Geisler mg at aragost.com
Wed Dec 7 11:46:30 UTC 2011


Isaac Jurado <diptongo at gmail.com> writes:

> On Tue, Dec 6, 2011 at 11:07 PM, Martin Geisler <mg at lazybytes.net> wrote:
>>
>> It was a little more complicated than I remembered -- you have to
>> first mark the file as unresolved before 'hg resolve --tool
>> internal:local' has any effect. So
>>
>>  hg resolve --unmark afile
>>  hg resolve --tool internal:local afile
>>
>> brings back the original diff. Updating back to the OLD revision
>> triggers another merge conflict, but this time picking the local
>> version in the merge tool is the right thing to do:
>>
>>  HGMERGE=internal:local hg update 0
>>
>> So it's definitely not something to play around with on your first
>> try with Mercurial, but we do have remarkably good support for
>> preserving changes in a dirty working copy.
>
> Now, THAT is impressive. I had no clue about it, thanks and sorry for
> being an ass ;-)

No problem, nothing wrong with being a little skeptic :)

> Out of curiosity, where is the original diff stored?

It's stored in a .hg/merge/<hash> file where <hash> is the SHA-1 has of
the file. It's also used by normal merges between committed changes,
though I cannot figure out right now why it's necessary in that case.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/



More information about the Mercurial mailing list