转换 Mercurial 存储库中的行尾模式
我有一个存储库,其中填充了带有 Windows 行尾标记的文件,但我打算使用 Unix EOL 模式。
一种选择是手动 (dos2unix) 更改所有文件,然后提交完全覆盖存储库的更改集。如有必要,我可以这样做,但我想避免这样做。是否可以使用 hg Convert 或其他方式使用不同的 EOL 标记重建存储库?我考虑过导出所有更改,转换这些更改,然后以这种方式重建存储库,但 Mercurial wiki 建议合并更改集上不应信任导出,这似乎排除了该选项。
如果可能的话,我想避免使用 EOL 扩展。
I have a repository that was populated with files with Windows end of line markers, but I intended to use the Unix EOL pattern.
One option is to manually (dos2unix) change all the files, then commit a changeset that completely overwrites the repository. I can do this if necessary, but I'd like to avoid it. Is it possible, using hg convert
or otherwise, to rebuild the repository using a different EOL marker? I considered exporting all of the changes, converting those, and rebuilding the repository that way, but the Mercurial wiki suggests export should not be trusted on merge changesets, which seems to rule out that option.
I want to avoid using the EOL extension if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道您想避免
eolExtension
,但这对我来说似乎是破坏性最小的解决方案:它将确保从现在开始,任何工作副本在
hg update
后都尊重您的 EOL,并且该设置将通过克隆传播。I know you want to avoid the
eolExtension
, but it seems the least disruptive solution to me:It would ensure that, from now on, any working copy respect your EOL after an
hg update
, and that setting would propagate through clones.