* 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
On the authzperf branch: Filter the authz data and construct a prefix
tree from the path rules that apply to the respective user and repository.
Statically attach the access rights to the tree nodes.

Only for a short while, we will do this filtering for each call to
svn_repos_authz_check_access.  In a few commits we will store the
information in svn_authz_t and filter only once or twice per connection
(depending on user).

* BRANCH-README
  (TODO, DONE): Move implemented bits from TODO to DONE.

* subversion/libsvn_repos/authz.c
  (access_t,
   node_t): Initial structures used to build the path rule prefix tree.
  (process_rule_baton_t,
   process_rule
   has_matching_rule): New code to determine whether a path rule / authz
                       section is relevent to the given user.
  (create_node,
   insert_path): New code to insert path rules into the prefix tree.
  (process_path_rule_baton_t,
   process_path_rule,
   create_user_authz): New top-level code for authz filtering and prefix
                       tree constrution.
  (next_segment,
   lookup): The new and currently quite simple rule lookup based on
            the new prefix tree data structure.
  (authz_get_path_access): Drop obsolete implementation.
  (svn_repos_authz_check_access): Use the new lookup code instead.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1613983 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch: Add support for recursive access rights
checks to the path rule prefix tree.  This makes the lookup feature
complete and all old lookup code obsolete.

The idea is simply to decorate all tree nodes with the min and max
access rights defined on the respective sub-trees.

* BRANCH-README
  (TODO, DONE): Another item is done now.

* subversion/libsvn_repos/authz.c
  (node_t): Add fields for min and max access rights.
  (finalize_tree): New code to recursively calculate the min / max
                   access rights on all nodes.  Later features will
                   add more processing here.
  (create_user_authz): Call the new finalizer as the last step during
                       the tree construction.
  (lookup): Add RECURSIVE parameter.  Use the MIN_RIGHTS fields to
            quickly answer requrests for recursive checks.
  (authz_lookup_baton,
   authz_access_is_granted,
   authz_access_is_determined,
   authz_line_applies_to_user,
   authz_parse_line,
   is_applicable_section,
   authz_parse_section,
   authz_get_tree_access,
   authz_get_any_access_parser_cb,
   authz_get_any_access): Drop all this old lookup logic.
  (svn_repos_authz_check_access): Answer the "any access?" question
                                  directly using the MAX_RIGHTS info,
                                  let lookup() handle everything else.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614033 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch:  Use the min / max sub-tree rights info
to exit the lookup early whenever we can.

* BRANCH-README
  (TODO, DONE): One more down.

* subversion/libsvn_repos/authz.c
  (lookup): Track MAX_RIGHTS alongside MIN_RIGHTS and use both
            to check for various early-out conditions.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614037 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch: Hide the svn_authz_t definition from
the headers again. This will allow us to later store prefix tree
data etc. in that structure.

To do this, we change private API signatures where needed and
add a private API to construct an svn_authz_t from svn_config_t.
This involves a bit of code shuffling in authz.c to have a nicer
function grouping.

* subversion/libsvn_repos/repos.h
  (svn_authz_t): Remove definition from header.
  (svn_repos__authz_validate): Rename to ...
  (svn_repos__authz_config_validate): ... this and make it take
                                      a config instead of an authz.
  (svn_repos__create_authz): New svn_authz_t construction API.

* subversion/libsvn_repos/authz.c
  (authz_validate_baton): Move into "validating" section of authz.c.
  (svn_authz_t): Define here now instead of repos.h.
  (svn_repos__authz_validate): Rename, update and move to "private API"
                               section of authz.c.
  (authz_copy_groups): Use a svn_config_t parameter instead of svn_authz_t.
  (svn_repos__retrieve_config): Move to "private API" section of authz.c.
  (svn_repos__create_authz): Implement new private API function.
  (svn_repos__authz_read,
   svn_repos_authz_parse): Read and validate authz as svn_config_t and
                           construct the svn_authz_t as a last step.

* subversion/libsvn_repos/authz_pool.c
  (authz_object_t): Be honest that we effectively only cache a config_t.
  (svn_repos__authz_pool_get): Update.  Cache the authz config_t and
                               construct the svn_authz_t dynamically.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614052 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch:  Finally unleash the full lookup speed benefits
by remembering the filtered path rule prefix trees between authz lookups.

This works because the svn_authz_t struct is conceptually immutable.
Hence, all entirely derived data remains valid for the whole lifetime
of the svn_authz_t struct.  So, let's add a small, simple LRU cache.

* subversion/libsvn_repos/authz.c
  (filtered_rules_t): Define the cache entry structure.
  (FILTER_CACHE_SIZE): Define the cache size.
  (svn_authz_t): Add an LRU cache for filtered path rule trees as
                 well as a pool to allocate dependent data from.
  (get_filtered_tree): Implement cache lookup, population and eviction.
  (svn_repos__create_authz): Update constructor.
  (svn_repos_authz_check_access): Use the new cache functionality.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614074 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch: Implement the notion of path rule ordering
by making svn_config_t iterate through sections in declaration order.
This is done using a simple linked list because we can't remove
sections but only add them.

Without support for wildcards or other patterns, the config struct
will only contain a single section for each path.  With wildcards,
there may be more than one.  All three of the follwing path rules
are equally applicable:

  [/foo/*.doc]
  * = r

  [/foo/bar.*]
  * = rw

  [/foo/bar.doc]
  jrandom =

To make conflicts managable, always pick the last path rule.  That
means users should specify general rules first, followed by exceptions
and finally (and optionally) critical rules that deny certain access,
potentially globally.

Right now, this functionality is a mere preparation for wildcard
support (soon to be added).

* BRANCH-README
  (TODO, DONE): One more down.

* subversion/libsvn_subr/config_impl.h
  (svn_config_t): Add pointers to the first and last section.

* subversion/libsvn_subr/config.c
  (cfg_section_t): Add link to next section in the list.
  (svn_config_create2): Update constructor.
  (for_each_option): Iterate following the section creation order
                     instead of the hash order.
  (svn_config_addsection): Append new sections properly to the list. 
  (svn_config_enumerate_sections,
   svn_config_enumerate_sections2): Iterate sections in creation order.

* subversion/libsvn_repos/authz.c
  (access_t): Add SEQUENCE_NUMBER as criterion for later use.
  (NO_SEQUENCE_NUMBER): Yet another "not a value" constant.
  (process_path_rule_baton_t): Add counter such that all access_t
                               get a unique sequence number.
  (process_path_rule): Assign and bump the sequence number.
  (create_user_authz): Initialize sequence numbers and the numbering
                       process.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614080 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch:

* BRANCH-README
* subversion/libsvn_subr/config.c
* subversion/libsvn_subr/config_impl.h
  Revert r1614080.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614201 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch: Do not try to second-guess typedefs for the sake
of saving a couple milliseconds of compilation time.

* subversion/libsvn_repos/repos.h: Include svn_config.h.
  (svn_repos__authz_config_validate, svn_repos__create_authz):
   Use the svn_config_t typedef instead of forward-declaring the
   struct in the function parameter list. This silences a couple
   of new warnings in maintainer mode.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614208 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 authzperf branch: Parametrize the config parser with a
constructor so that the authz parser can directly construct its
internal structures instead of building an in-memory config struct
first.

* BRANCH-README: Update TODO and DONE lists.

* subversion/include/private/svn_config_private.h: New file.
   Defines the parser constructor API.
  (svn_config__parse_stream): Define a modified prototype for this
   function here.
* subversion/libsvn_subr/config_impl.h
  (svn_config__parse_stream): Remove constructor.
* subversion/libsvn_subr/config.c: Include svn_private_config.h.
  (svn_config_parse): Update the invocation of svn_config__parse_stream.
* subversion/libsvn_subr/config_file.c: Include apr_tables.h and svn_private_config.h.
  (parse_context_t): Remove the cfg member. Add new members
   constructor, constructor_baton and in_section.
  (svn_config__constructor_t): Define.
  (svn_config__constructor_create): Implement.
  (open_section, close_section, add_value): New.
   Helper function for the parser that invoke the constructor callbacks.
  (parse_value): Call add_value instead of svn_config_set, and handle
   the SVN_ERR_CEASE_INVOCATION error code.
  (svn_config__parse_file): Update the invocation of svn_config__parse_stream.
  (svn_config__default_add_value_fn): Implement.
  (svn_config__parse_stream): Udpate. Call open_section and close_section
   as appropriate.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614213 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 authzperf branch: Fix unintended fallout from r1614213.

* subversion/libsvn_subr/config.c
  (svn_config_parse): Fix invocation of svn_config__parse_stream.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614314 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch: Sync with trunk to r1614314.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614315 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch:  No functional change.

* BRANCH-README:
  Add link to Wiki page.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/authzperf@1614387 13f79535-47bb-0310-9956-ffa450edef68
On the authzperf branch:  Prepare lookup code for pattern matching.

The gist of this is to support following multiple nodes (all applying
to the same repository tree node) at once.  So, the CURRENT node
becomes an array during lookup.

To keep the handling overhead for the necessary auxilliary data
structures low, combine them into a lookup_state_t struct.  This is
cheap to pass around and easily cleared and reused between lookups.

* subversion/libsvn_repos/authz.c
  (lookup_state_t,
   create_lookup_state,
   init_lockup_state): New lookup state type, it's construtor and
                       recycler / re-init function.
  (add_next_node): New lookup utility function that adds a node to
                   the array for the next segment and handles most of
                   the access rights application / combination logic.
  (lookup): Many local variables have been consolidated into STATE
            and tree following now needs to iterate over arrays.

  (svn_authz_t): Add an instance of the lookup state for reuse in
                 every lookup call for this svn_authz_t.
  (svn_repos__create_authz): Update svn_authz_t constructor.
  (svn_repos_authz_check_access): Provide lookup() with a correctly
                                  initializes lookup state instance.

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