Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

dvcs - Mercurial marks unmodified files as modified in working directory and fails to revert

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...