The difference between update and merge
Matt Mackall
mpm at selenic.com
Wed Dec 7 17:00:11 UTC 2011
On Wed, 2011-12-07 at 12:46 +0100, Martin Geisler wrote:
> 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.
If you discover the automatic merge of a single file failed in your
extensive post-merge testing, you can re-resolve it.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list