localrepo: refactor prepush logic
Simplifies the prepush check logic and makes it a lot more direct and
comprehensible. Instead of comparing the total local vs. remote head count, it
compares the number of new vs. removed heads.
#!/bin/sh
"$TESTDIR/hghave" symlink || exit 80
hg init a
ln -s a link
cd a
echo foo > foo
hg status
hg status ../link