使用 HG Subversion 推送到 SVN 时的工作流程

发布于 2024-10-15 18:05:24 字数 1156 浏览 5 评论 0原文

这个问题与this问题中提出的问题非常相似,但是我在使用解决方法后遇到了一些问题。

问题:

基本上我有一个 subversion 服务器和一个 Mercurial 本地客户端。扩展 hg-subversion 允许 Mercurial 充当 Subversion 客户端。这对我来说是理想的,因为我可以从我的 subversion 开发分支中创建无限的功能分支,并根据我的选择将它们合并到一起。

由于 subversion 的限制,我无法将分支合并提交到 subversion 存储库。事实上,我不需要提交每个分支合并,我只想将“默认”分支头提交到 SVN。

建议的解决方案:

用户 Harvey 建议的解决方法是修改我的工作流程,以包含用于开发的 hgsubversion 克隆的仅 hg 克隆。

引用哈维的话:

诀窍是学习修改后的 hg<->hgsubversion<->svn 工作流程。一旦你“了解”了它的工作原理,你就不会有任何麻烦了。您只需再键入一些命令即可。实际上,我已经开始编写脚本来使这个过程(这是重复的)变得更容易。典型流程:[在“hg”存储库中]提交一堆更改;将它们推送到“hgsubversion”; [切换到“hgsubversion”] hg update(hgsubversion需要这个); hg Push 到“svn”(在您推送并本地删除变更集后,它会自动重新拉取); [切换回“hg”] hg 从“hgsubversion”拉取; hg 删除旧的重复项 b/c“hg”不是 hgsubversion 克隆,并且不知道自动删除旧的更改集。

我遇到的问题

我在从 hgsubversion 运行 hg Push 到 svn 存储库时遇到了困难。我仍然收到错误消息“中止:抱歉,找不到合并修订版的 svn 父级。”

不可否认,我并不是 100% 了解 hgsubversion 如何将修订版本推送到 svn。老实说,我想看看我的本地副本推送到 svn 服务器的状态。

哈尔普?

This question is very similar to the one posed in this question, but I'm having some issues following the workaround.

The Problem:

Basically I have a subversion server and a mercurial local client. The extension hg-subversion allows mercurial to act as a subversion client. This is ideal for me because I can make unlimited feature branches off my subversion development branch and merge them in as I choose fit.

Due to a limitation of subversion, I cannot commit a branch merge to a subversion repository. In fact, I don't need to commit every branch merge, I just want the "default" branch head to be committed to SVN.

The Proposed Solution:

A workaround user Harvey recommended was to modify my workflow to include an hg-only clone of a hgsubversion clone for development.

To quote Harvey:

The trick is to learn the modified hg<->hgsubversion<->svn workflow. Once you "get" how it works, you won't have any trouble. You'll just type a few more commands. I've actually started writing scripts to make the process (which is repetitive) easier. Typical flow: [in "hg" repo] commit a bunch of changes; push them to "hgsubversion"; [switch to "hgsubversion"] hg update (hgsubversion needs this); hg push to "svn" (which automatically re-pulls after you push and removes your changesets locally); [switch back to "hg"] hg pull from "hgsubversion"; hg strip the older duplicates b/c "hg" isn't an hgsubversion clone and doesn't know to automatically strip the old changesets.

The Issue I'm Running Into:

I'm getting stuck at the point where I run hg push from hgsubversion to the svn repository. I'm still getting the error message, "abort: Sorry, can't find svn parent of a merge revision."

Admittedly I'm not 100% on how hgsubversion pushes revisions to svn. Honestly I'd like to see the state my local copy is in pushed to the svn server.

Halp?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柠檬 2024-10-22 18:05:24

我决定出于存档目的回答我自己的问题(以及那些有相同问题的人)。

我发现另一个类似的问题,答案很简单,你不能做吧。如果这对您有帮助,请参阅上面的链接并为 Eric-Karl 的答案投票。他确实提供了一种恢复方法。

I have decided to answer my own question for archival purposes (and for those having the same issue).

I found another similar question where the answer was simply stated, you can't do it. Please refer to the above link and up-vote Eric-Karl's answer if this was helpful to you. He does offer a work-around to recover.

寄居者 2024-10-22 18:05:24

使用 HgSubversion 知识

如果我正确理解了问题,hgsubversion 只会推送到您当前的版本。

例如,如果您完成了 10、11、12,然后从 dev 分支合并了 13。你可以

hg up 12
hg push

由于它进行变基等的方式,你最终会推送到 12,然后更新到 13,但这对我有用。

新的 hg 功能

使用 mercurial Phases 并将您不想推送的修订标记为秘密。当然,这也会阻止您推送到其他存储库。

使用公司政策

我们工作中的另一个好情况是所有代码提交都必须有审阅者和问题。如果某些内容不是为 svn 设计的(但在我们的团队/spike 存储库中),那么我不会将该信息放入其中,并且任何意外都会因预提交挂钩失败而停止。

Using HgSubversion knowledge

If I understand the question correctly, hgsubversion will only push to your current revision.

e.g. if you've done 10,11,12,and then merged a 13 from a dev branch. You can

hg up 12
hg push

Due to the way it'll do the rebases etc, you'll end up pushing to 12 and then being updated to 13, but it works for me.

New hg functionality

Use the mercurial phases and mark the revisions you don't want to push as secret. Of course this will prevent you from pushing to other repositories as well.

Use corporate policy

The other nice situation at our work is that all code commits must have a reviewer and issue. If something is not intended for svn (but is in our team/spike repository), then I don't put that information in and any accidents are stopped by a pre-commit hook failure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文