Re: Help: How to merge entire changesets instead of file-by-file?

Jeff Saylor js-contact at deadworks.com
Sat May 2 12:12:04 CDT 2009


First - thanks to everyone with the tips re: resolve, etc.  But they still didn't get me what I was looking for, most likely the result of my bumbling question.

I have figured out a workflow to accomplish what I was trying to do.  I'm posting here in case it helps anyone else out and also in case someone can whack me upside the head with "oh, that's what you want to do!  do this instead..."

1. Start with an empty working dir with 2 heads: Mine and Theirs.
2. Update working dir to Mine.
3. Perform a merge, but fail all files that Merc can't handle automatically: hg --config "ui.merge=internal:fail" merge
4. Ahhh, now I've got a working dir with as much as auto could figure out, but any outstanding files still untouched from Mine.
5. Now I can vdiff against the Theirs head which gives me the high level, changeset-to-changeset merge that I was looking for.
6. When done, use resolve to mark all files resolved for Merc and then commit.

Is there a simpler/easier/better way to do this?  Steve Borho's point about patches enabling extdiff to do 3 way merges (Mine-Theirs-Working dir) sounds like part of an answer, but the real answer for me would be that within the start and completion of a merge (essentially replacing the file-by-file approach with a whole-hog approach).

Lastly, I'll say again that I really feel like I'm either missing something obvious or resisting the normal file-by-file workflow for spurious reasons.  If there's a better way, I'm all ears!

Appreciation in advance - Cheers, jsaylor
 





  _____  
From: Jeff Saylor [mailto:jsaylor at deadworks.com]
To: mercurial at selenic.com
Sent: Thu, 30 Apr 2009 10:04:09 -0400
Subject: Help: How to merge entire changesets instead of file-by-file?

 
When performing a merge with Mercurial, it wants to merge conflicting files one at a time which hasn't been productive for me on large sets. Instead, what I
would like to do is merge the entire changesets of both heads (like
using kdiff3 to diff 2 heads). To me that sounds straightforward but I
can't figure out how to achieve it.

So far, the closest I can get is to go through the merge the usual
way, leave all the conflicts unresolved (a file at a time...), and then
hg vdiff  -rHead1 -rHead2 - but vdiff (using kdiff3)
doesn't seem to have options for passing the tool an output dir (the
current working dir) and instead launches with the output dir as a
tempdir (possibly -o is the answer?).

Let me put it another way - I want to use a merge tool (kdiff3!) to merge two heads
into my working directory. I want the results in my working dir to be
my merge that I can commit.

I must be missing something obvious, I can't be the only one who wants to do this.

Much appreciation in advance - Cheers, jsaylor 



More information about the Mercurial mailing list