[PATCH 2 of 4] test-log-linerange: open binary file in binary mode

Matt Harbison mharbison72 at gmail.com
Sun Oct 29 01:09:43 EDT 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1508549355 14400
#      Fri Oct 20 21:29:15 2017 -0400
# Branch stable
# Node ID a716ac96572847d8cf721d08d10d967e26f5ef21
# Parent  825986c7d37b500910977fc9966619bd26dcaba3
test-log-linerange: open binary file in binary mode

The '\n' characters were being translated on Windows, throwing off hg and git
hashes, as well as the file content in the diff.

diff --git a/tests/test-log-linerange.t b/tests/test-log-linerange.t
--- a/tests/test-log-linerange.t
+++ b/tests/test-log-linerange.t
@@ -800,7 +800,7 @@
 Binary files work but without diff hunks filtering.
 (Checking w/ and w/o diff.git option.)
 
-  >>> open('binary', 'w').write('this\nis\na\nbinary\0')
+  >>> open('binary', 'wb').write('this\nis\na\nbinary\0')
   $ hg add binary
   $ hg ci -m 'add a binary file' --quiet
   $ hg log -f -L binary,1:2 -p


More information about the Mercurial-devel mailing list