Mercurial 将工作目录中未修改的文件标记为已修改且无法恢复

发布于 2024-11-16 17:50:44 字数 263 浏览 2 评论 0原文

我们的团队在 Windows 上使用 TortoisHg 2.0.5,在刷新工作目录中的文件列表后,有时(至少每天一次 :(( ) 显示已修改的未修改文件列表。手动比较不会显示代码中的任何更改,行恢复这些“fantom”文件也不会导致任何结果,我们有两种方法来处理此问题:

  1. 关闭 eol 扩展并恢复文件,
  2. 手动删除文件并从头版本中更新它们。

每天这样做真的很烦人(每天两次...三次...),特别是在大型变更集上,请帮助找到问题的原因。

Our team uses TortoisHg 2.0.5 on Windows and after refreshing file list in working directory it sometimes (at least once a day :(( ) shows a list of unmodified files as modified. Manual comparison doesn't show any changes in code, line breaks are also equal. Reverting of these "fantom" files causes no result. There a two way how we deal with this problem:

  1. Turning off eol extension and reverting the files,
  2. Manually removing the files and update them from the head revision.

It's really annoying to do this every day (twice ...three times... per day), especially on large changeset! Please help to find a reason of the problem.

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

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

发布评论

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

评论(1

贪恋 2024-11-23 17:50:44

第一个问题是,您是否专门在 Windows 上工作,如果是,您确定需要 eol 扩展吗?

至于您看到的问题,来自 这一系列电子邮件,看起来eol扩展使用LF作为其默认存储库编码,这可能会让 Mercurial 认为您在 Windows 上创建的、以 CRLF 结尾的文件已更改。要更改此设置,请将以下部分添加到您的 .hgeol 文件中:

[repository]
native = CRLF

我尝试了以下测试,类似于我的链接中的测试(启用了 eol 扩展):

> hg init eols
> cd eols
# used notepad++ to save a test file "foo" with Windows line endings (CRLF)
> hg commit -Am "added foo with CRLF"
> hg status
> echo [patterns] > .hgeol
> echo ** = native >> .hgeol
> hg status
  M foo       # spurious difference!
  ? .hgeol
> echo [repository] >> .hgeol
> echo native = CRLF >> .hgeol
> hg status
  ? .hgeol

The first question is, are you working exclusively on Windows, and if so, are you sure you need the eol extension?

As for the problem you're seeing, from this series of emails, it looks like the eol extension uses LF as its default repository encoding, which probably makes Mercurial think your created-on-Windows, CRLF-ending files have changed. To change this, add the following section to your .hgeol file:

[repository]
native = CRLF

I tried the following test, similar to the one in my link (with eol extension enabled):

> hg init eols
> cd eols
# used notepad++ to save a test file "foo" with Windows line endings (CRLF)
> hg commit -Am "added foo with CRLF"
> hg status
> echo [patterns] > .hgeol
> echo ** = native >> .hgeol
> hg status
  M foo       # spurious difference!
  ? .hgeol
> echo [repository] >> .hgeol
> echo native = CRLF >> .hgeol
> hg status
  ? .hgeol
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文