我们在 SVN 存储库中维护更大的代码库。
对于版本,我们只想将版本标签/分支推送到 Mercurial 存储库中,不包括主干中的历史记录。
我对 DVCS 缺乏经验,所以也许我的尝试走错了路。如果您能指出缺陷或指出替代方案,我将非常高兴。
这是我到目前为止所尝试的:
-
hg Convert 扩展:使用 hg Convert
转换了完整的存储库,其中应根据转换扩展文档提取完整的历史记录,包括分支和标签。但是hg标签
仅返回tip和默认,hg分支
仅返回默认。而且,它非常慢(是的,我读到了 svnsync),并且它包含完整的历史记录。我读到它可以用于增量拉取,但我不认为这对我有用。
-
hg 转换扩展:转换标签并从另一个标签中提取可以使用 -f
但我不太相信它。它是否正确处理删除?
-
hgsubversion:完整存储库的hg clone
也不包括标签和分支
hgsubversion:标签上的 hg clone
有效,但无法从另一个标签中提取(< em>中止:无法在存储库中的不同路径上工作)
提前感谢您的指点。 “菜鸟,先读一下这篇文章,稍后再回来”也受到赞赏。
We maintain a larger code base in a SVN Repository.
For releases, we want to push only the release tag/branch into a Mercurial Repository, excluding the history from the trunk.
I have little experience with DVCSs, so maybe I'm on the wrong track with what I tried. If you can point out flaws or point to alternatives I'd be very happy.
Here is what I tried so far:
-
hg convert extension: Converted the complete repository using hg convert <base project URL w/o "trunk">
which should pull the complete history including branches and tags according to the convert extension documentation. But hg tags
only returns tip and default, hg branches
only default. Also, it is quite slow (yes, I read about svnsync
) and it includes the complete history. I read that it can be used to pull incrementally, but I don't see that working for me.
-
hg convert extension: Converting a tag and pulling from another tag works w/ -f
but I don't really trust it. Does it handle deletions correctly?
-
hgsubversion: hg clone
of the complete repository excludes tags and branches as well
-
hgsubversion: hg clone
on a tag works, but then pulling from another tag is not possible (abort: unable to work on a different path in the repository)
Thanks in advance for pointers. "Noob, go read this first and come back later" is appreciated as well.
发布评论
评论(1)
回答我自己的问题:我找到了一种方法来实现我所需要的。
假设我们有一个空的 hg 存储库,我想将基线交付到其中,我添加一个过滤所有 svn 元数据的
.hgignore
文件:然后执行以下操作:
svn co <tag url> ; .
hg addremove
hg commit -m"pulled rev."
hg tag
用于后续版本我这样做:
svn switch; .
hg addremove
,hg commit
&hg tag
如上所述这使我可以在 hg 存储库中的修订版之间来回切换,并且我有基线之间更改文件的历史记录,但在 svn 提交级别上没有。
对此有何意见?
谢谢。
Answering my own question: I found a way to achieve what I need.
Assuming we have an empty hg repository into which I want to deliver my baseline, I add an
.hgignore
file that filters all svn metadata:Then I do the following:
svn co <tag url> .
hg addremove
hg commit -m"pulled rev. <tag>"
hg tag <tag>
For subsequent releases I do:
svn switch <tag url> .
hg addremove
,hg commit
&hg tag
as aboveThis gives me the possibility to switch back and forth between revisions within my hg repository and I have a history of changed files between the baselines but not on svn commit level.
Any opinions on this?
Thanks.