Fix issue 3046 by adding a statement about quoting of parameters and delimiting argument lists. Also add a hint about peg revisions, while we are at it.

* subversion/libsvn_repos/repos.c
  (create_hooks): Add a hint about quoting of parameters and url
    handling to the hook templates.

Approved by: danielsh


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604153 13f79535-47bb-0310-9956-ffa450edef68
Print progress notification between client finished transmitting text deltas 
and asked server to commit transaction in command line client.

* subversion/svn/notify.c
  (notify_body): Handle svn_wc_notify_commit_finalizing() notification and
   print message if we got transmit text deltas notification before.

* subversion/tests/cmdline/commit_tests.py
* subversion/tests/cmdline/depth_tests.py
* subversion/tests/cmdline/trans_tests.py
  (post_commit_hook_test, commit_depth_immediates, 
   eol_change_is_text_mod): Update expected output.

* subversion/tests/cmdline/svntest/wc.py
  (State.from_commit): Ignore "Committing transaction" lines from
   'svn commit' output when collecting modified path.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604179 13f79535-47bb-0310-9956-ffa450edef68
Improve memory usage while fetching changed paths data from a transaction
by eliminating a full in-memory copy of changed path data.

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__read_changes_incrementally): New FSFS-internal API which
   invokes a callback for each changed path in a transaction.

* subversion/libsvn_fs_fs/low_level.h
  (svn_fs_fs__read_changes_incrementally): Declare.

* subversion/libsvn_fs_fs/transaction.c
  (svn_fs_fs__txn_changes_fetch): Use svn_fs_fs__read_changes_incrementally(),
   instead of reading a changes_t list into memory and looping over that list.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604188 13f79535-47bb-0310-9956-ffa450edef68
* subversion/svn/notify.c
  (notify_body): Fix indentation.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604334 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/low_level.c
  (read_change): Eliminate unnecessary string copies.  They had already been
                 allocated in the correct pool and also won't be changed by
                 further parsing.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604413 13f79535-47bb-0310-9956-ffa450edef68
Fix the performance regression of packed vs. non-packed repos in 1.9 if
revprop caching has been disabled.

The 1.9 default "compress packed revprops" added about 1ms CPU delay
before the requested revision properties can be accessed.  With revprop
caching enabled, this easily pays off by not having to read multiple
revprop pack files per shard (10ms each for HDD-backed repos).  Without
revprop caching, disk-cached non-compressed revprops will be faster.

* subversion/libsvn_fs_fs/fs_fs.c
  (read_config): Default to not compressing packed revprops.
  (write_config): Update FSFS config template to reflect the new /
                  restored default.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604414 13f79535-47bb-0310-9956-ffa450edef68
Unify svnadmin verify --keep-going check for all FSFS formats.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_keep_going): Corrupt at the beginning of the rep file
                       instead of appending to it.  We now get
                       the same error messages for all formats.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604415 13f79535-47bb-0310-9956-ffa450edef68
In preparation of having a single file containing rev data and indexes,
teach our index data stream to use only a sub-section of a given file.
However, don't expose that ability, yet.

* subversion/libsvn_fs_fs/index.c
  (svn_fs_fs__packed_number_stream_t): Add members to select the offset
                                       range that the stream covers. 
  (packed_stream_read): Limit to the upper end of the stream.
  (packed_stream_open): Set the range for the stream data to the full
                        index file, for now.
  (packed_stream_seek,
   packed_stream_offset): Use / report stream offsets relative to the
                          beginning of the stream instead of the under-
                          lying file.  That will ensure identical content
                          for the indexes before and after combining
                          them with the data file.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604416 13f79535-47bb-0310-9956-ffa450edef68
In preparation of having a single file containing rev data and indexes,
unify revision_file_t initialization:  Always open the rev file instead
of just initializing it and opening it upon demand.

* subversion/libsvn_fs_fs/rev_file.h
  (svn_fs_fs__init_revision_file): Drop.

* subversion/libsvn_fs_fs/rev_file.c
  (svn_fs_fs__init_revision_file): Rename to ..
  (init_revision_file): .. this as it's no longer an API.
  (svn_fs_fs__open_pack_or_rev_file): Update caller.

* subversion/libsvn_fs_fs/cached_data.c
  (dbg_log_access): Use "open pack file" instead of plain init
                    followed by later auto-open.  Update all
                    references to REV_FILE.
  (svn_fs_fs__check_rep): Same.

* subversion/libsvn_fs_fs/index.c
  (svn_fs_fs__l2p_get_max_ids): Same.

* subversion/libsvn_fs_fs/verify.c
  (compare_l2p_to_p2l_index,
   compare_p2l_to_l2p_index): Same.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604417 13f79535-47bb-0310-9956-ffa450edef68
Append index data to the rev data file instead of using separate files.

This gives unpacked FSFS format 7 similar I/O characteristics and disk
space usage as earlier formats.  It also eliminates the need for retries
after a potential background pack run because each file is now always
consistent with itself (earlier, data or index files might already have
been deleted while the respective other was still valid).  Overall,
most of this patch is removing code necessary to handle separate files.

The new file format is simple:

  <rep data><l2p index><p2l index><footer><footer length>

with the first three being identical what we had before. <footer length>
is a single byte giving the length of the preceding footer, so it's
easier to extract than the pre-f7 rev trailer and there is only one
per pack / rev file.

The footer itself is just two decimal file offsets marking the start
of the index sections, separated by a single space char.

* subversion/libsvn_fs_fs/low_level.h
  (svn_fs_fs__parse_footer,
   svn_fs_fs__unparse_footer): Declare new parser / generator API for the
                               f7 footer, similar to f6- revision trailer
                               but slightly simplified.

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__parse_footer,
   svn_fs_fs__unparse_footer): Implement.

* subversion/libsvn_fs_fs/rev_file.h
  (svn_fs_fs__revision_file_t): Add members for footer contents access
                                block size.
  (svn_fs_fs__reopen_revision_file): Drop. Retry is no longer necessary.
  (svn_fs_fs__auto_read_footer): Declare new function that reads the footer
                                 if we didn't yet.

* subversion/libsvn_fs_fs/rev_file.c
  (svn_fs_fs__reopen_revision_file): Drop.
  (svn_fs_fs__auto_read_footer): Implement.
  (svn_fs_fs__close_revision_file): Index streams don't carry any releasable
                                    resources anymore.

* subversion/libsvn_fs_fs/index.h
  (svn_fs_fs__packed_stream_close): Drop.  There are no independent file
                                    resources linked to the index data
                                    streams anymore.
  (svn_fs_fs__l2p_index_create,
   svn_fs_fs__p2l_index_create): Rename to ...
  (svn_fs_fs__l2p_index_append
   svn_fs_fs__p2l_index_create): ... these and accept an open file instead
                                 of a file name to be created.

* subversion/libsvn_fs_fs/index.c
  (packed_stream_open): Instead of opening our own index file, accept an
                        already open one and use the specified offset range.
  (svn_fs_fs__packed_stream_close): Drop.
  (index_create): Drop.  The files already exist.
  (svn_fs_fs__l2p_index_create,
   svn_fs_fs__p2l_index_create): Rename to ...
  (svn_fs_fs__l2p_index_append
   svn_fs_fs__p2l_index_create): ... these and use the already open file
                                 instead of creating new ones.
  (retry_open_l2p_index,
   retry_open_p2l_index): No longer necessary.
  (svn_fs_fs__item_offset,
   svn_fs_fs__p2l_get_max_offset): No lookup retry necessary anymore.
  (auto_open_l2p_index,
   auto_open_p2l_index): Make sure we know the index location and then
                         open the stream based on the existing file.

* subversion/libsvn_fs_fs/transaction.h
  (svn_fs_fs__add_index_data): New private API that combines index data
                               with the rep data file and finalizes it.

* subversion/libsvn_fs_fs/transaction.c
  (svn_fs_fs__add_index_data): Implement.
  (commit_body): Use the above.

* subversion/libsvn_fs_fs/fs_fs.c
  (write_revision_zero): Update r0 template by simply appending the
                         index contents and a final footer.

* subversion/libsvn_fs_fs/cached_data.c
  (block_read): Remove the now unnecessary retry-on-pack code.

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_copy_shard_file): Remove index file copy code.
  (hotcopy_copy_packed_shard,
   hotcopy_revisions): Update callers.

* subversion/libsvn_fs_fs/pack.c
  (close_pack_context): Use the new transaction.h API to finalize the
                        index data.
  (pack_range): Instead of ending with the file, revision content now ends
                where L2P index data starts.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_l2p_index,
   svn_fs_fs__path_p2l_index): Drop. These are no longer separate files.

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__path_l2p_index,
   svn_fs_fs__path_p2l_index): Drop.

* subversion/libsvn_fs_fs/verify.c
  (compare_p2l_to_rev): Rev contents now ends where the L2P index begins.

* subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
  (pack_filesystem): There are no separate index files anymore.

* subversion/tests/cmdline/svnadmin_tests.py
  (read_l2p): Use contents of the rev file instead of a separate index file.
  (set_changed_path_list): Parse footer and splice data correctly retaining
                           the index contents as-is.

* tools/server-side/svnfsfs/load-index-cmd.c
  (write_p2l_index, 
   write_l2p_index): Instead of creating the final index files, create
                     the proto-index files only.
  (load_index): Trim the old index from the pack / rev file and append
                the new ones using our new transaction.h API.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604421 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/transaction.c
  (process_changes): Use svn_fspath API for paths read from a transaction
   and remove an iterpool which is now unused.

Suggested by: rhuijben


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604442 13f79535-47bb-0310-9956-ffa450edef68
Expose new config file keys in JavaHL.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNConfig.java
  (ISVNConfig.ENABLE_MAGIC_FILE,
   ISVNConfig.SQLITE_BUSY_TIMEOUT,
   ISVNConfig.SERF_LOG_COMPONENTS,
   ISVNConfig.SERF_LOG_LEVEL): New constants.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604448 13f79535-47bb-0310-9956-ffa450edef68
Finalize the JavaHL API changes for 1.9.

[in subversion/bindings/javahl]
* src/org/apache/subversion/javahl/ISVNClient.java,
  src/org/apache/subversion/javahl/SVNClient.java
  (ISVNClient.info2): Remove the overload that was added on trunk and then
   replaced by ISVNClient.info.
  (ISVNClient.cleanup): Add new overload that matches svn_client_cleanup2.
  (ISVNClient.vacuum): New function, matches svn_client_vacuum.

* native/SVNClient.h, native/SVNClient.cpp
  (SVNClient::cleanup): Update prototype and implementation.
  (SVNClient::vacuum): New method.

* native/org_apache_subversion_javahl_SVNClient.cpp
  (Java_org_apache_subversion_javahl_SVNClient_cleanup):
   Update native method wrapper implementation.
  (Java_org_apache_subversion_javahl_SVNClient_vacuum):
   Implement native method wrapper.

* tests/org/apache/subversion/javahl/BasicTests.java
  (BasicTests.collectInfos): Use ISVNClient.info instead of ISVNClient.info2.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604449 13f79535-47bb-0310-9956-ffa450edef68
* subversion/svn/log-cmd.c
  (svn_cl__log_entry_receiver): Use an iterpool while printing entries of the
   changed paths list to reduce memory overhead when printing very large lists.
   Also use an iterpool while printing entries of the merge stack.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604569 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_repos/log.c
  (send_log): Pass a separate scratch pool to the log receiver callback
   to ensure that no temporary allocations made by the callback persist.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604599 13f79535-47bb-0310-9956-ffa450edef68
Introduce another scratch pool in the server-side log code, reducing the
the resident memory size of an 'svn log -v' process from 407M to 317M while
showing r11708 of ruby's Subversion repository via ra_local (on OpenBSD).
Ruby's r11708 sets svn:eol-style on 123934 files...

* subversion/libsvn_fs_fs/low_level.c
  (read_change): Switch to dual-pool parameters, and use a scratch pool for
   lines read from the revision file and a result_pool for returned data.
  (svn_fs_fs__read_changes): Use an iterpool while looping over changes
   and pass it as a scratch pool to read_change().
  (svn_fs_fs__read_changes_incrementally): Same, except this was already
   passing an iterpool pool as the result pool.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604700 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/rev_file.c
  (init_revision_file): Make static.

* subversion/libsvn_subr/checksum.c
  (wrap_write_stream): Make static.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604717 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/tree.c
  (is_changed_node): Remove unused function.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604720 13f79535-47bb-0310-9956-ffa450edef68
* tools/server-side/svnfsfs/load-index-cmd.c
  (write_l2p_index): Remove unused variable.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604724 13f79535-47bb-0310-9956-ffa450edef68
Introduce scratch pools in the block_read() family of functions.

Resident memory size of 'svn log -v' drops from 317MB to 173MB while
showing r11708 of ruby's Subversion repository via ra_local (on OpenBSD).
Repository format used for testing was fsfs7 without default settings.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__get_changes): Rename 'pool' argument to 'result_pool'.
   Create a local scratch pool and pass it down.
  (init_rep_state): Rename 'pool' argument to 'result_pool'.
  (block_read_windows, read_rep_header, block_read_contents,
   block_read_changes, block_read_noderev): Switch to dual-pool
   model (result/scratch pool), and pass a scratch pool where
   possible (in particular, svn_cache__set()).
  (block_read): Pass iterpool as scratch pool to block_read_*.


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