Mercurial将未修改的文件标记为在工作目录中已修改,并且无法还原 [英] Mercurial marks unmodified files as modified in working directory and fails to revert
问题描述
我们的团队在Windows上使用TortoisHg 2.0.5,并在刷新工作目录中的文件列表后有时会使用它(每天至少一次:(()显示已修改的未修改文件的列表.手动比较不显示代码,换行符也相等.还原这些"fantom"文件不会导致任何结果.有两种方法可以解决此问题:
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:
- 关闭eol扩展名并还原文件,
- 手动删除文件并从原始修订版进行更新.
每天这样做(每天两次……每天三次……)真的很烦人,尤其是在大型变更集上!请帮助找到问题的原因.
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.
推荐答案
第一个问题是,您是否仅在Windows上工作,如果是,则确定需要eol
扩展名吗?
The first question is, are you working exclusively on Windows, and if so, are you sure you need the eol
extension?
关于您所看到的问题,来自这一系列电子邮件,看起来eol
扩展名使用LF
作为其默认的存储库编码,这可能使Mercurial认为您创建了Windows,CRLF结尾的文件已更改.要更改此设置,请将以下部分添加到您的.hgeol
文件中:
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
我尝试了以下测试,类似于链接中的测试(启用了eol
扩展名):
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
这篇关于Mercurial将未修改的文件标记为在工作目录中已修改,并且无法还原的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!