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?
To resolve the conflict, we open 'hello. c' in an editor, delete the conflict markers and keep the "sure am glad I'm using Mercurial!\ n" line, deleting the line about CVS. We can then save and quit the editor.
To fix this situation, you need to create new commits that mimic those on the branch. The easiest way to do that is with git rebase -f . Now you can merge branch in again.
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.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With