view tests/test-rebuildstate.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 f2719b387380
children ddc17eaf0f1b
line wrap: on
line source

basic test for hg debugrebuildstate

  $ hg init repo
  $ cd repo

  $ touch foo bar
  $ hg ci -Am 'add foo bar'
  adding bar
  adding foo

  $ touch baz
  $ hg add baz
  $ hg rm bar

  $ hg debugrebuildstate

state dump after

  $ hg debugstate --nodates | sort
  n 644         -1 bar
  n 644         -1 foo

status

  $ hg st -A
  ! bar
  ? baz
  C foo

  $ cd ..