#!/bin/sh cat > writelines.py <> $HGRCPATH echo "mq=" >> $HGRCPATH echo "[diff]" >> $HGRCPATH echo "git=1" >> $HGRCPATH echo % build diff with CRLF hg init repo cd repo 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