export: enable formatter support (API)
This change is basically the same as "hg cat". A formatter object is created
by caller.
.. api::
``cmdutil.export()`` takes a formatter as an argument.
export: extract function to write patch to file object (API)
This is common use case of cmdutil.export(), and we wouldn't want to handle
formatter thingy everywhere.
.. api::
The ``fp`` argument is removed from ``cmdutil.export()``. Use
``cmdutil.exportfile()`` instead.
export: port _exportsingle() to formatter
Pass 'fm' instead of 'write', and use fm.plain(), fm.write(), etc. instead.
The callers will be updated later.
export: serialize revisions to be exported per destination file
Prepares for porting to the formatter API, where we can't simply append
to existing files because JSON can't be streamed for example.
The modemap hack is removed since cmdutil.export() was the only user.
I also made the destination filename printed only once.
export: split cmdutil.export() to single-file and maybe-multiple-files cases
Porting "hg export" to formatter is a bit hard because cmdutil.export() may
append to files if the fntemplate is specified. This patch splits the hard
part from the trivial case.
export: do not start pager if output will be written to file
A copy of
3b569745af6c.