mergestate: use an early return for trivial merges
`filemerge.filemerge()` returns `None` if no merge was needed because
the two sides were identical. I'd like to move that to the
caller. This is a little refactoring to prepare for that.
Differential Revision: https://phab.mercurial-scm.org/D12153
# Files that just need to be migrated to the formatter.
# Do not add new files here!
mercurial/cext/manifest.c
mercurial/cext/osutil.c
# Vendored code that we should never format:
syntax: glob
contrib/python-zstandard/**.c
contrib/python-zstandard/**.h
hgext/fsmonitor/pywatchman/**.c
mercurial/thirdparty/**.c
mercurial/thirdparty/**.h
mercurial/pythoncapi_compat.h