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

login
register
mail settings
Submitter Matt Harbison
Date Oct. 29, 2017, 5:09 a.m.
Message ID <a716ac96572847d8cf72.1509253783@Envy>
Download mbox | patch
Permalink /patch/25303/
State Accepted
Headers show

Comments

Matt Harbison - Oct. 29, 2017, 5:09 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@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.

Patch

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