views:

55

answers:

1

Hi,

I've pulled the Subversion repository into a local Hg repository while at work. At home, I fixed some stuff, committed into my local Hg repository, and upon coming to work I did a pull and an update.

$ hg pull
$ hg update

I needed to merge, so I did that.

$ hg merge

However, when I tried pushing:

$ hg push
abort: Sorry, can't find svn parent of a merge revision."

What mistake did I make in the workflow? What can I do to avoid the issue in the future?

+2  A: 

If I remember correctly, the sequence is

hg pull 
hg up your_head # update the repo to the head 
hg rebase --svn # rebase your_head onto svn
hg push --svn

When you want to push the changes directly into svn, you first pull the latest changes from svn, then rebase your changes to the svn HEAD and push them back.

[Edit : These commands are not available as a part of standard hg command]

You will need to install hgsubversion Extension.

pyfunc
I guess I should not have used "hg merge", despite Mercurial's suggestion. Also, "hg push " does not seem to accept the --svn argument, so you may want to edit the answer, for other people's use. Also, "hg up" seems to be able to be standalone, without your_head argument.
Ivan Vučica
@Ivan Vučica : I assumed that you have hgsubversion installed. A kick on my head, I should have mentioned that.
pyfunc
I do have hgsubversion or else I would not be able to pull a Subversion repo :-) I'm just saying that "push" does not support --svn, and "up" does not require the head argument. You may want to revise the answer.
Ivan Vučica