简体   繁体   中英

Mercurial and Subversion: changing, committing, pulling from SVN, pushing, “Sorry, can't find svn parent of a merge revision.”

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM