man 5 hgrc implied you need to use external tools to do CRLF translation.
This is no longer true; win32text provides a much better in-process alternative.
#!/bin/sh
echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH
hg init a
cd a
hg qnew first.patch
hg qnew first.patch
touch ../first.patch
hg qimport ../first.patch
exit 0