How to handle merges with hgsubversion?

前端 未结 3 1590
逝去的感伤
逝去的感伤 2021-02-03 14:22

I am trying to contribute to a project that uses Subversion. I used Mercurial and its hgsubversion extension to clone the repo. My work takes place on a feature branch.

<
3条回答
  •  失恋的感觉
    2021-02-03 14:41

    I have finally figured out how to get my repository un-wedged after an event like that described in the question, so that I can continue work without having to re-clone the parent repository (which is, obviously, a quite slow operation when you are pulling from Subversion!). If the "tip" of Subversion outruns you so that you cannot push any more, just make sure that you have the built-in "rebase" extension activated in your Mercurial through a $HOME/.hgrc line like this:

    [extensions]
    rebase =
    

    And then you should be able to run this command when your repository gets wedged:

    $ hg rebase --svn
    

    If I understand this correctly, it dissolves your current branch that has taken you away from Subversion HEAD, and rebuilds it atop the branch "tip" in Mercurial that corresponds to the HEAD in Subversion. From there, you can keep working and successfully do pushes again. It has always worked for me so far; let me know if you run into any problems!

提交回复
热议问题