TortoiseSVN diff 因“行结束样式不一致”而失败
两个问题:
如何让TortoiseSvn diff工具忽略EOL风格?
如何在 PVCS 到 SVN 转换过程中修复混合 EOL 样式文件?
我刚刚使用优秀的免费 Polarion 转换工具将 PVCS 存档导入到 Subversion。一切看起来都很好,只有一件烦人的事情我想解决。
原始 PVCS 存档中的一些 cpp 文件具有混合 EOL 样式(由于 PVCS 合并工具)。现在,使用 autoprops 设置“svn:eol-style=native”将这些文件(及其所有修订版)复制到 Subversion 存档中。
当我使用 TortoiseSvn diff 来查看两个版本之间的差异时,我收到错误消息“行结束样式不一致”。
将 10 年修订历史记录从 PVCS 转换为 Subversion 的整个想法是让程序员轻松查看过去进行了哪些更改 - 如果您需要在进行差异之前手动清理旧文件,这是行不通的。
警告: EOL 样式的真正问题在于读取 PVCS 存储库并生成 Subversion 转储文件的 java 转换器。它采用 autoprops 设置并将它们应用于您指定的文件类型 - 在我的例子中是 eol-native 属性 - 即使文件具有混合 EOL。通常 svn 在提交时检查这一点,并确保文件在提交之前被清理。
经验教训:从 PVCS 转换为 subversion 时不要使用 eol-stype autoprops。如果您需要它,请在转换完成后添加它,并在此过程中清理文件。
Two questions:
How to make the TortoiseSvn diff tool ignore the EOL style?
How to fix mixed EOL style files during the conversion from PVCS to SVN?
I've just imported a PVCS archive to Subversion using the excellent free Polarion conversion tool. Everything looks fine, there is just one annoying thing that I'd like to fix.
Some of the cpp files in the original PVCS archive have mixed EOL styles (due to the PVCS merge tool). These files (and all their revisions) are now copied into the Subversion archive using the autoprops setting "svn:eol-style=native".
When I use the TortoiseSvn diff to see a difference between two versions I get the error message "Inconsistent line ending style".
The whole idea of converting 10 years of revision history from PVCS to Subversion is to make it easy for the programmers to see what changes were made in the past - and if you need to clean-up an old file manually before a diff is possible, it's not going to work.
WARNING: The REAL problem with the EOL styles is in the java converter that reads the PVCS repository and generates the Subversion dump files. It takes the autoprops settings and applies them to the file types you specified - in my case the eol-native property - EVEN if the files have mixed EOL. Normally svn checks for this on commit and makes sure that files are cleaned-up before they are committed.
Lesson learned: Do NOT use the eol-stype autoprops when converting from PVCS to subversion. If you need it then add it after the conversion is completed and get the files cleaned in the process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 WinMerge 作为 Tortoise 的 diff 工具,它有一个选项可以将所有 EOL 样式视为等效。
I use WinMerge as Tortoise’s diff tool and it has an option to treat all EOL styles as equivalent.
警告:EOL 样式的真正问题在于读取 PVCS 存储库并生成 Subversion 转储文件的 java 转换器。它采用 autoprops 设置并将它们应用于您指定的文件类型 - 在我的例子中是 eol-native 属性 - 即使文件具有混合 EOL。通常 svn 在提交时检查这一点,并确保文件在提交之前被清理。经验教训:从 PVCS 转换为 subversion 时不要使用 eol-stype autoprops。如果您需要它,请在转换完成后添加它,并在此过程中清理文件。
WARNING: The REAL problem with the EOL styles is in the java converter that reads the PVCS repository and generates the Subversion dump files. It takes the autoprops settings and applies them to the file types you specified - in my case the eol-native property - EVEN if the files have mixed EOL. Normally svn checks for this on commit and makes sure that files are cleaned-up before they are committed. Lesson learned: Do NOT use the eol-stype autoprops when converting from PVCS to subversion. If you need it then add it after the conversion is completed and get the files cleaned in the process.