hgmerge: add cleanup functions
This patch adds functions cleanup, success and failure.
The last two of these should be used instead of exit.
Current code was changed to use them.
It also moves $HGTMP to the top of the file (it's used in the cleanup
function), changes the comment and removes now unneeded trap
in the diff+patch merge.
abort: repository a not found!
255
requesting all changes
abort: error: Connection refused
255
abort: repository a not found!
255
abort: destination '../a' already exists
1
abort: repository a not found!
255
abort: destination 'q' already exists