cvs2svn 失败并显示“xxx 不是有效的 ,v 文件”
当我想发帖的时候终于找到了我的问题的答案! 不过,我仍然会发布它,包括我的答案,以防它对其他人有帮助:
当从 CVS 转换为 Subversion cvs2svn 在某些文件上失败时,并显示消息
"xxx is not a valid ,v file"
What's the Problem?
I finally found an answer to my question when I wanted to post it! However I'll still post it, including my answer, in case it helps someone else:
When converting from CVS to Subversion cvs2svn failed on some files with the message
"xxx is not a valid ,v file"
What's the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
事实证明,CVSNT 忽略了 cvs2svn 需要的某些文件中的最后一个 0xa。 使用以下 C# 代码可以轻松修复此问题:
As it turns out CVSNT omits the last 0xa from some files where cvs2svn needs them. This can be easily fixed with the following c# code:
就我而言,
xxx,v
文件的symbols
部分已损坏。 预期格式为tag_name:tag_rev
,但存在以下情况::tag_rev
例如
tag_name
通过删除该行来修复。
tag_name
例如
tag_name1:tag_name2:tag_rev< /code>
通过删除第二个标签名称来修复(您删除的标签名称可能取决于它们是什么)。
z
(ASCII:
和z
之间只有 1 位差异)。eg < code>tag_nameztag_rev
通过将
z
替换为:
进行修复。为了在调查过程中提供帮助,我在
cvs2svn_rcsparse\common.py
中添加了print
行。 如果解析符号失败,则原因是最后打印的标签。额外的打印会给输出添加相当多的噪音,因此仅在发生异常时打印可能会更好,但这足以满足我的需求。
我还发现这个链接,结果不是我的问题,但可能对其他人有帮助。 感谢 Christian Haarmann 对其进行了记录。
http://tigris-scm.10930.n7.nabble.com/suggestions-for-cvs2svn-fix-for-error-quot-myfile-txt-v -is-not-a-valid-v-file-quot-td54240.html
如果链接无效,摘要是有人编辑了
xxx,v
文件及其编辑器已将 0x0A (LF) 替换为 0x0D/0x0A (CR/LF),附加字符导致解析器认为文件已损坏。In my case there was corruption in the
symbols
section of thexxx,v
file. The expected format istag_name:tag_rev
, but there were instances of::tag_rev
e.g.
tag_name
Fixed by deleting the line.
tag_name
e.g.
tag_name1:tag_name2:tag_rev
Fixed by removing the second tag name (which one you remove probably depends on what they are).
z
(there is only 1-bit difference between ASCII:
andz
).e.g.
tag_nameztag_rev
Fixed by replacing the
z
with:
.To help during my investigation I added a
print
line tocvs2svn_rcsparse\common.py
. If parsing the symbols fails, the last tag printed is the cause.The additional print adds quite a lot of noise to the output so it might be nicer to only print if an exception happens, but this was good enough for my needs.
I also found this link which turned out to not be my problem but may help someone else. Credit to Christian Haarmann for documenting it.
http://tigris-scm.10930.n7.nabble.com/suggestions-for-cvs2svn-fix-for-error-quot-myfile-txt-v-is-not-a-valid-v-file-quot-td54240.html
In case the link becomes invalid, the summary is that someone had edited the
xxx,v
file and their editor had replaced 0x0A (LF) with 0x0D/0x0A (CR/LF), and the additional character caused the parser to think the file was corrupt.我也有这样的错误。 当我使用 cvs2git 将 cvs 存储库迁移到 git 时,多个文件都会出现此错误。 我检测到文件末尾缺少结束 0x40 (@)。
所以我的解决方案是:
如果这不能解决问题,则将损坏文件的内容与 RCS 文件格式进行比较: rcs_man_page
I've also such an error. When I use cvs2git in order to migrate a cvs repository to git, this error occurs for several files. I have detected that there is missing a closing 0x40 (@) at the end of file.
So my solution is:
If this doesn't fix the problem, then compare the content of the corrupted file with the RCS-file format: rcs_man_page
解决此问题的一种方法是运行 rcs log *file,v* ,这可能会为您提供一些见解。
就我而言,我有一些文件缺少@,一些文件缺少分号,并且我用来将旧存储库导入到 cvspserver 的工具已抛出未引用的版本。
祝你好运!
One way to troubleshoot this is to run
rcs log *file,v*
, which may provide you some insight.In my case, I had some files missing @'s, some files missing a semicolon, and the tool I used to import my old repository onto the cvspserver had thrown in an unreferenced version.
Good luck!