fix qrefresh'ing an empty patch
This is not superefficient (the commit will have to walk the whole tree),
but it works.
#!/bin/sh
hg init
hg branch dummy # needed so -r "" doesn't point to the unnamed/default branch
touch a
hg add a
hg ci -m "a" -d "1000000 0"
echo 123 > b
hg add b
hg diff --nodates
hg diff --nodates -r tip
echo foo > a
hg diff --nodates
hg diff -r ""
hg diff -r tip -r ""
true