Sync'ing FSX with FSFS:
Make FSX indexes precisely track the rev / pack file size such
added data is always detected even if the block sizes change.
This does not merge specific revisions.

* index.c
  (p2l_header_t): Add member for rev / pack file size.
  (svn_fs_x__p2l_index_create): Store the original file size
                                in our index file.
  (get_p2l_header): Load that info again.
  (p2l_get_max_offset_func,
   svn_fs_x__p2l_get_max_offset): Use the precise file size
                    instead of a multiple of the block size.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597202 13f79535-47bb-0310-9956-ffa450edef68
Some FSX code cleanup and stream handling fixes.

The stream handling issue lies in the difference between the delta
stream being created and the raw output stream. We checksum the input
into the delta stream and close it once the delta is complete. After
that, we add the "ENDREP" sequence to the raw stream.  This did not
surface as an error before since writing to a closed file stream is
not being prevented.

* subversion/libsvn_fs_x/transaction.c
  (rep_write_contents): Get rid of FSFS remnants as we always write
                        deltififed data.
  (rep_write_get_baton): Don't close the output stream automatically
                         because we need to add the footer after the
                         plaintext has already been fully deltified.
  (rep_write_contents_close): Again, we always deltify in FSX.  Also,
                       we now need to close the raw stream explicitly.
  (write_container_delta_rep): Close the raw rep stream explicitly.
  (write_final_changed_path_info): Update function docstring.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597203 13f79535-47bb-0310-9956-ffa450edef68
Sync'ing FSX with FSFS:
Port the low-level checksum support including verification and tests.

This is not a simple merge but mainly a "guided reimplementation",
taking the FSFS code as a blueprint but applying similar changes in
more places (as we have more item types in FSX) and accounting for
all the low-level differences.

As utility code, add private svn_checksum__* APIs to wrap streams
with a convenient checksum calculator.

Record the following revisions as affectively having been merged
from FSFS to FSX: r1573371,1588812,1588899,1588906.

* subversion/libsvn_fs_x
  (): Updated mergeinfo.

* subversion/include/private/svn_subr_private.h
  (svn_checksum__wrap_write_stream,
   svn_checksum__wrap_write_stream_fnv1a_32x4): Declare new private API;
                                only the second one is currently in use.

* subversion/libsvn_subr/checksum.c
  (stream_baton_t,
   write_handler,
   close_handler,
   wrap_write_stream): Implement generic checksumming stream wrapper.
  (svn_checksum__wrap_write_stream,
   close_handler_fnv1a_32x4,
   svn_checksum__wrap_write_stream_fnv1a_32x4): Implement new private
                                                APIs on top of it.

* subversion/libsvn_fs_x/index.h
  (svn_fs_x__p2l_entry_t): Attach a checksum to every item.

* subversion/libsvn_fs_x/index.c
  (svn_fs_x__p2l_index_create): Store the checksums.
  (read_entry): Read them again.
  (p2l_index_lookup): Explicitly init the checksum for the dynamically
                      created "past-end-of-file" dummy entry.

* subversion/libsvn_fs_x/fs_x.c
  (write_revision_zero): Update index P2L file template for r0.

* subversion/libsvn_fs_x/transaction.c
  (rep_write_baton): Hold the new low-level checksum.
  (rep_write_get_baton): Wrap the raw rep stream with a checksum calculator.
  (rep_write_contents_close): Store the checksum in the proto index entry.
  (write_container_delta_rep): Wrap the raw rep stream with a checksum
                               calculator and tell it to write directly
                               to the proto index entry.
  (write_final_rev): Calculate checksums for noderevs as well as ...
  (write_final_changed_path_info): ... for changed paths lists.

* subversion/libsvn_fs_x/pack.c
  (auto_pad_block): Explicitly initialize checksums for unused ranges.
  (write_nodes_container,
   write_reps_container,
   write_changes_container): Calculate and store the low-level checksums.

* subversion/libsvn_fs_x/verify.c
  (STREAM_THRESHOLD,
   expect_buffer_nul,
   read_all_nul,
   expected_checksum,
   expected_buffered_checksum,
   expected_streamed_checksum,
   compare_p2l_to_rev): New low-level checksum checking code taken 
                        over from FSFS.
  (verify_index_consistency): Execute the new verification step as well.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_quickly): Enable for FSX as well.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597212 13f79535-47bb-0310-9956-ffa450edef68
Fine-tune 'svnfsfs stats' output.

* tools/server-side/svnfsfs/stats-cmd.c
  (print_extensions_by_changes): Use the full space to the left for
                                 (potentially long) file extensions.
                                 Don't call representations changes.
  (print_extensions_by_nodes,
   print_extensions_by_reps,
   print_stats): Allow for longer file extensions here as well.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597213 13f79535-47bb-0310-9956-ffa450edef68
Sync'ing FSX with FSFS:
Merge revisions r1555492,1575019,1575428,1575447 from
subversion/libsvn_fs_fs into subversion/libsvn_fs_x and
resolve a few trivial text conflicts.

This ports type size and declaration fixes from FSFS to FSX.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597218 13f79535-47bb-0310-9956-ffa450edef68
Sync'ing FSX with FSFS:
Merge revisions r1559748,1578112 from subversion/libsvn_fs_fs into
subversion/libsvn_fs_x and resolve a trivial tree conflict.

This ports the "compression level" option to FSX.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597220 13f79535-47bb-0310-9956-ffa450edef68
Sync'ing FSX with FSFS:
Merge revisions r1577362 from subversion/libsvn_fs_fs into
subversion/libsvn_fs_x and resolve a trivial tree conflict.

This ports the "pack after every commit" option to FSX.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1597222 13f79535-47bb-0310-9956-ffa450edef68
Sync'ing FSX with FSFS:
We are up-to-date now, so record everything up to HEAD as "merged"
from subversion/libsvn_fs_fs into subversion/libsvn_fs_x.

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