[issue3236] largefiles: Corrupted largefile is stored on Windows

Stephen Jennings bugs at mercurial.selenic.com
Wed Feb 1 18:06:02 CST 2012

New submission from Stephen Jennings <Stephen.G.Jennings at gmail.com>:

On Windows 7 SP1 and Windows XP SP3, using Mercurial 2.0.1, 2.0.2, or 
Mercurial 2.1, when I add a largefile containing certain text strings, the 
file is corrupted when it is stored. The following commands reproduce the 


echo Create a new repository...
hg init
>>.hg\hgrc echo [extensions]
>>.hg\hgrc echo largefiles=

echo Create files with contents "test\r\ntest"...
>>normal.txt echo test
echo.|set /P ="test" >>normal.txt
copy normal.txt large.txt
copy normal.txt unadded.txt

echo Add the files and commit
hg add normal.txt
hg add --large large.txt
hg commit -m "added"

echo Remove files and update
del normal.txt large.txt
hg update -C

echo Current hashes:
sha1sum normal.txt large.txt unadded.txt


When running the final command, the output is:

3c1b657969707c7b82a184087602baef05dd74e8  normal.txt
307325bdaf62c0e286f79b3d664ae5bef971b340  large.txt
3c1b657969707c7b82a184087602baef05dd74e8  unadded.txt

When I look in the .hg\largefiles directory, the file "3c1b65..." has the 
wrong SHA1:

messages: 18908
nosy: jennings
priority: urgent
status: unread
title: largefiles: Corrupted largefile is stored on Windows
topic: 2.0, largefiles

Mercurial issue tracker <bugs at mercurial.selenic.com>

More information about the Mercurial-devel mailing list