cvs2svn 包括单分支和头吗?
我正在使用 cvs2svn 来转换我的存储库。我已经在一个存储库中成功完成了这一任务,现在我的新问题是第二个存储库。
在我的新转换中,我只想转换 HEAD 和一个分支。 cvs2svn 对于分支只有“排除”功能,但没有“包含”功能。我有很多分支,排除每一个分支都需要大量工作......
有什么方法可以只转换主干(HEAD)和一个分支?
谢谢, 奥德
I'm using cvs2svn to convert my repository. I've done it with success in one repository, and now my new problem is a second repository.
In my new conversion, I want to convert only the HEAD and one branch. cvs2svn only have "exclude" function for branches, but not "include". I have many many branches and excluding each and every one of them will take A LOT of work....
is there any way to convert only the trunk (HEAD) and only one branch?
thanks,
Oded
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只想保留一个分支而不保留任何标签,那么这很简单。使用与符号匹配的第一个规则,因此指定要包含的分支,然后排除其他所有内容:
如果您不仅想包含分支,还想包含尽可能多的标签,那么这就有点棘手了。您不仅不必知道所有标记的名称,而且也不能包含依赖于排除分支的标记。在这种情况下,最简单的方法是使用 --write-symbol-info 和 --symbol-hints 选项:
这将创建一个名为“symbol-info.out”的文件,其中包含有关所有 CVS 符号的信息。在编辑器中,打开此文件,找到与要排除的分支相对应的所有行,并将这些行的第三列更改为单词“排除”。确保要包含的分支所在行的第三列包含单词“branch”,第四列是您希望其结束的路径。
现在再次运行 cvs2svn,从第 3 步开始,并使用编辑后的符号信息文件作为符号提示文件:
您将收到很多错误,例如:
现在返回编辑器并更改列出的标签(示例)也被排除,然后尝试再次运行 pass3。此过程可能需要迭代几次,但应该不会很麻烦,因为 pass3 运行得非常快。
当 pass3 顺利完成后,运行剩余的转换:
If you only want to retain the one branch and no tags, then this is easy. The first rule that matches a symbol is used, so specify the branch that you want to be included then exclude everything else:
If you want to include not only the branch but also as many tags as possible, then it is a little bit trickier. Not only don't you necessarily know the names of all of the tags, but you also cannot include tags that are dependent on excluded branches. In this case, it is easiest to work with the --write-symbol-info and --symbol-hints options:
This will create a file called "symbol-info.out" containing information about all CVS symbols. In your editor, open this file, find all of the lines corresponding to branches that you want to exclude, and change the third column of those lines to the word "exclude". Make sure that the third column of the line for the branch that you want to include contains the word "branch" and its fourth column is the path where you want it to end up.
Now run cvs2svn again, starting at pass 3, and using the edited symbol-info file as a symbol hints file:
you will get a lot of errors like:
Now go back into the editor and change the listed tags (BAR_TAG and BAZ_TAG in the example) to be excluded too, then try running pass3 again. This procedure might need to be iterated a couple of times, but it should not be cumbersome because pass3 runs very quickly.
When you have gotten pass3 to complete without errors, run the rest of the conversion:
一个问题是 cvs2svn 不仅需要确定是否包含分支,还需要(同时)首先确定符号是分支还是标签。因此,如果您想包含该一个分支以及一些标签,那么比仅仅说“仅包含该分支”更困难 - 这样做会杀死所有标签。
IOW,cvs2svn 并不真正支持这一点。您可以通过编辑其源代码来解决此问题。在cvs2svn_lib.symbol_strategy.BranchIfCommits中,将其返回Branch(symbol)的情况更改为
IIUC,默认情况下应使用BranchIfCommits。
就我个人而言,我会使用不同的策略:
我不会称之为大量工作......
One problem is that cvs2svn not only needs to determine whether to include a branch or not, but (simultaneously) whether a symbol is a branch or a tag in the first place. So if you want to include that one branch, and also some tags, it's more difficult than just saying "include only that branch" - doing so would kill all tags.
IOW, cvs2svn doesn't really support that. You can work around by editing its source code. In cvs2svn_lib.symbol_strategy.BranchIfCommits, change the case where it returns Branch(symbol) to
IIUC, BranchIfCommits should be used by default.
Personally, I would use a different strategy:
I wouldn't call that a LOT of work...