简体   繁体   English

如何清理CVS供应商分支的进口?

[英]How do I clean up CVS vendor branch imports?

I have a CVS repository with a directory containing two vendor branches. 我有一个CVS存储库,其目录包含两个供应商分支。 The initial code was obtained from one source and checked in with a vendor name say X. Several years later, new code was checked in with another vendor branch name Y. 初始代码是从一个来源获得的,并以供应商名称X检入。几年后,新代码以另一个供应商分支名称Y检入。

If I view the rcs file (FILE,v) in a text editor, I see X:1.1.1, a few tags... and then Y:1.1.1 如果我在文本编辑器中查看rcs文件(FILE,v),则会看到X:1.1.1,一些标签...然后看到Y:1.1.1

This hasn't caused any issues that I'm aware of in using CVS, but now I want to migrate to Subversion using cvs2svn. 这并没有引起我在使用CVS时意识到的任何问题,但是现在我想使用cvs2svn迁移到Subversion。

I get errors from cvs2svn like the following: 我从cvs2svn得到如下错误:

WARNING: in '/home/cvs/src/contrib/one-true-awk/FILES,v': branch '1.1.1' already has name 'Y', cannot also have name 'X', ignoring the latter 警告:在'/ home / cvs / src / contrib / one-true-awk / FILES,v'中:分支'1.1.1'已经具有名称'Y',也不能具有名称'X',而忽略了后者

Ideally, I'd like to use the newer vendor tag Y for the entire history, but I'd also be willing to make it go away and use the older tag. 理想情况下,我想在整个历史记录中使用较新的供应商标签Y,但我也愿意放弃它并使用较旧的标签。 Either way, I need to clean this up so that cvs2svn can convert the repository to Subversion. 无论哪种方式,我都需要清理,以便cvs2svn可以将存储库转换为Subversion。

Are there any commands I can run on the files from CVS to repair this mess or manual steps in the ,v file I can do? 我可以在CVS的文件上运行任何命令来修复此混乱问题,也可以执行.v文件中的手动步骤吗? I've tried removing the newer Y branch line, but that alone doesn't work due to the crazy numbering in the commits. 我曾尝试删除较新的Y分支行,但是由于提交中的疯狂编号,仅此一项是行不通的。 A 1.2 revision was created due to the second import and it's causing cvs2svn to fail as well. 由于第二次导入而创建了1.2修订版,它也导致cvs2svn失败。

I ended up asking on the cvs2svn users mailing list. 我最后问了cvs2svn用户邮件列表。 I received the following response from Michael Haggerty: 我收到了Michael Haggerty的以下回复:

I don't believe that this error can come from importing twice. 我不认为此错误可能源于两次导入。 AFAIK each time you import you would create a new vendor branch; 每次导入AFAIK时,都会创建一个新的vendor分支; eg 1.1.1, 1.1.3, etc. (the last number is always odd for vendor branches), and each vendor branch would get its own symbolic name. 例如1.1.1、1.1.3等(供应商分支的最后一个数字始终为奇数),并且每个供应商分支都将获得自己的符号名称。 The situation you are experiencing is that you have only one vendor branch, 1.1.1, and it somehow has two symbolic names, 'X' and 'Y'. 您遇到的情况是您只有一个供应商分支1.1.1,并且它以某种方式具有两个符号名称:“ X”和“ Y”。

If you tell cvs2svn just to ignore the unwanted symbol name, then the conversion should go through without complaints. 如果您告诉cvs2svn仅忽略不想要的符号名称,则转换应该顺利进行,而不会产生任何抱怨。 To do this, you need to start cvs2svn via the options-file method and then use a IgnoreSymbolTransform. 为此,您需要通过options-file方法启动cvs2svn,然后使用IgnoreSymbolTransform。 See cvs2svn-example.options for documentation. 有关文档,请参见cvs2svn-example.options。

If you want to be super-careful, you might first want to verify that the symbol name that you are ignoring is really redundant in every file. 如果您要非常小心,则可能首先要验证您忽略的符号名称在每个文件中确实是多余的。 Or, I think it would also work to transform the unwanted symbol name into the wanted symbol name, because cvs2svn ignores symbols that appear twice with the same value. 或者,我认为将不需要的符号名称转换为所需的符号名称也将起作用,因为cvs2svn会忽略出现两次且具有相同值的符号。 This would require something like 这需要类似

RegexpSymbolTransform(r'X', r'Y') RegexpSymbolTransform(r'X',r'Y')

I then used the IgnoreSymbolTransform to hide the extra symbols. 然后,我使用IgnoreSymbolTransform隐藏了多余的符号。

Additionally, I ran into a secondary error due to files that had been patched in HEAD and then a newer import occurred. 此外,由于在HEAD中打了补丁的文件,我遇到了第二个错误,然后发生了较新的导入。 By force committing the files, I was able to get them back onto HEAD and avoid this: 通过强制提交文件,我能够将它们放回HEAD并避免了这种情况:

ERROR: File '/home/cvs/src/contrib/one-true-awk/FIXES,v' has default branch=1.1.1 but also a revision 1.2 错误:文件'/ home / cvs / src / contrib / one-true-awk / FIXES,v'的默认分支为1.1.1,但修订版为1.2

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

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