Mercurial > hg
view tests/test-inotify-lookup.t @ 19156:ed1a212193dc stable
subrepo: open files in 'rb' mode to read exact data in (issue3926)
Before this patch, "subrepo._calcfilehash()" opens files by "open()"
without any mode specification. This implies "text mode" on Windows.
When target file contains '\x00' byte, "read()" in "text mode" reads
file contents in without data after '\x00'.
This causes invalid SHA1 hash calculation in "subrepo._calcfilehash()".
This patch opens files in 'rb' mode to read exact data in.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 09 May 2013 21:09:58 +0900 |
parents | a9e830ecd9fb |
children |
line wrap: on
line source
$ "$TESTDIR/hghave" inotify || exit 80 $ hg init $ echo "[extensions]" > .hg/hgrc $ echo "inotify=" >> .hg/hgrc $ hg inserve -d --pid-file .hg/inotify.pid $ echo a > a $ hg ci -Aqm0 $ hg co -q null $ hg co -q $ hg st $ cat a a $ "$TESTDIR/killdaemons.py" .hg/inotify.pid