views:

38

answers:

2

I recently tried to merge a series of changeset and encountered a huge number of merging issues. Hence I'd like to to try to apply each changeset, in order, one by one, in order to make the merging issues easier to manage.

I'll give an example with 4 problematic changesets (514,515,516 and 517) [in my real case, I've got a bit more than that]

o changeset: 517
|
o changeset: 516
|
o changeset: 515
|
o changeset: 514
|
|
| @ changeset: 513 
| |
| o changeset: 512
| |
| o
| |
| o
| |
| o 
|/
|
|
o changeset 508

Note that I've got clones of my repos before pulling the problematic changesets.

When I pull the 4 changesets and try a merge, things are too complicated to resolve.

So I wanted to pull only changeset 514, then merge. Then once I solve the merging issue, pull only changeset 515 and apply it, etc. (I know the numbering shall change, this is not my problem here).

How am I supposed to do that, preferably without using any extension? (because I'd like to understand Mercurial and what I'm doing better).

Is the way to go generate a patch between 508 and 514 and apply that patch? (if so, how would I generate that patch)

Answers including concrete command-line example(s) most welcome :)

+3  A: 

I haven't tested this, but merging individual changesets should be easy enough:

$ hg update -r 513
$ hg merge -r 514
... # do your conflict resolution and commit
$ hg merge -r 515
... # repeat
Santa
@Santa: thanks a lot... I didn't realize I could proceed this way. The only drawback is that my "hg glog" output looks a bit messy but it worked fine and I've been able to solve all the issues :) thanks a lot!
Webinator
Glog output that looks braided is the sign of a skilled mercurial user. :)
Ry4an
+1  A: 

I haven't tested either, but it should work to just hg up to each of the foreign changesets one after the other. I don't think you have to commit between the updates.

As a bonus, the command line example you wished :-)

hg up 513
hg up 514
hg up 515
hg up 516
hg up 517
Marian
@Marian: +1 to you too because your command line example is funny :)
Webinator