svn_dirent_uri.h

Checkout Tools
  • last updated 4 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Follow up to r1849080: move a private function out of a public header.

* subversion/include/svn_dirent_uri.h: Update file-level docstrin.

(svn_relpath__internal_style): Removed.

* subversion/include/private/svn_dirent_uri_private.h: New file.

(svn_relpath__make_internal): Renamed from svn_relpath__internal_style.

* subversion/libsvn_subr/dirent_uri.c,

subversion/svndumpfilter/svndumpfilter.c,

subversion/tests/libsvn_subr/dirent_uri-test.c,

subversion/bindings/javahl/native/Path.cpp:

Include private/svn_dirent_uri_private.h and use svn_relpath__make_internal

instead of svn_relpath__internal_style.

* subversion/bindings/swig/python/svn/core.py

(__all__): Remove mention of svn_relpath__internal_style from the comment.

  1. … 6 more files in changeset.
Change a private function's signature to prevent potential assertions.

* subversion/include/svn_dirent_uri.h

(svn_relpath__internal_style): Change prototype so that the function can

return an error instead of aborting if anything goes wrong.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath__internal_style): Update the implementation.

* subversion/bindings/javahl/native/Path.cpp (Relpath::initfunc),

* subversion/svndumpfilter/svndumpfilter.c (sub_main),

* subversion/tests/libsvn_subr/dirent_uri-test.c (test_relpath_internal_style):

Updated all callers.

  1. … 4 more files in changeset.
* subversion/include/svn_dirent_uri.h

(svn_dirent_canonicalize,

svn_relpath_canonicalize,

svn_uri_canonicalize): Update docstrings, refering to the safe versions.

Add a safe variant of svn_dirent_internal_style().

* subversion/include/svn_dirent_uri.h

(svn_dirent_internal_style): Update docstring, pointing to ...

(svn_dirent_internal_style_safe): ... this new prototype.

* subversion/libsvn_subr/dirent_uri.c

(svn_dirent_internal_style_safe): Implement.

  1. … 1 more file in changeset.
Make sure that the "safe" canonicalization functions won't abort.

* subversion/include/svn_dirent_uri.h

(svn_dirent_canonicalize_safe,

svn_relpath_canonicalize_safe,

svn_uri_canonicalize_safe): Update docstrings.

* subversion/libsvn_subr/dirent_uri.c

(canonicalize): Change signature to return an svn_error_t.

Remove both assertions and return an error instead.

(canonicalize_dirent): New private helper function.

(svn_dirent_canonicalize,

svn_dirent_canonicalize_safe,

svn_relpath_canonicalize,

svn_relpath_canonicalize_safe,

svn_uri_canonicalize,

svn_uri_canonicalize_safe): Update implementations.

  1. … 1 more file in changeset.
Add new dirent, relpath and URI canonicalization functions that

check and report canonicalization failures.

* subversion/include/svn_dirent_uri.h: Update top-level docstring.

(svn_dirent_canonicalize_safe,

svn_relpath_canonicalize_safe,

svn_uri_canonicalize_safe): New prototypes.

* subversion/include/svn_error_codes.h

(SVN_ERR_CANONICALIZATION_FAILED): New error code.

* subversion/libsvn_subr/dirent_uri.c

(svn_dirent_canonicalize_safe,

svn_relpath_canonicalize_safe,

svn_uri_canonicalize_safe): Implement..

  1. … 2 more files in changeset.
Rename public API svn_relpath_limit() to svn_relpath_prefix().

No functional change intended.

* subversion/include/svn_dirent_uri.h

(svn_relpath_limit): Rename to ...

(svn_relpath_prefix): ... this.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath_limit,

svn_relpath_prefix): Sync. implementation with declaration.

* subversion/libsvn_wc/wc_db.c

(read_children_info,

read_single_info,

scan_addition,

svn_wc__db_scan_moved,

svn_wc__db_scan_moved_to_internal): Update callers.

* subversion/libsvn_wc/wc_db_update_move.c

(create_node_tree_conflict,

bump_moved_layer,

svn_wc__db_op_raise_moved_away_internal): Same.

  1. … 3 more files in changeset.
Replace a common allocating loop for obtaining an op_depth ancestor with a

generic helper function that does this smarter and without unnecessary

temporary allocations.

* subversion/include/svn_dirent_uri.h

(svn_relpath_limit): New function.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath_limit): New function.

* subversion/libsvn_wc/wc_db.c

(read_children_info,

read_single_info,

scan_addition_txn,

svn_wc__db_op_depth_moved_to): Replace loop until op-depth reached

constructions with a call to svn_relpath_limit.

  1. … 2 more files in changeset.
Following r1543145 (fixing a 'strange error' caused by a missing sentinel

argument), tag the functions that require a sentinel null as their last

argument such that GCC will warn if the sentinel is missing.

This attribute, however, only works (with GCC and Clang) where the sentinel

argument is of a pointer type, so it doesn't help in the specific case of

r1543145 because SVN_NO_ERROR is currently declared as a plain '0', but it

does help in these few other cases.

I enabled this for GCC >= 4.0, according to anecdotal evidence, and for

Clang when Clang claims it is available. I don't see an equivalent attribute

for MSC or other compilers but if there is one we can add it later.

* subversion/include/svn_types.h

(SVN_NEEDS_SENTINEL_NULL): Define.

* subversion/include/svn_dirent_uri.h

(svn_dirent_join_many): Tag.

* subversion/include/svn_path.h

(svn_path_join_many): Tag.

* subversion/include/svn_xml.h

(svn_xml_make_open_tag): Tag.

* subversion/libsvn_ra_serf/ra_serf.h

(svn_ra_serf__add_open_tag_buckets): Tag.

  1. … 4 more files in changeset.
Introduce a null-pointer constant that we can use as a termination sentinel

in variable argument lists. This avoids the ugliness of writing

"(char *) NULL" all over the place.

* subversion/include/svn_types.h (SVN_VA_NULL): New symbol.

* subversion/include/svn_dirent_uri.h (svn_dirent_join_many),

subversion/include/svn_path.h (svn_path_join_many),

subversion/include/svn_xml.h (svn_xml_make_open_tag):

Update docstrings, mentioning SVN_VA_NULL as the argument list terminator.

[Lots of implementation files]: Replace typecast-NULL with SVN_VA_NULL in

function calls with variable argument lists.

  1. … 89 more files in changeset.
Follow-up to r1519816, remove "to" that should have been removed.

* subversion/include/svn_dirent_uri.h:

(svn_dirent_skip_ancestor, svn_relpath_skip_ancestor): fix sentence.

Fix conflicting documentation for svn_(dirent|relpath)_skip_ancestor().

* subversion/include/svn_dirent_uri.h:

(svn_dirent_skip_ancestor, svn_relpath_skip_ancestor): They return ""

not NULL when parent and child are equal.

* subversion/include/svn_dirent_uri.h

Fix identation on the documentation that caused the relpath format section

to be parsed as a sub section of the uri format section.

* subversion/include/svn_dirent_uri.h

Document that paths are non-null unless

otherwise stated, and include the empty path in the examples of valid

and invalid paths.

* subversion/include/svn_dirent_uri.h

(svn_dirent_is_under_root): Use the proper doxygen markup.

Fix a doc string error and some inefficiency in svn_uri_basename(),

following r1064436.

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_uri_basename): Fix a doc string error. Simplify the implementation,

by knowing that a pool must be provided and by eliminating a redundant

memory allocation.

  1. … 1 more file in changeset.
Eliminate svn_uri__is_child().

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_uri__is_child): Delete.

* subversion/libsvn_client/cleanup.c

(fetch_repos_info): s/is_child/is_ancestor; benefit when relpath is "".

* subversion/libsvn_wc/upgrade.c

(ensure_repos_info): Same.

* subversion/libsvn_client/copy.c

(repos_to_repos_copy): s/is_child/skip_ancestor four times; in two cases

add a check for relpath "", and in the other two cases eliminate one.

Also fix an out-of-date comment and reduce scope of the variable.

(wc_to_repos_copy): s/is_child/skip_ancestor; it was clear that the

relpath is never "".

* subversion/libsvn_client/delete.c

(delete_urls_multi_repos): s/is_child/skip_ancestor twice; relpath "" is

not valid (and, in cases where relpath is "", it will merely crash at a

different place than it did before).

* subversion/libsvn_client/info.c

(push_dir_info): s/is_child/skip_ancestor; it was clear that the

relpath is never "".

* subversion/libsvn_client/merge.c

(make_conflict_versions): Same.

* subversion/libsvn_client/commit.c

(collect_lock_tokens): Eliminate an is_ancestor call by using the existing

skip_ancestor result.

* subversion/libsvn_client/util.c

(svn_client__path_relative_to_root): Same.

* subversion/libsvn_wc/update_editor.c

(svn_wc_add_repos_file4): Same.

* subversion/libsvn_ra_local/ra_plugin.c

(reporter_link_path): Same.

(svn_ra_local__reparent): s/is_child/is_ancestor and eliminate a strcmp.

* subversion/libsvn_subr/target.c

(svn_path_remove_redundancies): s/is_child/skip_ancestor, both for URI and

dirent, and eliminate a strcmp.

* subversion/libsvn_wc/adm_files.c

(svn_wc__internal_ensure_adm): s/is_child/skip_ancestor; eliminate both

the check for relpath "" and an is_ancestor call in an assertion.

* subversion/libsvn_wc/entries.c

(write_entry): s/is_child/skip_ancestor three times; in two cases

eliminate checks for relpath "" and in the third case adjust the check.

* subversion/libsvn_wc/externals.c

(close_file, svn_wc__get_file_external_editor): s/is_child/skip_ancestor

twice; trust that the semantic change is unlikely to be harmful, since

it seems likely and passes tests, but the use of these paths is

insufficiently documented to be sure.

* subversion/svnsync/main.c

(do_initialize): s/is_child/strcmp, as the URL has to be either a child or

the same as the repository root so we just need to test whether it's the

same.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_uri_is_child): Delete.

(test_list): Remove test_uri_is_child.

  1. … 17 more files in changeset.
Clarify pool usage in the dirent/uri/relpath API. The goal here is to make

the lifetime of the result, and the purpose of the supplied pool(s), clear

to API users. No functional change.

* subversion/include/svn_dirent_uri.h

Note that a static string such as "." may be returned in any case.

Rename scratch pools to 'scratch_pool' and result pools (even where there

is no separate scratch pool) to 'result_pool'. Use consistent and simple

wording in each doc string.

* subversion/libsvn_subr/dirent_uri.c

Rename scratch pools to 'scratch_pool'. Don't rename result pools, as that

would seem to be unnecessary code churn.

  1. … 1 more file in changeset.
Eliminate svn_relpath__is_ancestor(); use svn_relpath_skip_ancestor()

instead.

* subversion/include/svn_dirent_uri.h

(svn_relpath__is_ancestor): Remove.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath__is_ancestor): Remove.

(svn_fspath__is_ancestor): Use svn_fspath_skip_ancestor() instead.

* subversion/libsvn_ra_serf/merge.c

(svn_ra_serf__merge_lock_token_list): Use svn_relpath_skip_ancestor()

instead.

* subversion/libsvn_wc/adm_files.c

(svn_wc__internal_ensure_adm): Same.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_wclock_obtain, is_wclocked, wclock_owns_lock): Same.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_relpath_is_ancestor): Remove.

(test_funcs): Remove test_relpath_is_ancestor from the list.

  1. … 5 more files in changeset.
Eliminate svn_relpath__is_child(); use svn_relpath_skip_ancestor() instead.

* subversion/include/svn_dirent_uri.h

(svn_relpath__is_child): Remove.

* subversion/libsvn_subr/dirent_uri.c

(svn_relpath__is_child): Remove.

(svn_fspath__is_child): Use is_child() directly instead of

svn_relpath__is_child().

* subversion/include/svn_path.h

(svn_path_is_child): Update the recommendations in the deprecation clause.

* subversion/libsvn_fs_fs/tree.c

(prev_location, history_prev): Use _skip_ancestor instead of __is_child.

In these cases, this is a simplification because special handling of the

"" result (when parent == child) is eliminated.

* subversion/libsvn_ra_neon/commit.c

(get_child_tokens): Same. If the result is "", don't use it. Eliminate the

subpool as it is now unused.

* subversion/libsvn_ra_serf/commit.c

(checkout_file): Same. A result of "" is never expected.

* subversion/libsvn_repos/replay.c

(path_driver_cb_func): Same. Assert the result is never "".

* subversion/libsvn_wc/adm_crawler.c

(report_revisions_and_depths): Same. A return value of "" will always fail

the following test just as NULL would.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_get_not_present_descendants): Same. A result of "" is never

expected. Duplicate the result to achieve the required lifetime.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_relpath_is_child): Remove. Anyway, this was accidentally testing

svn_dirent_is_child(); nothing was testing svn_relpath__is_child().

  1. … 9 more files in changeset.
* subversion/include/svn_dirent_uri.h

(svn_dirent_is_child, svn_dirent_is_ancestor): Add a note that we intend

to deprecate these.

Add documentation and more tests for the URI port-number canonicalization that

was added in r1137927.

* subversion/include/svn_dirent_uri.h

(svn_uri_canonicalize): Mention port-number canonicalization.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(uri_canonical_tests): Add more test cases.

  1. … 1 more file in changeset.
Re-format some dirent_uri doc strings for nicer Doxygen output.

* subversion/include/svn_dirent_uri.h

(svn_dirent_canonicalize, svn_relpath_canonicalize, svn_uri_canonicalize):

Re-format the list of transformations.

(svn_dirent_is_canonical, svn_relpath_is_canonical, svn_uri_is_canonical):

Add a cross-reference to the corresponding _canonicalize function.

Tweak doc strings.

* subversion/include/svn_dirent_uri.h

(svn_uri__is_child, svn_dirent_is_child, svn_relpath__is_child):

Re-document in terms of their respective _skip_ancestor() counterparts.

(svn_relpath__is_ancestor, svn_uri__is_ancestor): Remove '@since', because

that is unnecessary for private functions.

Clarify the semantics of svn_dirent_is_under_root() and add test cases.

* subversion/include/svn_dirent_uri.h

(svn_dirent_is_under_root): Expand and clarify the doc string.

* subversion/libsvn_subr/dirent_uri.c

(svn_dirent_is_under_root): Rename parameters to match the prototype.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_dirent_is_under_root): Add more test cases.

  1. … 2 more files in changeset.
Make these new APIs private: svn_uri_is_ancestor(), svn_relpath_is_ancestor().

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_uri_is_ancestor): Rename to svn_uri__is_ancestor().

(svn_relpath_is_ancestor): Rename to svn_relpath__is_ancestor().

* Everywhere else: Adjust calls.

  1. … 20 more files in changeset.
Make these new APIs private: svn_uri_is_child(), svn_relpath_is_child().

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_uri_is_child): Rename to svn_uri__is_child().

(svn_relpath_is_child): Rename to svn_relpath__is_child().

* Everywhere else: Adjust calls.

  1. … 26 more files in changeset.
Make svn_uri_skip_ancestor() URI-decode its result, because that makes sense

for returning a relpath, and because that's what all current callers want,

and because that brings the semantics of this function and svn_uri_is_child()

one step closer together.

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_uri_skip_ancestor): Decode the result. Add a result pool parameter.

* subversion/libsvn_client/commit.c

(collect_lock_tokens): Don't decode the result after calling it.

* subversion/libsvn_client/commit_util.c

(harvest_copy_committables): Same.

* subversion/libsvn_client/merge.c

(merge_reintegrate_locked): Same.

* subversion/libsvn_client/util.c

(svn_client__path_relative_to_root): Same.

* subversion/libsvn_ra_local/ra_plugin.c

(reporter_link_path): Same.

* subversion/libsvn_wc/adm_ops.c

(svn_wc_add4): Same.

* subversion/libsvn_wc/update_editor.c

(make_editor, svn_wc_add_repos_file4): Same.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_uri_skip_ancestor): Adjust the call.

  1. … 9 more files in changeset.
Simplify the semantics of svn_dirent_skip_ancestor() to return NULL if the

supposed child is not in fact a child.

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_dirent_skip_ancestor): Return NULL if 'child' is not a child.

* subversion/tests/cmdline/entries-dump.c

(print_dir): Handle the case where the 'child' is not in fact a child.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_dirent_skip_ancestor): Adjust the test accordingly.

* subversion/svn/cl.h,

subversion/svn/util.c

(svn_cl__local_style_skip_ancestor): New function, combining the old

semantics of svn_dirent_skip_ancestor() with more behaviour that all

callers want.

* subversion/svn/info-cmd.c

(print_info_xml, print_info): Use svn_cl__local_style_skip_ancestor().

* subversion/svn/notify.c

(notify): Same.

* subversion/svn/propget-cmd.c

(print_properties): Same.

* subversion/svn/update-cmd.c

(print_update_summary): Same.

  1. … 9 more files in changeset.
Simplify the semantics of svn_uri_skip_ancestor() to return NULL if the

supposed child is not in fact a child.

* subversion/include/svn_dirent_uri.h,

subversion/libsvn_subr/dirent_uri.c

(svn_uri_skip_ancestor): Return NULL if 'child' is not a child.

* subversion/tests/libsvn_subr/dirent_uri-test.c

(test_uri_skip_ancestor): Adjust the test accordingly.

  1. … 2 more files in changeset.