tags:

views:

84

answers:

3

I have had a bad merge. Now I want to start the merge all over again. I did a revert just before the merge. Now when I'm trying to add the bundle, I'm having the message and it can no more locate the changes. What is wrong? Why isn't it finding any change?

c:\Documents and Settings\Desktop\New Folder\test_rev94_to_tip_hg\test_rev94_to_tip.hg
searching for changes
no changes found
[command completed successfully Tue Apr 13 16:10:37 2010]

Changesets:

105: default tip merge 104: backed out chageset 26e351596da9 103: revert error 102: revert 101: remove tabledata 100 Merge ........... Code from merging 99: assignment , changeset 26e351596da9 98: refactored code 97: 96: 95: ............... 94: version 1

I wanted to revert back to 94 and then do the merging again.

+1  A: 

You can re-merge when you go back to an unmerged revision, and specify the other revision to merge there. Say the repo after the merge has the following layout:

o    changeset:   4:a72f471ed717
|\   parent:      3:abd9c586bce0
| |  parent:      2:6827b9817642
| |  user:        Rudi 
| |  date:        Wed Apr 14 12:09:39 2010 +0200
| |  summary:     Merged
| |
| o  changeset:   3:abd9c586bce0
| |  parent:      1:11e62ba50646
| |  user:        Rudi 
| |  date:        Wed Apr 14 12:09:29 2010 +0200
| |  summary:     branched
| |
o |  changeset:   2:6827b9817642
|/   user:        Rudi 
|    date:        Fri Feb 12 15:30:34 2010 +0100
|    summary:     Something other changed
|
o  changeset:   1:11e62ba50646
|  user:        Rudi 
|  date:        Fri Feb 12 14:28:48 2010 +0100
|  summary:     Something changed
|
o  changeset:   0:b42b1175ba6b
   user:        Rudi 
   date:        Fri Feb 12 14:16:13 2010 +0100
   summary:     Initial

Here you go to rev with hg up -r 3 to the change set before the merge. There you issue hg merge -r 2 to redo the merge. After the commit the repo looks like this:

@    changeset:   5:65d010bb347a
|\   tag:         tip
| |  parent:      3:abd9c586bce0
| |  parent:      2:6827b9817642
| |  user:        Rudi 
| |  date:        Wed Apr 14 12:54:42 2010 +0200
| |  summary:     merge redone
| |
+---o  changeset:   4:a72f471ed717
| |/   parent:      3:abd9c586bce0
| |    parent:      2:6827b9817642
| |    user:        Rudi 
| |    date:        Wed Apr 14 12:09:39 2010 +0200
| |    summary:     Merged
| |
| o  changeset:   3:abd9c586bce0
| |  parent:      1:11e62ba50646
| |  user:        Rudi 
| |  date:        Wed Apr 14 12:09:29 2010 +0200
| |  summary:     branched
| |
o |  changeset:   2:6827b9817642
|/   user:        Rudi 
|    date:        Fri Feb 12 15:30:34 2010 +0100
|    summary:     Something other changed
|
o  changeset:   1:11e62ba50646
|  user:        Rudi 
|  date:        Fri Feb 12 14:28:48 2010 +0100
|  summary:     Something changed
|
o  changeset:   0:b42b1175ba6b
   user:        Rudi 
   date:        Fri Feb 12 14:16:13 2010 +0100
   summary:     Initial

Then you need to merge r4 and r5 to get the final head of this operation.

Rudi
I`m having the error message:abort: can't merge with ancestor[command interrupted]
Please append the output of `hg glog -r90:` and `hg heads` in the original question.EDIT: Adjust `-r90` to one or two revisions before the the two branch point.
Rudi
Can you give more explantation Rudi please. I`m completely new with Mercurial
`hg glog` (=graph log) gives a tree-like representation of the version history. I need it to see where the branches and merges has been. `hg heads` shows the current open heads (open branches) in the repository.
Rudi
Please see the changeset as edited above. The head is C:\HOT>hg summaryparent: 52:6989ebb05b8b tip Final-Add, Edit projectbranch: defaultcommit: (clean)update: (current)
Please replace the log output with the glog output, and put it into <pre> tags. EDIT: If glog is not enabled in your setup please look at http://mercurial.selenic.com/wiki/GraphlogExtension.
Rudi
A: 

hg strip your faulty merge and hg update -C (-C for clean) to any of your previous heads. You can then do the merge again.

It's not clear to me what changesets should be in your bundle or not, it seems you either already have them in your repo or don't have a common ancestor rev with what's in the bundle?

If you do not specify a specific revision hg revert will update a single file to its tip version (the last rev touching that file).

Johannes Rudolph
Instead of stripping, if you have not made any further commits or pushes etc. to the repository yet, it is better to use the built-in `hg rollback` command.
Laurens Holst
My changesets are as follows:105: default tip merge104: backed out chageset 26e351596da9103: revert error102: revert101: remove tabledata100 Merge...........Code from merging99: assignment , changeset 26e351596da998: refactored code97:96:95:............... 94: version 1I wanted to revert back to 94 and then do the merging again. But as I mentioned I`m having the error message. I don`t know how to proceed.
Can I make use of the roll back because after the bad merge I have used the revert and back out as well? I have used it anyway, but still i`m not able to do the merging again!
@user281180 No, it only works for the last transaction. Otherwise, you need to use the strip command from the mq extension.
Laurens Holst
A: 

Note that revert is not the same as update. If you want to retry a merge, don't try to revert to the previous (pre-merge) head, update to it. Then you can try the merge again.

For instance, assuming that A is your common ancestor, B is your branch, C is a branch you've pulled in and want to merge and D is the failed merge.

A -- B ------- D
  \          /
   ------ C -

You were at B, pulled in C, merged C into B and committed as D.

If you want to try the merge again, update to B, merge again and commit as E, leaving you with:

A -- B ------- D
  \          X
   ------ C ----- E

Once you are happy that E works, it's up to you whether you strip out D or leave it there for posterity.

Mark Booth