Import from fossil 3 way merge code
Remove check on return, the caller will have to check to know what to do