2

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?

Ivan Vučica
  • 9,529
  • 9
  • 60
  • 111

1 Answers1

5

If I remember correctly, the sequence is

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

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.

Simone
  • 11,655
  • 1
  • 30
  • 43
pyfunc
  • 65,343
  • 15
  • 148
  • 136
  • 1
    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 Oct 04 '10 at 10:02
  • @Ivan Vučica : I assumed that you have hgsubversion installed. A kick on my head, I should have mentioned that. – pyfunc Oct 04 '10 at 16:53
  • 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 Oct 05 '10 at 13:15