During export, process files in a streamy fashion even when they need
translation.

Previously, translation of such files happened as a separate step in
close_file() and has been creating and using temporary files for that purpose.
For transports like HTTP having a separate step with nothing being read
from the connection puts an implicit limit on the size of the file that can
be exported without hitting a timeout.  Also, we have to create and re-read
those additional temporary files.

(For `svn export`, the scope of the problem is limited, compared to the
 problem with `svn checkout` or `svn update` described in r1886490,
 but I think it still exists.)

Technically, we begin using the working file writer utility in the
implementation of the export editor, like we did for the update editor.
This ensures that the intrinsic details of how the files are created on
disk will be the same for both export and checkout/update.  Also, doing
so enables various I/O optimizations provided by the install stream.


* subversion/libsvn_wc/working_file_writer.h:
  Delete the file.  Move declarations related to the working file writer ...

* subversion/include/private/svn_wc_private.h: ...here.  Include svn_subst.h.

* subversion/libsvn_wc/working_file_writer.c,
  subversion/libsvn_wc/wc_db.h,
  subversion/libsvn_wc/update_editor.c,
  subversion/libsvn_wc/workqueue.c: Adjust includes.

* subversion/libsvn_client/export.c
  (struct file_baton): Remove `tmppath`, `tmp_stream` fields. Add the new
   `file_writer` field.
  (open_working_file_writer): New helper function. Creates the writer for
   the file being exported based on the state in the file baton.
  (apply_textdelta): Open the working file writer for the file that is
   currently being exported.  Make svn_txdelta_apply() write data into the
   stream of the file writer.
  (close_file): Finalize the writer and use it to install the exported file.
  (struct handler_baton): Remove the `pool`, `tmppath` fields.
  (window_handler): No need to explicitly remove the temporary file: that is
   now performed automatically in the pool cleanup handler of the file writer.
  (export_file): Begin using the working file writer in this standalone function
   that drives the delta editor to export a single file.  Fetch the properties,
   open the working file writer, stream the file contents and complete the file
   installation.  We fetch properties and the contents in two separate calls
   to svn_ra_get_file(), like it's done in the current implementation of
   `svn cat`.  When fetching properties for HEAD revision, ask the RA layer
   to return the resolved revision number and use it in the subsequent call.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1886843 13f79535-47bb-0310-9956-ffa450edef68
7 files changed