changeset 35385:c7d49b87c1ee

tests: use Python to write binary data in lfs test instead of shell The shell construct here appears to be unevenly supported: it works in /bin/sh on FreeBSD, but it doesn't seem to work when /bin/sh is dash. Using a Python inline directive works fine, so let's just do that instead. Differential Revision: https://phab.mercurial-scm.org/D1636
author Augie Fackler <raf@durin42.com>
date Sat, 09 Dec 2017 19:42:51 -0600
parents ea645c6c6d46
children c0b6fa74e007
files tests/test-lfs.t
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-lfs.t	Sun Dec 10 05:41:05 2017 +0530
+++ b/tests/test-lfs.t	Sat Dec 09 19:42:51 2017 -0600
@@ -232,9 +232,10 @@
   $ hg mv b1 a2
   $ hg commit -m b
   $ hg status
-  $ HEADER=$'\1\n'
-  $ printf '%sSTART-WITH-HG-FILELOG-METADATA' "$HEADER" > a2
-  $ printf '%sMETA\n' "$HEADER" > a1
+  >>> with open('a2', 'wb') as f:
+  ...     f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
+  >>> with open('a1', 'wb') as f:
+  ...     f.write(b'\1\nMETA\n')
   $ hg commit -m meta
   $ hg status
   $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'