cat: default to working dir parent instead of tip
This introduces a defaultrev function that chooses
the working dir parent if a revision isn't specified,
and uses it in several places.
#!/bin/sh
echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH
hg init a
cd a
echo 'base' > base
hg ci -Ambase -d '1 0'
hg qnew -mmqbase mqbase
hg qsave
hg qrestore 2