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
--- 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'