#!/bin/sh cat > writelines.py <> $HGRCPATH echo "mq=" >> $HGRCPATH echo "[diff]" >> $HGRCPATH echo "git=1" >> $HGRCPATH hg init repo cd repo echo % qimport non-existing-file hg qimport non-existing-file echo % build diff with CRLF python ../writelines.py b 5 'a\n' 5 'a\r\n' hg ci -Am addb python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n' hg diff > b.diff hg up -C echo % qimport CRLF diff hg qimport b.diff hg qpush