当其他团队成员只是在 SVN 上工作时,在本地使用 Hg 并推送到 SVN 存储库——这可能吗?
我在 SO 上发现了看起来非常相似的问题,并且答案似乎很好;但由于某种原因,我似乎仍然不知道如何让它发挥作用。我担心的是,这可能根本不可能。
情况是这样的:我正在一个小团队工作,该团队使用中央 SVN 存储库作为我们的版本控制系统。我和我的结对程序员对没有本地提交选项感到沮丧(并且不想经历使用 SVN 分支的麻烦),因此我们考虑使用 Git 或 Mercurial 作为 SVN 客户端,并发现 hgsubversion似乎能够做我们想做的事情:在 Hg 存储库上本地工作,本地提交,并且只在准备好时推送到 SVN。
当推送的时候,我们收到了来自 Hg 的错误消息:
Sorry, can't find svn parent of a merge revision.
我想知道问题是否是我们必须从 SVN 中提取更改以获取队友的更新,然后与我们本地的更改合并,现在 Hg 可以了。不知道如何让 SVN 满意吗?这似乎是我从其他问题和问题中得到的信息。我看过的答案;然而,在这些情况下给出的建议(执行hg rebase --svn
)似乎对我们也不起作用;给出了相同的“找不到 svn 父级”消息。
这可能吗?或者,当团队中的其他开发人员直接对 SVN 进行更改时,是否会带来更多麻烦?
I've found what appear to be very similar questions here on SO, with what appear to be good answers; but for some reason, I still can't seem to figure out how to get this to work. My concern is that it may simply not be possible.
Here's the situation: I am working on a small team that uses a central SVN repository as our version control system. My pair programmer and I got frustrated not having the option of local commits (and didn't want to have to go through the hassle of using SVN branches), so we looked into using either Git or Mercurial as an SVN client and found that hgsubversion seems capable of doing what we want: to work locally on an Hg repository, commit locally, and only push to SVN when we're ready.
When the time came to push, we received this error message from Hg:
Sorry, can't find svn parent of a merge revision.
I'm wondering if the problem is that we had to pull changes from SVN to get our teammates' updates, then merge with our local changes, and now Hg can't figure out how to make SVN happy? This seems to be the message I'm getting from the other SO questions & answers I've looked at; however, the advice that was dispensed in those cases (doing hg rebase --svn
) seems not to work for us either; that same "can't find svn parent" message is given.
Is this even possible? Or is it more trouble than it's worth when other developers on the team are making changes directly to SVN?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我这样做已经一年多了,效果很好。我得到了甜蜜、甜蜜的 DVCS 爱,而其他人,呃……没有。我使用 hgsubversion 作为我的桥梁。我在使用 hg-svn 时遇到了一些麻烦。 YMMV。
我使用这个进行设置,从那时起就一直喜欢它!
需要注意的是,您不能使用 Mercurial 来合并分支之间的更改。您仍然可以在分支上工作(使用
hg up [some-branch]
),但是当需要将其合并到主干时,您需要提交、推送到some-分支
,然后使用 subversion 将some-branch
合并到主干中。我准备了一篇博客文章,详细描述了此过程。您可以在这里看到它: http://xinmyname.tumblr.com /post/11305033055/subversion-mercurial-branches-oh-my
祝你好运!
I've been doing this for over a year now and it works great. I get sweet, sweet DVCS love and the rest of the folks, uh... don't. I use hgsubversion as my bridge. I had quite a bit of trouble with hg-svn. YMMV.
I used this to get setup and have been loving it ever since!
The caveat is, you can't use Mercurial to merge changes between branches. You can still work on the branch (use
hg up [some-branch]
), but when it comes time to merge it into trunk, you'll need to commit, push tosome-branch
, then use subversion to mergesome-branch
into trunk.I've prepared a blog post that describes this procedure in detail. You can see it here: http://xinmyname.tumblr.com/post/11305033055/subversion-mercurial-branches-oh-my
Good luck!
问题是 hgsubversion 无法将合并从 Mercurial 推送到 Subversion。只要您不创建任何合并变更集,一切都应该正常工作。 (FWIW Subversion 合并工作正常,因为 hgsubversion 只是忽略合并信息并创建常规的单父变更集。)您所描述的问题是 hgsubversion 的已知限制之一;其他列在
hg help subversion
中。为了解决这个问题,您可能需要考虑使用
rebase
扩展来确保推送的历史记录是完美线性的。The problem is that hgsubversion can't push merges from Mercurial to Subversion. As long as you don't create any merge changesets, everything should work fine. (FWIW Subversion merges work fine, as hgsubversion simply disregards the merge info and creates regular, single-parent changesets.) The problem you are describing is one of the known limitations of hgsubversion; others are listed in
hg help subversion
.In order to work around this, you might want to consider using the
rebase
extension to ensure that the history to push is perfectly linear.