hg-fast-export.sh: minor clean up and code optimization