Question

I have a merging conflict, using Mercurial 1.0.2:

merging test.h
warning: conflicts during merge.
merging test.h failed!
6 files updated, 0 files merged, 0 files removed, 1 files unresolved
There are unresolved merges, you can redo the full merge using:
  hg update -C 19
  hg merge 18

I can't figure out how to resolve this. Google search results instruct to use:

hg resolve

but for some reason my Mercurial (v1.0.2) doesn't have a resolve command:

hg: unknown command 'resolve'

How can I resolve this conflict?

Was it helpful?

Solution

Valid for hg < v1.1 only

There is no need to call any hg commands. Unlike svn, Mercurial does not track conflicted files. If you call hg status, you'll see that the file is simply marked as modified.

Just fix the file by hand and commit.

OTHER TIPS

To highlight an answer in a comment for Hg 1.1+:

For Hg 1.1+ fix the file by hand and then do

hg resolve -m test.h

to mark the file as merged.

Tracking conflicts was introduced in Mercurial 1.1, which is a newer version that you are using (you should really upgrade, Mercurial 1.1. was released in December 2008). In that version you gained the resolve command which works similarly to svn resolve.

As I remember it, Mercurial would leave merge markers (the <<<< and >>>> lines) in your file when there is a conflict, unless you have configured a merge tool. This also applies to newer versions -- I have no merge tool configured and get the merge markers when conflicts occur. I can then manually fix the file and mark it resolved with hg resolve.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top