Add commandline support for configuring the context size of our
unified diff output. This allows
$ svn diff -x -U9 WC

Note: this patch doesn't update the help output for -x, which
will need a separate patch.

* subversion/include/svn_diff.h
  (svn_diff_file_options_parse): Document -U and --context.

* subversion/libsvn_diff/diff_file.c
  (diff_options): Add context.
  (svn_diff_file_options_parse): Handle context option.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1603847 13f79535-47bb-0310-9956-ffa450edef68
Following up on r1603847, add help output for -U diff option.

* subversion/svn/svn.c
  (svn_cl__options):

* subversion/svnlook/svnlook.c
  (options_table): Document - U.

* subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
  Tweak expected output.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1603871 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_diff/diff_file.c
  (svn_diff_file_options_parse): Following up on r1603847, remove
    checking for 0 and negative context size. The api already handles these
    as 3 lines of context.

Suggested by: stsp


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1603875 13f79535-47bb-0310-9956-ffa450edef68
* CHANGES: Update entry about ISVNClient.info.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1603887 13f79535-47bb-0310-9956-ffa450edef68
Following up on r1504501, gracefully exit in situations when the APR include
is missing instead of throwing out a cryptic stacktrace ("... local variable
'version_file_path' referenced before assignment").

* build/generator/gen_win_dependencies.py
  (_find_apr): Do not attempt to use the uninitialized 'version_file_path'
    variable in the error message, because we initialize it later.  Just
    stick to the same as in the _find_apr_util_and_expat(), i.e. use the
    hardcoded filename in the error message.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1603901 13f79535-47bb-0310-9956-ffa450edef68
Do not check whether the apu_version.h file exists in the supplied APR-Util
location *twice*.  os.path.isfile(path) implicates os.path.exists(path), so
the second check effectively does nothing.

* build/generator/gen_win_dependencies.py
  (_find_apr_util_and_expat): Only check for the existence of the
    'apu_version.h' once.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1603921 13f79535-47bb-0310-9956-ffa450edef68
Fix another problem in the gen_win_dependencies.py script.  There are some
cases when we want to print a warning about an unresolved dependency, e.g.:
[[[
  WARNING: 'opensslv.h' not found
  Use '--with-openssl' to configure openssl location.
]]]

Prior to this changeset, we would instead end up with printing a stacktrace
("... global name 'show_warning' is not defined") instead of issuing a
warning and continuing to work.  The reason for that is somewhat trivial --
we inconsistently use the names 'show_warning' and 'show_warnings' across
the script and sometimes encounter a situation when the name of the function
argument does not match the name of the variable in its body.  Fix this by
using a consistent naming scheme across the whole script file.

* build/generator/gen_win_dependencies.py
  (_find_httpd, _find_openssl, _find_jdk, _find_swig, _find_serf,
   _find_sasl, _find_libintl): Use 'show_warnings' instead of 'show_warning'
    as the argument names.  The discrepancies are only in the openssl,
    jdk, and swig-related functions, but using a consistent naming scheme
    *everywhere* could probably avoid the same mistakes in the future.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604039 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_repos/repos.c
  (HOOKS_ENVIRONMENT_TEXT): Add details to the documentation embedded in hooks.

Inspired by: schabi

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604047 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/transaction.c
  (fold_change): Rename changes parameter to changed_paths for clarity.
   So fold_change(apr_hash_t *changes, const change_t change) becomes:
      fold_change(apr_hash_t *changed_paths, const change_t *change)
   The same parameter name is used by the caller, and the changed_paths
   hash contains svn_fs_path_change2_t structures instead of change_t
   structures. No functional change.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604128 13f79535-47bb-0310-9956-ffa450edef68
Get rid of the undefined behavior in the 64-bit Windows crash reporter.
There is a coding oversight that has been there since the r866928.
Prior to this changeset, a register dump could look like this:
[[[
  cs=0033  ss=002b  ds=002b  es=0053  fs=002b  gs=002b  ss=cccccccc
                                                        ^^^ (here is the UB)

  ^^^ (these segment registers actually are incorrectly
       mixed up within the fprintf() call);
]]]

* subversion/libsvn_subr/win32_crashrpt.c
  (write_process_info): Fix the problem by using a correct format string
    and ordering the arguments the same way as in the 32-bit code path.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1604131 13f79535-47bb-0310-9956-ffa450edef68
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