Checkout Tools
  • last updated 2 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Introduce a warning callback to the authz file parser API.

We need this to warn about the use of empty groups in authz files;

this is not an error and doesn't affect the authz file semantics,

but it's nice to be able to tell the user about it.

See issues #4794, #4802 and #4803.

* subversion/include/svn_repos.h

(svn_repos_authz_warning_func_t): New callback function type.

(svn_repos_authz_read4): New; API revision.

(svn_repos_authz_read3): Deprecated.

(svn_repos_authz_parse2): New; API revision.

(svn_repos_authz_parse): Deprecated.

* subversion/libsvn_repos/authz.h

(svn_authz__parse): Add warning function and baton parameters.

* subversion/libsvn_repos/authz.c

(authz_read): Add warning function and baton parameters.

Update calls to svn_authz__parse.

(svn_repos_authz_read4): Revised from svn_repos_authz_read3.

(svn_repos_authz_parse2): Revised from svn_repos_authz_parse.

* subversion/libsvn_repos/authz_parse.c

(struct ctor_baton_t): Add members warning_func and warning_baton.

(create_ctor_baton): Initialise these new members of the constructor baton.

(emit_parser_warning): New.

(SVN_AUTHZ_PARSE_WARN): New; wrapper macro for the above.

(array_insert_ace): Ignore and warn about the use of empty groups.

(svn_authz__parse): Update implementation to match prototype.

* subversion/libsvn_repos/deprecated.c

(svn_repos_authz_read3, svn_repos_authz_parse): Implement deprecated functions.

* subversion/mod_authz_svn/mod_authz_svn.c

(log_svn_message): New; replaces log_svn_error so that it's useful for

logging warnings as well.

(log_svn_error): Reimplement, calling log_svn_message.

(struct authz_warning_baton_t): New.

(log_authz_warning): New.

(get_access_conf): Set up an authz warning handler and baton, and call

svn_repos_authz_read4 instead of svn_repos_authz_read3.

* subversion/svnserve/logger.h

(logger__log_error): Make the 'err' parameter a pointer-to-const.

Update the docstring to say that the error is not cleared.

(logger__log_warning): New.

* subversion/svnserve/logger.c

(log_message): New; common base for logger__log_error and logger__log_message.

Also *do not* allocate 8k on the stack, use the logger pool, which gets

cleared at the end of the function.

(logger__log_error): Reimplement.

(logger__log_warning): Implement.

* subversion/svnserve/serve.c

(log_error): Make the error parameter const. Fix the docstring.

(log_warning): New.

(load_authz_config): Add warning function and baton parameters and fix pool

handling. Now calls svn_repos_authz_read4 instead of svn_repos_authz_read3.

(find_repos): Add warning function and baton parameters for load_authz_config.

(handle_authz_warning): New.

(construct_server_baton): Pass an authz warning handler and baton to find_repos.

* subversion/tests/cmdline/authz_tests.py

(group_member_empty_string): Fix docstring.

(empty_group): New test case.

(test_list): Run it.

* subversion/tests/cmdline/svnauthz_tests.py

(svnauthz_empty_group_test): Extend the @Issues decorator.

Add a check for the expected warning on stderr.

  1. … 12 more files in changeset.
* subversion/include/svn_repos.h

(svn_repos_begin_report3): Document the limited implementation

of 'svn_copyfrom_args'.

Doxygen mark-up fixes.
  1. … 8 more files in changeset.
Add "const" to an "apr_array_header_t *" input parameter.

This is the only case in the whole API where it was missing.

(Note that we are allowed to add "const" to a pointer parameter of a public

API, and have done so before e.g. in r922239, because that is a backward-

compatible API change and doesn't change the ABI at all.)

* subversion/include/svn_repos.h

subversion/libsvn_repos/repos.c

(svn_repos_freeze): Add 'const' to the paths array parameter.

  1. … 1 more file in changeset.
Tweaks to doc strings and Doxygen mark-up of 1.10 API changes.

  1. … 7 more files in changeset.
Issue SVN-4729: Add '--include' and '--exclude' options to 'svnadmin dump'.

* include/svn_repos.h

(svn_repos_dump_filter_func_t): New.

(svn_repos_dump_fs4): Update function signature and comment.

(svn_repos_dump_fs3): Update comment.

* libsvn_repos/deprecated.c

(svn_repos_dump_fs3): Update caller.

* libsvn_repos/dump.c

(write_revision_record): Call to svn_repos_fs_revision_proplist() (with

AUTHZ_FUNC) instead of svn_fs_revision_proplist2() to filter revision

properties as well as revisions. Update comment.

(dump_filter_baton_t,

dump_filter_authz_func): New.

(svn_repos_dump_fs4): Initialize and pass AUTHZ_FUNC and AUTHZ_BATON to

the repos layer API if FILTER_FUNC is specified by caller.

* subversion/svnadmin/svnadmin.c

(svnadmin__cmdline_options_t): Add enum values for new options.

(options_table): Add new options.

(cmd_table): Add new options to 'dump' subcommand.

(svnadmin_opt_state): Add new fields to represent new options.

(ary_prefix_match): New. Copied from svndumpfilter.

(dump_filter_baton_t,

dump_filter_func): New.

(subcommand_dump): Initialize FILTER_BATON. Pass DUMP_FILTER_FUNC and a

pointer to FILTER_BATON to svn_repos_dump_fs() if any filtering prefixes

specified.

(sub_main): Handle new options.

* subversion/tests/cmdline/svnadmin_tests.py

(dump_exclude,

dump_exclude_copysource,

dump_include,

dump_not_include_copysource,

dump_exclude_by_pattern,

dump_include_by_pattern,

dump_exclude_all_rev_changes,

dump_invalid_filtering_option): New.

(test_list): Add new tests to table.

* subversion/tests/libsvn_repos/dump-load-test.c

(test_dump_bad_props): Update caller.

Patch by: sergey.raevskiy{_AT_}visualsvn.com

  1. … 5 more files in changeset.
svnadmin: Introduce the `--normalize-props` option for the load and

load-revprops commands.

Currently, the only performed normalization is the automatic translation

of non-LF line endings in the svn: property values. Apparently, this is

a common issue reported by our users, as Subversion versions prior to 1.6

allowed such values for properties like svn:log and so they can be present

in the dump files. The behavior before this changeset is that a user can

either force loading the dump with such invalid properties using the

--bypass-prop-validation (that affects reading them in the future),

manually repair the dump file or use a tool like svnsync that performs

the property normalization. It would be better if the users had an option

to fix this right in the svnadmin load command.

See also the corresponding FAQ entry and related issues that have been

fixed in svnsync and svnrdump:

https://subversion.apache.org/faq.html#fix-nonLF-log

https://issues.apache.org/jira/browse/SVN-3404

https://issues.apache.org/jira/browse/SVN-4263

* subversion/include/svn_repos.h

(svn_repos_load_fs6): New version of svn_repos_load_fs5() accepting the

new `normalize_props` argument.

(svn_repos_load_fs5): Deprecate.

(svn_repos_load_fs_revprops): Accept the new `normalize_props` argument.

(svn_repos_get_fs_build_parser6): New version of

svn_repos_get_fs_build_parser5() accepting the new `normalize_props`

argument.

* subversion/include/private/svn_repos_private.h

(svn_repos__normalize_prop): New private helper. The `normalized_p`

argument will be currently unused by all calling sites, but it's added

as the groundwork to simplify implementing the notifications about

normalized properties in the future.

* subversion/libsvn_repos/deprecated.c

(svn_repos_load_fs5, svn_repos_get_fs_build_parser5): Implement by

forwarding to the new versions of these functions.

* subversion/libsvn_repos/fs-wrap.c

(): Include svn_subst.h.

(svn_repos__normalize_prop): Implement this new helper function.

The implementation is close to how svn_rdump__normalize_prop() is

written, but this function accepts two pools and handles the new

`normalized_p` output argument.

* subversion/libsvn_repos/load-fs-vtable.c

(struct parse_baton): Add new `normalize_props` field.

(change_rev_prop): Accept new `normalize_props` argument, call the

new helper function if it's set.

(close_revision): Normalize the revision properties if necessary.

(svn_repos_get_fs_build_parser6): New, replacing ...

(svn_repos_get_fs_build_parser5): ...this function.

(svn_repos_load_fs6): New, replacing ...

(svn_repos_load_fs5): ...this function.

(revprops_close_revision): Update call to change_rev_prop().

(build_revprop_parser): Accept new `normalize_props` argument, use it

to initialize the new field in the parse_baton.

(svn_repos_load_fs_revprops): Handle the new `normalize_props` argument

by forwarding it to build_revprop_parser().

* subversion/svnadmin/svnadmin.c

(svnadmin__cmdline_options_t, options_table): Add svnadmin__normalize_props.

(cmd_table): Enable the new option for load and load-revprops commands.

(struct svnadmin_opt_state): Add new `normalize_props` field and ...

(sub_main): ...initialize it here.

(subcommand_load, subcommand_load_revprops): Normalize properties when

running with --normalize-props. Use separate hints when encountering

invalid properties with non-LF line endings and all other kinds of

invalid properties.

* subversion/svnrdump/svnrdump.h

(svn_rdump__normalize_prop): Remove this declaration. This function is

now superseded by the new svn_repos__normalize_prop() helper.

* subversion/svnrdump/util.c

(): Include svn_repos_private.h, drop other includes.

(svn_rdump__normalize_prop): Remove. This function is now superseded

by the new svn_repos__normalize_prop() helper.

(svn_rdump__normalize_props): Use the new svn_repos__normalize_prop()

helper function.

* subversion/svnrdump/load_editor.c

(set_revision_property, set_node_property): Use the new

svn_repos__normalize_prop() helper function.

* subversion/tests/libsvn_repos/dump-load-test.c

(test_load_bad_props): Use the new svn_repos_load_fs6() function, keep

the previous behavior unchanged, i.e., do not normalize the properties.

* subversion/tests/cmdline/svntest/actions.py

(run_and_verify_load, load_repo): Accept new `normalize_props` argument.

* subversion/tests/cmdline/svnadmin_tests.py

(load_bad_props): Test loading with --normalize-props. Check for the error

codes reported during load with non-LF line endings and without the new

option. In cases when the load is successful, check the resulting

svn:log property value in the repository.

* tools/client-side/bash-completion

(_svnadmin): Extend completion info.

  1. … 12 more files in changeset.
Add missing constructors for new types added in r1731163.

* subversion/include/svn_repos.h,

subversion/libsvn_repos/log.c

(svn_repos_path_change_t,

svn_repos_log_entry_t): Note that the constructor should be used.

(svn_repos_path_change_create,

svn_repos_path_change_dup,

svn_repos_log_entry_create,

svn_repos_log_entry_dup): New.

  1. … 1 more file in changeset.
Fix design bug in svn_client_list4()/svn_ra_list()/svn_repos_list() APIs.

* subversion/include/svn_client.h (svn_client_list4):

Make the patterns array const. All dependencies and references updated.

* subversion/include/svn_ra.h (svn_ra_list): Likewise.

* subversion/include/svn_repos.h (svn_repos_list): Likewise.

* subversion/libsvn_client/list.c

(list_externals, list_internal, match_patterns,

get_dir_contents, list_external_items, svn_client_list4):

Make patterns array const.

* subversion/libsvn_ra/ra_loader.h (svn_ra__vtable_t::list): Likewise.

* subversion/libsvn_ra/ra_loader.c (svn_ra_list): Likewise.

* subversion/libsvn_ra_local/ra_plugin.c (svn_ra_local__list): Likewise.

* subversion/libsvn_ra_svn/client.c (ra_svn_list): And again.

* subversion/libsvn_repos/list.c (matches_any, do_list, svn_repos_list):

And some more of the same.

  1. … 8 more files in changeset.
Follow-up to r1780810 and r1780820:

Docstring fixes. No functional change.

Found by: julianfoad

* subversion/include/svn_fs.h

(svn_fs_get_mergeinfo3): Remove all references to the removed CATALOG

parameter.

* subversion/include/svn_repos.h

(svn_repos_fs_get_mergeinfo2): Same.

  1. … 1 more file in changeset.
Continue work on stream server-side svn_ra_get_mergeinfo.

Make the repos layer API use callbacks instead of collecting a full catalog.

* subversion/include/svn_repos.h

(svn_repos_mergeinfo_receiver_t): Declare new callback. For now, it is

identical to the FS layer type.

(svn_repos_fs_get_mergeinfo2,

svn_repos_fs_get_mergeinfo): Bump the API.

* subversion/libsvn_repos/deprecated.c

(mergeinfo_receiver,

svn_repos_fs_get_mergeinfo): Implement the old API in terms of the new one.

* subversion/libsvn_repos/fs-wrap.c

(svn_repos_fs_get_mergeinfo,

svn_repos_fs_get_mergeinfo2): Replace old API with API implementation.

Apart from the pool rename, the only change

is the call to the bumped FS API function.

  1. … 2 more files in changeset.
Merging branches/authzperf to /trunk and remove BRANCH-README.
  1. … 35 more files in changeset.
Change the svn_*_list APIs to use NULL as the "don't filter by pattern"

parameter instead of an empty pattern list.

Suggested by: Patrick Steinhardt (patrick.steinhardt at elegosoft.com)

* subversion/include/svn_repos.h

(svn_repos_list): Document the new PATTERN options behavior.

* subversion/libsvn_repos/list.c

(matches_any): Implement the new behavior.

(svn_repos_list): Empty lists will almost always be created by dumb

scripts. It's probably a good idea to explicitly

not waste any resources in the degenerate case.

* subversion/include/svn_ra.h

(svn_ra_list): Document the new PATTERN options behavior.

* subversion/libsvn_ra_svn/protocol

(3.1.1. Main Command Set): The patterns list in the list command is

now optional.

* subversion/libsvn_subr/log.c

(svn_log__list): Make the logging cope with NULL pattern lists.

* subversion/svnserve/serve.c

(list): Receive NULL for PATTERNS, if no list was received.

* subversion/libsvn_ra_svn/client.c

(ra_svn_list): Omit the pattern list entirely, if patterns is NULL.

* subversion/include/svn_client.h

(svn_client_list4): Document the new PATTERN options behavior.

(svn_client_list3): Update docstring.

* subversion/libsvn_client/deprecated.c

(svn_client_list3): Update implementation.

* subversion/libsvn_client/list.c

(match_patterns): Implement the new behavior.

(list_internal): Update docstring.

* subversion/svn/list-cmd.c

(svn_cl__list): If no patterns were specified, pass NULL to the API.

* subversion/svnbench/null-list-cmd.c

(svn_cl__null_list): Same.

  1. … 11 more files in changeset.
Finalize the svn_repos_list interface: Name scratch pools explicitly.

* subversion/include/svn_repos.h

(svn_repos_dirent_receiver_t,

svn_repos_list): The pools given here are pure SCRATCH_POOLs.

* subversion/libsvn_repos/list.c

(fill_dirent,

report_dirent,

do_list,

svn_repos_list): Same.

  1. … 1 more file in changeset.
Make the new svn_repos_list easier to use with typical client requests.

Instead of a single pattern, accept an array of alternative patterns of

which at least one must match if any patterns are given. Sort the output

by path to make it match the client-side implementation's output order.

* subversion/include/svn_repos.h

(svn_repos_list): We now support multiple glob patterns and sort the

output.

* subversion/libsvn_repos/list.c

(matches_any): New utility function for matching against an array

instead of a single pattern.

(report_dirent): For efficiency reasons, we now filter early before

calling this reporter function.

(filtered_dirent_t,

compare_filtered_dirent): New filtering and sorting support.

(do_list): Support multiple PATTERNS. Filter and sort the data before

processing it further.

(svn_repos_list): Update signature, filtering and passing of parameters.

* subversion/tests/libsvn_repos/repos-test.c

(test_list): Adapt test case to interface change.

  1. … 2 more files in changeset.
Introduce a "directory list" operation at the repos layer. This is the

first step towards an efficient implementation of 'svn list -r'.

The function is straight-forward with support for operation depth and

authz. One important use-case is "find files". To support this with

minimal system load, the function allows to specify a glob pattern for

the file name and has an option to only report path and node type.

* subversion/include/svn_repos.h

(svn_repos_dirent_receiver_t,

svn_repos_list): The new API.

* subversion/libsvn_repos/list.c

(*): New file implementing the new API. Noteworthy:

(fill_dirent): Factored out from ...

(svn_repos_stat): ... this, which has been moved here from repos.c

* subversion/libsvn_repos/repos.c

(svn_repos_stat): Move from here to list.c due to shared code.

* subversion/tests/libsvn_repos/repos-test.c

(test_list): Simple test-case for the new function.

(test_funcs): Register new test.

  1. … 3 more files in changeset.
Deprecate svn_repos_get_logs4.

Small twist here: The ra_local log() implementation needs to expose an

repos_log4-esque API. So, we re-use all the shim code that adapts log5

onto log4 by exposing the latter through a new private API.

* subversion/include/svn_repos.h

(svn_repos_get_logs4): Depricate.

* subversion/include/private/svn_repos_private.h

(svn_repos__get_logs_compat): Declare new private API.

* subversion/libsvn_repos/log.c

(log_entry_receiver_baton_t,

path_change_kind_to_char,

log4_path_change_receiver,

log4_entry_receiver,

svn_repos_get_logs4): Move these log5/log4 shims from here ...

* subversion/libsvn_repos/compat.c

(): ... to this new file.

(svn_repos_get_logs4): Rename this ...

(svn_repos__get_logs_compat): ... to that.

* subversion/libsvn_repos/deprecated.c

(svn_repos_get_logs4): Add trivial implementation.

* subversion/libsvn_ra_local/ra_plugin.c

(svn_ra_local__get_log): Call the new private API instead of the

deprecated one.

  1. … 5 more files in changeset.
Complete the work on the svn_repos_get_logs4 to svn_repos_get_logs5

migration by publishing the new API.

We don't deprecate the old one until the callers have been updated

and the FS implementations have been finalized so we have the full

picture.

* subversion/include/svn_repos.h

(svn_repos_path_change_t,

svn_repos_path_change_receiver_t,

svn_repos_log_entry_t,

svn_repos_log_entry_receiver_t,

svn_repos_get_logs5): Publish and document the new API. Names and

signatures are taken from the former "__"

definitions in log.c.

* subversion/libsvn_repos/log.c

(svn_repos__path_change_t,

svn_repos__path_change_receiver_t,

svn_repos__log_entry_t,

svn_repos__log_entry_receiver_t): Remove here.

(log_callbacks_t,

fill_log_entry,

interesting_merge_baton_t,

send_log,

handle_merged_revisions): Update type references.

(svn_repos__get_logs5): Renamed to ...

(svn_repos_get_logs5): ... this and updated signature.

(log4_path_change_receiver,

log4_entry_receiver): Update type references.

(svn_repos_get_logs4): Update caller.

  1. … 1 more file in changeset.
Following up on r1709388, undo the behavior change of the calling sites of

svn_fs_contents_different() and svn_fs_props_different() that is not required

nor justified in the context of fixing issue #4598, "No-op changes no longer

dumped by 'svnadmin dump' in 1.9".

This commit also restores the hack required for blame -g for old clients

(see r1686478, r1686888) in rev_hunt.c:send_path_revision(). Perhaps there

is a better replacement for it, since we now have the original behavior of

svn_fs_contents_changed() available, but this can be handled separately.

* subversion/libsvn_fs_fs/dag.c

(svn_fs_fs__dag_things_different): Tweak the related comment within this

function.

* subversion/libsvn_fs_fs/tree.c

(merge): Compare the property lists based on their contents.

* subversion/libsvn_repos/delta.c

(delta_proplists): Use svn_fs_props_different() when comparing property

lists.

(svn_repos__compare_files): Call svn_fs_contents_different() instead of

reimplementing the content comparison in this function.

(delta_files): Call svn_fs_contents_different(), as we were doing prior

to r1709388.

* subversion/libsvn_repos/reporter.c

(delta_proplists): Use svn_fs_props_different() when comparing property

lists.

* subversion/libsvn_repos/rev_hunt.c

(send_path_revision): Call svn_fs_contents_different(). Restore the

blame -g compatibility hack.

* subversion/include/svn_ra.h

(svn_ra_get_file_revs2): Restore the original @note in the docstring.

* subversion/include/svn_repos.h

(svn_repos_get_file_revs2): Restore the original @note in the docstring.

  1. … 6 more files in changeset.
Restore the 1.8 behavior of svn_fs_contents_changed() and _props_changed()

API. Switch all calling sites of the new API, svn_fs_contents_different()

and _props_different(), back to using the old functions.

There are no user-visible problems associated with the old code. The new

API doesn't improve any real use cases in the current code, but is causing

problems:

- We had a problem with misbehaving svn blame -g

(http://svn.haxx.se/dev/archive-2015-06/0069.shtml, "Blame behaviour

change in 1.9").

- We have an issue with repositories behaving differently in client-side

operations like 'svn log' after dump/load

(http://svn.haxx.se/dev/archive-2015-09/0269.shtml, "No-op changes no

longer dumped by 'svnadmin dump' in 1.9"; also see issue #4598 in

https://issues.apache.org/jira/browse/SVN-4598).

- We could experience same problems originating from other callers of the

new API, because the low level behavior change associated with switching

to it propagates up to higher levels like svn_repos or svn_ra and alters

the behavior of many different callers like svn_ra_get_file_revs2() or

the update reporter. Third-party API callers could not be ready for it

as well, because public API functions like svn_ra_get_file_revs2() didn't

receive an erratum or a bump.

See the discussion in http://svn.haxx.se/dev/archive-2015-10/0022.shtml

("Re: No-op changes no longer dumped by 'svnadmin dump' in 1.9").

* subversion/libsvn_fs_base/dag.c

(svn_fs_base__things_different): Compare the uniquifiers, as we did in 1.8.

* subversion/libsvn_fs_base/fs.h

(node_revision_t.data_key_uniquifier): Remove the comment about not using

this field.

* subversion/libsvn_fs_fs/fs_fs.c

(svn_fs_fs__noderev_same_rep_key): Reintroduce this helper function.

(svn_fs_fs__file_text_rep_equal, svn_fs_fs__prop_rep_equal): Always

assume the strict mode in these helpers.

* subversion/libsvn_fs_fs/fs_fs.h

(svn_fs_fs__noderev_same_rep_key): Declare this re-added helper.

(svn_fs_fs__file_text_rep_equal, svn_fs_fs__prop_rep_equal): Update the

docstrings for these helper functions.

* subversion/libsvn_fs_fs/dag.c

(svn_fs_fs__dag_things_different): Preserve the current comparison behavior

in strict mode. Restore the 1.8 way of comparing the representation keys

in non-strict mode.

* subversion/libsvn_fs_fs/tree.c

(merge): Restore the 1.8 way of comparing property lists.

* subversion/libsvn_fs_fs/fs.h

(representation_t.uniquifier): Remove the comment about not using this

field.

* subversion/libsvn_repos/delta.c

(delta_proplists): Switch back to using svn_fs_props_changed().

(svn_repos__compare_files): Restore this function to its 1.8 state.

(delta_files): Restore the 1.8 way of comparing files.

* subversion/libsvn_repos/dump.c

(dump_node): Switch back to using svn_fs_contents_changed() and

svn_fs_props_changed().

* subversion/libsvn_repos/reporter.c

(delta_proplists): Switch back to using svn_fs_props_changed().

* subversion/libsvn_repos/rev_hunt.c

(send_path_revision): Switch back to using svn_fs_contents_changed().

Remove the no longer necessary hack for svn blame -g with older clients.

* subversion/include/svn_ra.h

(svn_ra_get_file_revs2): Update @note in the docstring.

* subversion/include/svn_repos.h

(svn_repos_get_file_revs2): Update @note in the docstring.

* subversion/tests/cmdline/svnadmin_tests.py

(dump_no_op_change): No longer fails with fsfs and bdb.

  1. … 13 more files in changeset.
Enable svn_repos_parse_dumpstream3() to work with incomplete parser callback

function tables. Replace the functions given by the caller as NULL with a

no-op dummy.

* subversion/include/svn_repos.h

(svn_repos_parse_dumpstream3): Add comment that caller requirements are

now relaxed.

* subversion/libsvn_repos/load.c

(dummy_handler_magic_header_record,

dummy_handler_uuid_record,

dummy_handler_new_revision_record,

dummy_handler_new_node_record,

dummy_handler_set_revision_property,

dummy_handler_set_node_property,

dummy_handler_delete_node_property,

dummy_handler_remove_node_props,

dummy_handler_set_fulltext,

dummy_handler_apply_textdelta,

dummy_handler_close_node,

dummy_handler_close_revision): Complete set of no-op dummy callbacks.

(SET_VTABLE_ENTRY): A local macro to make the next function more readable

and easier to maintain.

(complete_vtable): New function to patch up incomplate function tables.

(svn_repos_parse_dumpstream3): Patch up the function table before using it.

* subversion/tests/cmdline/svnadmin_tests.py

(load_revprops): No longer expected to fail.

  1. … 2 more files in changeset.
Implement the new 'svnadmin dump-revprops' sub-command.

The implementation uses a bumped version of svn_repos_dump_fs that can now

be told what kind of information to include in the dump. These new flags

are "positive" and non-restrictive, e.g. INCLUDE_REVPROPS instead of

REVPROPS_ONLY. That way, future revisions may easily extend this scheme.

* subversion/include/svn_repos.h

(svn_repos_dump_fs4): Declared API revision.

(svn_repos_dump_fs3): Deprecate the old one.

* subversion/libsvn_repos/dump.c

(write_revision_record): Make dumping revprops an option.

(svn_repos_dump_fs3): Replaced by ...

(svn_repos_dump_fs4): ... the new API revision. Dump contents depending on

the two new flag parameters.

* subversion/libsvn_repos/deprecated.c

(svn_repos_dump_fs3): Implement here now as forwarding to the latest API.

* subversion/bindings/javahl/native/SVNRepos.cpp

(dump): Call latest API version.

* subversion/tests/libsvn_repos/dump-load-test.c

(test_dump_bad_props): Same.

* subversion/svnadmin/svnadmin.c

(svn_opt_subcommand_t): Declare new sub-command.

(cmd_table): Define its UI.

(get_dump_range): Factored out from ...

(subcommand_dump): ... this.

(subcommand_dump_revprops): Implement new sub-command. Code taken from

subcommand_dump.

  1. … 5 more files in changeset.
Make the svn_repos_get_fs_build_parser5 API declaration fit its docstring

and consistent with the older / deprecated versions of that API.

No functional change.

* subversion/include/svn_repos.h

(svn_repos_get_fs_build_parser5): Rename CALLBACKS parameter to PARSER.

Implement the new 'svnadmin load-revprops' sub-command. It takes a normal

dumpfile but applies the revprop data only, and only to existing revisions.

We simply use the existing dumpfile parser infrastructure and implement

two callbacks: Starting a revision record b/c we don't create a txn here

and closing revisions - which sets the revprops. Revprop parser and magic

header callbacks can be reused from the standard dumpfile loader.

* subversion/include/svn_repos.h

(svn_repos_notify_action_t): Add a new notification for writing revprops.

(svn_repos_load_fs_revprops): Declare new API. This is a variant of the

existing svn_repos_load_fs5. We don't

trigger hooks nor do we modify the UUID.

* subversion/libsvn_repos/load-fs-vtable.c

(revprops_new_revision_record,

revprops_close_revision): New callback implementations.

(build_revprop_parser): New parser setup function. Based on the preexisting

svn_repos_get_fs_build_parser5.

(svn_repos_load_fs_revprops): Implement new API.

* subversion/svnadmin/svnadmin.c

(svn_opt_subcommand_t): Declare new sub-command.

(cmd_table): Add UI spec for the new sub-command.

(repos_notify_handler): Handle the new notification type.

(get_load_range): New utility, factored out from ...

(subcommand_load): ... this.

(subcommand_load_revprops): Implement the new sub-command. Code taken

mostly from subcommand_load.

  1. … 2 more files in changeset.
Add a notification if an svn_fs_pack call is a no-op. Use that to warn

users if they try to pack a non-sharded FSFS repo.

Extending the svn_fs_pack_notify_action_t enum seems to be the only way

to implement this without bumping the svn_fs_pack API: We can't use the

warning function because the svn_fs_t instance is created temporarily

inside the API function such that the user can't set warning function.

No-op packs are not an error condition either, therefore returning an

svn_error_t would be inappropriate.

To get the most milage out of this feature, we also notify if there is

no complete shard that can be packed. 'svnadmin pack' does not report

that condition to minimize UI changes. Other API users might be interested

in that information, though.

* subversion/include/svn_fs.h

(svn_fs_pack_notify_action_t): Add notification for no-op "action".

* subversion/include/svn_repos.h

(svn_repos_notify_action_t): Same in outer API layer.

* subversion/libsvn_fs_fs/pack.c

(pack_body): Notify if there was no shard to be packed.

(svn_fs_fs__pack): Same. Also warn if the repo is non-sharded.

* subversion/libsvn_repos/fs-wrap.c

(pack_notify_func): Translate the new notification as well.

* subversion/svnadmin/svnadmin.c

(repos_notify_handler): Print a warning if the repo is non-sharded.

* subversion/tests/cmdline/svnadmin_tests.py

(fsfs_pack_non_sharded): New test case.

(test_list): Register the new test.

  1. … 5 more files in changeset.
Following up on r1687769, extend the documentation about the lifetime of

the error passed to the new verify callback, and about who is responsible

for clearing it.

No functional changes.

* subversion/include/svn_repos.h

(svn_repos_verify_callback_t): Document the lifetime of 'verify_err'.

(svn_repos_verify_fs3): Include a @see link to svn_repos_verify_callback_t

for the convenience of a person crawling through the documentation.

Reimplement svn_repos_verify_fs3() to support an arbitrary callback that

receives the information about an encountered problem and lets the caller

decide on what happens next. This supersedes the keep_going argument for

this API. A callback is optional; the behavior of this API if the callback

is not provided is equivalent to how svn_repos_verify_fs2() deals with

encountered errors. This allows seamless migration to the new API, if the

callback is not necessary. The idea is partly taken from how our existing

svn_fs_lock_many() API works with a svn_fs_lock_callback_t and passes error

information to the caller.

Immediately use the new API to provide an alternative solution for the

encountered problem with 'svnadmin verify --keep-going -q' (see r1684940)

being useless in terms that it was only giving an indication of whether a

particular repository passes the verification or not, without providing a

root cause (details) of what's wrong.

Discussion can be found in http://svn.haxx.se/dev/archive-2015-05/0141.shtml

(Subject: "Possible incompatibility of svn_repos_verify_fs2() in 1.9.0-rc1")

* subversion/include/svn_error_codes.h

(SVN_ERR_REPOS_VERIFY_FAILED): Remove this error code, as we no longer

need to send a specific error from within svn_repos_verify_fs3().

(SVN_ERR_CL_REPOS_VERIFY_FAILED): New.

* subversion/include/svn_repos.h

(svn_repos_notify_action_t): Remove svn_repos_notify_failure.

(svn_repos_notify_t): Remove 'err' field, as it is no longer needed.

(svn_repos_verify_callback_t): New optional callback type to be used with

svn_repos_verify_fs3().

(svn_repos_verify_fs3): Drop 'keep_going' argument in favor of accepting a

svn_repos_verify_callback_t. Update the docstring accordingly.

(svn_repos_verify_fs2): Update the docstring for this deprecated function.

* subversion/libsvn_repos/deprecated.c

(svn_repos_verify_fs2): Update the call to svn_repos_verify_fs3() in this

compatibility wrapper. Don't pass the verify callback.

* subversion/libsvn_repos/dump.c

(notify_verification_error): Remove; this function is no longer required.

(report_error): New helper function.

(svn_repos_verify_fs3): In case we've got a svn_repos_verify_callback_t,

call it upon receiving an FS-specific structure failure or a revision

verification failure. Delegate this action to the new report_error()

helper function. Doing so makes the caller responsible for what's going

to happen with the error. The caller can choose to store the error,

ignore it or use it in any other necessary way. If a callback returns an

error, stop the verification process and immediately return that error.

If no callback is provided, mimic the behavior of svn_repos_verify_fs2()

and return the first encountered error. Drop the logic related to error

formatting, as we no longer need it at this layer. We are going to make

a simpler replacement for it is the UI code (svnadmin.c), where it is

supposed to live.

* subversion/svnadmin/svnadmin.c

(struct repos_verify_callback_baton): New. Contains the fields that are

required to track the --keep-going errors taken from ...

(struct repos_notify_handler_baton): ...this baton. After the previous

step, this baton only contains the 'feedback_stream' field, so inline it

into every calling site.

(repos_notify_handler): Baton is now simply an svn_stream_t. Remove the

boolean-based filtering logic from this handler and drop the handling of

svn_repos_notify_failure. The latter is moved, with a bit of tweaking,

into ...

(repos_verify_callback): ...this new function, that implements a callback

for svn_repos_verify_fs3(). Depending on whether we are in --keep-going

mode or not, either dump the failure details to stderr and track them to

produce a summary, or immediately return it through the callback, thus

ending the verification process. Remember all errors in the --keep-going

mode, not only those that are associated with a particular revision.

Prior to handling the error itself, tell that we failed to verify the

revision or metadata by writing corresponding messages to stderr.

(subcommand_dump, subcommand_load, subcommand_recover, subcommand_upgrade,

subcommand_hotcopy, subcommand_pack): Inline repos_notify_handler_baton

here, as it now contains a single svn_stream_t field.

(subcommand_verify): Inline repos_notify_handler_baton here, as it now

contains a single svn_stream_t field. Avoid manipulations with boolean

fields like b->silent_errors and b->silent_running, because we no longer

need them, and the fields themselves are gone. Create a feedback stream

only in non-quiet mode, as we do in other subcommand implementations.

Create a baton for repos_verify_callback() and adjust the calling site of

svn_repos_verify_fs3(), that now needs a callback. Adjust --keep-going

summary printing to the new approach with the verification callback.

Finally, provide a simple error if we encountered at least one failure

in the --keep-going mode.

* subversion/tests/cmdline/svnadmin_tests.py

(verify_keep_going, verify_keep_going_quiet, verify_invalid_path_changes):

Adjust the expectations, because now errors go straight to stderr in both

--keep-going and ordinary modes. Where possible, make the expectations a

bit stricter by extending the lines that we check with RegexListOutput().

* subversion/tests/libsvn_fs_fs/fs-fs-private-test.c

(load_index, load_index_keep_going): Squash two tests into one; basically,

undo the corresponding hunk from r1683311. As we no longer have separate

keep_going mode in svn_repos_verify_fs3(), and the caller decides if the

verification continues or not, we don't have to check two different

scenarios.

(test_funcs): Track the test changes.

* subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c

(fuzzing_1_byte_1_rev): Adjust the call to svn_repos_verify_fs3().

[in subversion/bindings]

* javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java

(ReposNotifyInformation.Action): Remove value that used to correspond

to svn_repos_notify_failure.

* javahl/src/org/apache/subversion/javahl/ISVNRepos.java

(ISVNRepos.verify): Remove 'keepGoing' argument from the newest overload

of this method and update the docstring. This patch does not expose

the ability to have control over verification failures through a custom

callback in JavaHL bindings, but we're going to address this separately.

* javahl/src/org/apache/subversion/javahl/SVNRepos.java

(SVNRepos.verify): Adjust two overloads of this method in the ISVNRepos

interface implementation.

* javahl/native/SVNRepos.h

(SVNRepos::verify): Remove 'keepGoing' argument from declaration.

* javahl/native/SVNRepos.cpp

(SVNRepos::verify): Remove 'keepGoing' argument. Do not pass a verify

callback when calling svn_repos_verify_fs3().

* javahl/native/org_apache_subversion_javahl_SVNRepos.cpp

(Java_org_apache_subversion_javahl_SVNRepos_verify): Remove 'jkeepGoing'

argument from this JNI wrapper.

  1. … 13 more files in changeset.
Incorporate svn_repos 1.9 API review feedback. No functional change.

* subversion/include/svn_repos.h

(svn_repos_notify_warning_t): Correct docstring.

Extend the documentation for new 1.9 FS and Repos (un-)lock-many API.

* subversion/include/svn_fs.h

(svn_fs_lock_many,

svn_fs_unlock_many): Note that these don't process the list of targets

atomically.

* subversion/include/svn_repos.h

(svn_repos_fs_lock_many,

svn_repos_fs_unlock_many): Same as in FS API.

  1. … 1 more file in changeset.
Documentation points raised by API review, no code changes.

* subversion/include/svn_fs.h

(svn_repos_fs_lock_many, svn_repos_fs_unlock_many): Tweak docstring.