views:

55

answers:

1

Short version of the question: Since I already have TortoiseHg, I right clicked on that file trying to see the merge conflict visually, but there is no way to see it?

Details:

To make a simple case of merge conflict, I hg init a repo on Win 7, and then clone it to another folder.

Now, in one working directory, i added the line "the code is 123", committed.

And in the other folder, i did an "hg pull" and "hg update"

Now, I go back to the first folder, and change "123" to "123abc", and then do an "hg commit"

And then I go to the other folder and edit "123" to "123xyz" over there, and do an "hg commit", and when "hg push", it says it can't.

So I try to use any visual tool to see how the conflict is like, but ... TortoiseHg doesn't seem to have any option to do that?

+2  A: 

There isn't a conflict yet. Same as svn or cvs you need to fetch changes into the second repository before you can commit back to the first and it's this that creates the conflict. In the second repository, you need to

  1. hg pull to fetch the 123abc change from your first repository; this'll be created in repoistory 2 as a new branch
  2. hg merge to merge the changes - now there's a conflict that you need to resolve
  3. hg commit to commit the resolution of the conflict

and now you can hg push.

Rup
at which point of 1, 2, 3, can I do a visual inspect of the conflict? I actually did a pull... on the command line, and hg merge, which says it has 3 heads... if I use `hg merge -r 14` then kdiff3 will pop out... is this kdiff3 part of TortoiseHg? I kind of wanted to "right click" on the file to start the merge tool... but there seems to be no way?
動靜能量
kdiff3 is included with TortoiseHg, yes, but you can probably configure it to use a different merge tool. The conflict only exists during step 2; the point is that your conflicting changes are imported into the repository as a new branch head and you have to manually merge them together (step 2). Merge is pretty well hidden with Tortoise: open the repository explorer, select your head revision then right-click on the imported branch head. Only then do you get the "merge with" option.
Rup