如何使用hgsubversion处理合并? [英] How to handle merges with hgsubversion?

查看:140
本文介绍了如何使用hgsubversion处理合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为使用Subversion的项目做出贡献.我使用Mercurial及其hgsubversion扩展来克隆存储库.我的工作发生在功能分支上.

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.

我该如何使功能分支保持最新状态,以使默认分支(例如,hg)或中继线(svn)中发生的事情保持最新状态?

How do I keep the feature branch up to date with stuff that happens on the default branch (hg speak) aka the trunk (svn speak)?

因此,我使用hg up feature更新到功能分支,然后使用hg pull更新了默认分支上的变更集.因此,我做了hg merge default,提交了合并,然后尝试了hg push,将我的变更集发送到Subversion. Mercurial说:对不起,找不到合并修订的svn父级."

So I used hg up feature to update to the feature branch, then hg pull which gave me changesets on the default branch. So I did hg merge default, the committed the merge, then tried hg push to send my changesets to Subversion. And Mercurial said: "Sorry, can't find svn parent of a merge revision."

推荐答案

我终于想出了如何在问题所述的事件发生后使我的存储库不被楔住,这样我就可以继续工作而不必-clone父存储库(显然,从Subversion中拉出时,这是一个相当慢的操作!).如果Subversion的提示"超出了您的范围,以致您无法再进行任何操作,只需确保通过$ HOME/.hgrc这样的行在Mercurial中激活了内置的"rebase"扩展名即可:

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

如果我正确理解这一点,它将分解使您脱离Subversion HEAD的当前分支,并在Mercurial中对应于Subversion HEAD的分支"tip"之上重建它.从那里,您可以继续工作并成功地再次进行推送.到目前为止,它一直对我有用.让我知道您是否遇到任何问题!

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!

这篇关于如何使用hgsubversion处理合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆