简体   繁体   English

Mercurial + hgsubversion + svn:2个存储库的故事......(或者,替换变更集?)

[英]Mercurial + hgsubversion + svn: A tale of 2 repositories… (or, Replace changesets?)

Scenario: 场景:

I have 2 Hg repositories: one which tracks an SVN repository, say SVN-track , and a local pure-Hg repository into which I pull changesets from the first. 我有2个Hg存储库:一个跟踪SVN存储库,比如SVN-track ,以及一个本地pure-Hg存储库,我从第一个库中提取变更集。

I push changesets from my pure-Hg repo into the SVN-track repo, then I rebase the pushed changesets in the SVN-track repo until the history is nice and straight, so I can push to the SVN repository. 我把变更从我的纯汞回购进入SVN轨道回购,然后我变基在SVN轨道回购的推动的变更,直到历史是好的,直,这样我就可以推到SVN仓库。

After I push to SVN, hgsubversion pulls the changeset back from SVN and strips the original changeset. 在我推送到SVN后,hgsubversion从SVN拉回变更集并剥离原始变更集。 This is how it tracks, I gather (but... why not just keep the original and track it ?). 这是它跟踪的方式,我收集(但是......为什么不保留原始并追踪 ?)。

Problem: 问题:

Now, if you've hung on this long, comes the problem: I want to pull SVN changesets back into the pure-Hg repository, but all the original changesets come back as dupes (but with different node ids) on another head. 现在,如果你已经挂了很长时间,问题就出现了:我想将SVN变更集拉回到纯Hg存储库中,但是所有原始变更集都在另一个头上以dupes(但具有不同的节点ID)的形式返回。 I might be able to rebase all the changesets that I added in the pure-Hg repository, but then I'd lose history and, really, that just seems like way too much work. 我可能能够重新设置我在pure-Hg存储库中添加的所有变更集,但后来我失去了历史记录,而且,实际上,这似乎太过分了。 I could also just live with the pulled-SVN changesets with duplicate content and merge local, but this makes the resulting pushes back to SVN-track harder and harder. 我也可以使用带有重复内容的pull-SVN变更集并合并本地,但这会使得结果更加难以回到SVN轨道

Questions: 问题:

  • Is there some better way to perform this workflow which I can't divine unaided? 有没有更好的方法来执行这个工作流程,我无法独立思考?
  • If not, how do I replace the original changesets that hgsubversion pulls back from SVN in pure-Hg ? 如果没有,我如何替换hgsubversion在纯Hg中从SVN撤回的原始变更集?
  • Why must hgsubversion (a wonderful enabling tool for the most part) pull SVN changesets back just to track them, can't it just keep the original changeset and add a line to .hg/svn/rev_map indicating the original changeset id? 为什么hgsubversion(大部分是一个很好的启用工具)必须将SVN变换集拉回来跟踪它们,它不能只保留原始变更集并在.hg/svn/rev_map添加一行来指示原始变更集ID吗?
  • If so, what is the trick to this? 如果是这样,这是什么诀窍?

The reason hgsubversion needs to pull back the changes is (I expect) because there may have been other changes in svn before you made your push. hgsubversion需要撤回更改的原因是(我预期)因为在你推动之前svn可能还有其他变化。 Every commit in svn includes a 'rebase-to-tip' which could effect your changeset. svn中的每次提交都包含一个“rebase-to-tip”,它可能会影响你的变更集。 Hence it needs to pull it back to get what actually happened and the new changeset IDs. 因此,它需要将其拉回来以获取实际发生的情况和新的变更集ID。

Perfarce (the perforce extension) does something similar, but it merges the original changes with the new tip so the graph actually makes sense. Perfarce(perforce扩展)执行类似的操作,但它将原始更改与新提示合并,因此图形实际上是有意义的。 There's still duplicates of all the changes I make though. 尽管如此,我仍然会对所有更改进行重复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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