水银+ MQ EOL 行为

发布于 2024-11-27 21:34:31 字数 616 浏览 1 评论 0原文

我正在 Win+OSX 上使用 Mercurial+mq,EOL 问题快要了我的命。 我已经激活了 EOL 扩展,添加了 .hgeol ,如下所示:

[patterns]
**.sln = CRLF
**.vcproj = CRLF
**.vcxproj = CRLF
**.vcproj.filters = CRLF
**.vcxproj.filters = CRLF
**autoexp.dat = CRLF
**Makefile = LF
** = native

并且一切似乎都工作正常..在 Windows 上(好吧,我有一些文件存在行结尾问题,我在第一个补丁中修复了它们,即包含 .hgeol 的补丁)。也有hgeol)。

然后我转向 Mac,假设它也能在那里工作,对吧?嗯,错了。当我 qpush 第一个补丁(带有“.hgeol”文件 + 行结束更改的补丁)时,它可以工作,但我看到一组“修改”文件(它与我在 Windows 上“修复”的文件完全相同,这样它们就不再显示为修改过的!)。不管怎样,我尝试“hg qrefresh”以获得行更改(以为我稍后会弄清楚)...但没有运气:如果我继续 qpush 我的其他补丁,我会开始收到拒绝:(

知道如何解决这个问题/是什么原因造成的吗?这让我发疯......

I'm working with mercurial+mq, on Win+OSX, and the EOL issues are killing me.
I've activated EOL extension, added .hgeol as shown below:

[patterns]
**.sln = CRLF
**.vcproj = CRLF
**.vcxproj = CRLF
**.vcproj.filters = CRLF
**.vcxproj.filters = CRLF
**autoexp.dat = CRLF
**Makefile = LF
** = native

and everything seemed to work fine .. on Windows (well, I had a few files with line ending issues, I fixed them in the first patch, the one that includes .hgeol too).

Then I moved to Mac, assuming it would work there too, right? Well, wrong. When I qpush the first patch (the one with the ".hgeol" file + the line-ending changes), it works but I see a set of "modified" files (it's the exact same files that I "fixed" on windows, so that they no longer show as modified!). Whatever, I try to "hg qrefresh" in order to get the line changes (thinking I'll figure it out later)... but no luck: how if I go on to qpush my other patches, I start geting rejects :(

Any idea how to fix this/what is causing it? It's driving me crazy....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿忘初心 2024-12-04 21:34:31

我们同意编译器知道如何处理任何新的行格式,甚至是混合格式。
因此,我的建议是:

  1. 保留 Windows 特定文件(.sln.vcproj 等),按照您已经进行的设置
  2. 确保ALL< /strong> 文本编辑器(所有操作系统)都同意同一个换行约定。
  3. 将您使用文本编辑器接触的所有文件转换为新行约定(使用 dos2unix 之类的工具)
  4. 提交更改
  5. 所有现有补丁也应遵守该更改

    a.您可能需要一一应用它们,并再次清理文件并刷新这些补丁,以便换行符也得到修复

在此之后,您应该很好只要

  1. 不< /strong> 使用不同的不合规编辑器编辑相同的存储
  2. 不会通过来自不同操作系统的共享访问相同的存储库并以某种方式使用错误的编辑器...

希望这会有所帮助;)

问候。

Let's agree that the compilers know how to deal with any new line format and even a mix.
So, my suggestion would be:

  1. Leave windows specific files (the .sln, .vcproj, etc.) to be set up as you already did
  2. Ensure ALL text editors (of all OSs) agree on the SAME ONE new line convention.
  3. Convert all the files you touch with text editors to that new line convention (with dos2unix like tool)
  4. Commit that change
  5. All your existing patches should also adhere that

    a. you may need to apply them one by one, and clean up the files again and refresh those patches so the newlines are also fixed

After this you should be good as long as you:

  1. do not edit the same storage with different uncomplying editors
  2. are not accessing the same repo via share from different OSs and somehow use a bad editor...

Hope this helps ;)

Regards.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文