Verify improvements:
Check existence of parents of changesets and manifests
Count errors
Use ui for display
Catch and count unpack exceptions
Print error count and exit with non-zero status on error
set -ex
export EDITOR=true
rm -rf test branch
mkdir test
cd test
echo foo>foo
hg init
hg addremove
hg commit
hg verify
cd ..
cp -a test branch
cd branch
echo bar>>foo
hg commit
cd ../test
hg merge ../branch
hg verify