Follow-up to r1611379: Correctly handle all intermittent errors.

Since the same code sequence has been used for FSFS since 2007,
factor it out into some private API function.

* subversion/include/private/svn_io_private.h
  (svn_io__file_lock_autocreate): Declare new private API.

* subversion/libsvn_subr/io.c
  (svn_io__file_lock_autocreate): Move the file handling code from
                                  the lock() function here and handle
                                  all ordinary and racy errors. 

* subversion/libsvn_subr/named_atomic.c
  (lock): Call the new function and ensure correct thread mutex use.

Found by: brane

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1612405 13f79535-47bb-0310-9956-ffa450edef68
Use the new private lock file API for FS* lock files as well.

* subversion/libsvn_fs_fs/fs_fs.c
  (get_lock_on_filesystem): Call the new API instead using local code.

* subversion/libsvn_fs_x/transaction.c
  (get_lock_on_filesystem): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1612407 13f79535-47bb-0310-9956-ffa450edef68
In preparation for hotcopy progress reporting, inline the logic related to
the 'db/current' update.  As a consequence, we can now get rid of the in-out
semantics for the parameter denoting the destination's youngest revision.
From now on, it is immutable and always represents the youngest revision of
the destination at the point we started a hotcopy.  This is simpler and also
allows us to entirely drop two related helper functions.

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_update_current, hotcopy_update_current_old): Remove, now inline.
  (hotcopy_revisions): Make the 'dst_youngest' argument immutable instead of
    treating it as an in-out parameter.  Inline the hotcopy_update_current()
    calls and tweak the corresponding comments.
  (hotcopy_body): Make the 'dst_youngest' immutable for the whole hotcopy
    operation.  Its only usage happened during the part when we truncate the
    destination's rep-cache.db file.  Switch to using the source youngest
    revision as a threshold, because it does not really matter at this point
    -- we are done with copying the revisions and we did not error out, so
    the youngest revisions must be equal.  Finally, update the 'db/current'
    contents directly instead of calling the hotcopy_update_current() or
    hotcopy_update_current_old() functions.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1612810 13f79535-47bb-0310-9956-ffa450edef68
Implement svn_cstring_skip_prefix().

* subversion/libsvn_subr/string.c
* subversion/include/svn_string.h
  (svn_cstring_skip_prefix): New.

* subversion/tests/libsvn_subr/string-test.c
  (test_string_skip_prefix): New test for svn_cstring_skip_prefix().
  (test_funcs): Add test_string_skip_prefix test.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1612823 13f79535-47bb-0310-9956-ffa450edef68
* subversion/include/private/svn_named_atomic.h
  (svn_named_atomic__is_efficient): Add docstring note about memory
                                    consumption. No functional change.

Suggested by: brane


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1613152 13f79535-47bb-0310-9956-ffa450edef68
Teach 'svnadmin hotcopy' (both incremental and non-incremental) to report
progress when copying revisions and packed shards.  Currently, this is only
supported for FSFS repositories.  A sample output may look like this...

  * Copied revision 0.
  * Copied revision 1.
  * Copied revision 2.
  * Copied revision 3.

...or like this (for packed repositories):

  * Copied revisions from 0 to 999.
  * Copied revisions from 1000 to 1999.
  * Copied revision 2000.
  * Copied revision 2001.
  * Copied revision 2002.
  * Copied revision 2003.

In short, if and only if we created or updated something in the hotcopy
destination, the caller is notified about this.  These notifications (hence,
the 'svnadmin' output) are guaranteed to arrive in ascending order, but may
contain gaps in the incremental mode.  The reason for this is that sometimes
we need to re-copy data that was modified in the hotcopy source, e.g. due
to revision property changes.

As it is with other similar operations, 'svnadmin hotcopy' now accepts the
--quiet option, but the progress output is enabled by default.

* subversion/include/svn_repos.h
  (svn_repos_notify_action_t): Add 'svn_repos_notify_hotcopy_rev_range'.
    This new notification type allows us to track the hotcopy progress.
  (svn_repos_notify_t): Support start and end revisions coming with the
    new notification type.
  (svn_repos_hotcopy3): New version of svn_repos_hotcopy2() accepting a
    notify func and the corresponding baton.
  (svn_repos_hotcopy2): Deprecate.

* subversion/libsvn_repos/repos.c
  (fs_hotcopy_notify_baton_t, fs_hotcopy_notify): New.
  (svn_repos_hotcopy3): Marshal notifications from the FS layer in this
    newly added replacement for svn_repos_hotcopy2().
  (svn_repos_hotcopy2): Preserve the original behavior by calling
    svn_repos_hotcopy3() without the notification support.

* subversion/include/svn_fs.h
  (svn_fs_hotcopy_notify_t): New.
  (svn_fs_hotcopy3): New version of svn_fs_hotcopy2() accepting a
    notify func and the corresponding baton.
  (svn_fs_hotcopy2): Deprecate.

* subversion/libsvn_fs/fs-loader.h
  (fs_library_vtable_t.hotcopy): Now accepts a notify func and a baton.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_hotcopy3): Call the corresponding vtable member and pass the
    notify func and baton arguments this newly added replacement for
    svn_fs_hotcopy2().
  (svn_fs_hotcopy2): Preserve the original behavior by calling
    svn_fs_hotcopy3() without the notification support.

* subversion/libsvn_fs_fs/fs.c
  (fs_hotcopy): Add the notify func and baton arguments.  Pass them when
    invoking the hotcopy.

* subversion/libsvn_fs_base/fs.c
  (base_hotcopy): Now accepts a notify func and a baton.

* subversion/libsvn_fs_x/fs.c
  (x_hotcopy): Now accepts a notify func and a baton.

* subversion/libsvn_fs_fs/hotcopy.h
  (svn_fs_fs__hotcopy): Now accepts a notify func and a baton.

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_io_dir_file_copy): Add an optional flag and unset it whenever we
    did copy the file.  Hotcopy skips files that do not differ in terms of
    kind, size, and mtime and we want to be able to distinguish situations
    where the file was actually copied.
  (hotcopy_io_copy_dir_recursively, hotcopy_copy_shard_file): Add the same
    optional flag argument and push it down the stack.  These functions
    eventually end up with calling hotcopy_io_dir_file_copy() and we want
    them to unset the corresponding flag whenever at least one file was
    copied.
  (hotcopy_revisions, hotcopy_revisions_old): Initialize the 'skipped' flag
    and notify the caller in case it was unset by the corresponding copy
    routines (for revisions and packed shards).
  (hotcopy_body_baton): Add the notify func and baton fields.
  (hotcopy_body): Pass the notify func and baton to the revision copying
    functions.  Do not ask whether we actually copied something during
    the part when we copy the 'db/node-origins/' cache, because we are
    not interested.
  (svn_fs_fs__hotcopy): Push the notify func and baton fields down to
    hotcopy_body() via the corresponding 'hotcopy_body_baton'.

* subversion/svnadmin/svnadmin.c
  (cmd_table."hotcopy"): Enable the '--quiet' option.
  (repos_notify_handler): Handle the new 'svn_repos_notify_hotcopy_rev_range'
    notification.  Tweak the docstring.
  (subcommand_hotcopy): Create the feedback stream iff running in non-quiet
    mode.  Call svn_repos_hotcopy3() instead of svn_repos_hotcopy2(); pass
    the appropriate notify handler.

* subversion/tests/cmdline/svnadmin_tests.py
  (fsfs_hotcopy_progress, fsfs_hotcopy_progress_with_revprop_changes,
   fsfs_hotcopy_progress_old): New.
  (test_list): Add references to new tests.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1613339 13f79535-47bb-0310-9956-ffa450edef68
* NOTICE, LICENSE: Add license info for utf8proc.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1613542 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_body): Fix strange comment block that was introduced in r1612810.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1613872 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_repos/authz_pool.c: Do not include a private header from
   another module; include private/svn_subr_private.h instead.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1614209 13f79535-47bb-0310-9956-ffa450edef68
On the 'moves-tracking-2' branch: add a debug editor.

* subversion/include/private/svn_editor3.h,
  subversion/libsvn_delta/editor3.c
  (svn_editor3__get_debug_editor): New. Implemented by adding debug
    prints to the previously unexposed svn_editor3_forwarding_wrapper().

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/move-tracking-2@1614303 13f79535-47bb-0310-9956-ffa450edef68
On the 'moves-tracking-2' branch: Tweak comments.

* subversion/include/private/svn_editor3.h
  Tweak two comments.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/move-tracking-2@1614305 13f79535-47bb-0310-9956-ffa450edef68
Tweak the svn_delta_editor debug editor, that prints diagnostic messages for
debugging.

Add the 'abort' method, which was missing -- it didn't even forward the call
to the real, wrapped editor. Add an optional prefix, which is useful to
distinguish the interleaved messages from nested editors. Tweak the "DBG:"
prefix to include a space, "DBG: ", for compatibility with SVN_DBG(). Print
to stdout instead of stderr, for compatibility with SVN_DBG() and with our
test suite which ignores stdout lines starting with "DBG:".

* subversion/libsvn_delta/debug_editor.c
  (edit_baton): Add a 'prefix' member.
  (write_indent): Write the prefix instead of just "DBG:".
  (abort_edit): New function.
  (svn_delta__get_debug_editor): Don't bother getting a 'default' editor,
    since we want to override all the methods. Use stdout instead of stderr.
    Initialize the prefix.

* subversion/libsvn_delta/debug_editor.h
  (svn_delta__get_debug_editor): Add the 'prefix' argument. Document the
    changes.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1614313 13f79535-47bb-0310-9956-ffa450edef68
On the 'moves-tracking-2' branch: Add an Ev3-to-Ev1 commit editor shim,
completing the commit editor shims.

This is not fully working -- a few tests still fail when this pair of shims
is inserted in line with the repository-layer commit editor.

* subversion/include/private/svn_delta_private.h
  (svn_delta__shim_connector_t): New.
  (svn_delta__ev3_from_delta_for_commit): Return a 'shim connector' object
    instead of just one of the possible shim connector callbacks.
  (svn_delta__delta_from_ev3_for_commit): New.
  (svn_editor3__insert_shims): New.

* subversion/libsvn_delta/compat3.c
  Many changes to implement the above, including some debugging of the
  existing Ev3-to-Ev1 shim code.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/move-tracking-2@1614346 13f79535-47bb-0310-9956-ffa450edef68
On the 'move-tracking-2' branch: catch up with trunk@1614347.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/move-tracking-2@1614348 13f79535-47bb-0310-9956-ffa450edef68
* subversion/tests/cmdline/svnlook_tests.py
  (property_delete): Explain the history of the regression better.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1614361 13f79535-47bb-0310-9956-ffa450edef68
Adjust a repository layer test to properly abort each failed commit, to obey
the editor driving rules.

This test was working fine by itself but made too many assumptions, and so
would fail when introducing editor 'shims' into the commit editor code path,
as is typically done when testing Ev2 (or Ev3) code. That's how I found the
problem, while working on the 'move-tracking-2' branch.

* subversion/tests/libsvn_repos/repos-test.c
  (fwcc_prepare): New, extracted from ...
  (filename_with_control_chars): ... here. Start up and tear down each
    failed editor drive separately instead af assuming that the expected
    failure would be reported immediately and that the editor would still be
    usable after the failure.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1614381 13f79535-47bb-0310-9956-ffa450edef68
On the 'move-tracking-2' branch: catch up with trunk@1614385.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/move-tracking-2@1614386 13f79535-47bb-0310-9956-ffa450edef68
On the 'moves-tracking-2' branch: Add commit editor shims into the
repository layer commit code path.

* subversion/libsvn_repos/commit.c
  (fetch_props_func): Use the correct base revision, as in the other two
    'fetch' functions.
  (fetch_base_func): Fix the lifetime of the created file: don't let it be
    deleted on pool cleanup, especially not cleanup of the scratch pool.
  (svn_repos_get_commit_editor5): Insert Ev3 shims.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/move-tracking-2@1614389 13f79535-47bb-0310-9956-ffa450edef68