[issue2504] diff and state show changes when EOL extension and LF->CRLF enabled

Vsevolod Parfenov bugs at mercurial.selenic.com
Wed Nov 17 20:49:16 UTC 2010


New submission from Vsevolod Parfenov <vsevolodp at gmail.com>:

Windows 7, hg 1.6.4
extensions enabled: fixfrozenexts

I need to keep files with Unix-style EOLs in repo.
But need some of them to be always with Windows-style EOLs in working 
directory.

So I tell eol:
[patterns]
**.txt = CRLF
[repository]
native = LF

When file being updated EOLs become Windows-style but hg shows difference in 
EOLs.

How to reproduce (Windows):
file.txt - file with UNIX eols (see attachment)

1) init repo

C:\>hg init test
C:\>cd test
Put file.txt in working dir
C:\test>hg add
adding file.txt
C:\test>hg ci -m"File with UNIX eol"

2) enable and configure eol extension

C:\test>echo [extensions]> .hg\hgrc
C:\test>echo eol = >> .hg\hgrc

C:\test>echo [patterns]> .hgeol
C:\test>echo **.txt = CRLF>> .hgeol
C:\test>echo [repository]>> .hgeol
C:\test>echo native = LF>> .hgeol

C:\test>hg st
M file.txt
? .hgeol

C:\test>hg add .hgeol
C:\test>hg ci -m"eol extension enabled" -I .hgeol

3) see how things works

3.1) no conversion yet
C:\test>hg st
M file.txt

This is correct: file has UNIX-style EOLs but mus have CRLFs.

Result of EOL conversion can be seen like this:
>notepad file.txt
If file has LF EOLs then content shown in one line.

3.2) EOLs converted
C:\test>hg up -C
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Now EOLs changed to CRLF.

C:\test>hg st
M file.txt

As I see in Notepad++ file "file.txt" has now Windows EOLs as intended.

But diff must not show that file has changed. Changes in eol configured in 
.hgeol

----------
files: file.txt
messages: 14443
nosy: vsevolodp
priority: bug
status: unread
title: diff and state show changes when EOL extension and LF->CRLF enabled
topic: 1.6.4, eol

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2504>
____________________________________________________
-------------- next part --------------
line1
line2


More information about the Mercurial-devel mailing list