Checkout Tools
  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Rename our debug helpers, svn_hash__gets() and svn_hash__sets() to make

them visually different from the svn_hash_gets() and svn_hash_sets()

macros.

These functions are only used in conjunction with SVN_DEBUG to gain

additional type safety, and should not be used by themselves in the

production code.

* subversion/include/svn_hash.h

(svn_hash__gets, svn_hash__sets): Rename to ...

(svn_hash__gets_debug, svn_hash__sets_debug): ...this.

(svn_hash_gets, svn_hash_sets): Update these macros.

* subversion/libsvn_subr/hash.c

(svn_hash__gets, svn_hash__sets): Rename to ...

(svn_hash__gets_debug, svn_hash__sets_debug): ...this.

  1. … 1 more file in changeset.
* subversion/include/svn_hash.h

(svn_hash_gets, svn_hash_sets): Move docstrings to the non-SVN_DEBUG block

so doxygen sees them. No code change occurred.

Change the way we declare the svn_hash__gets/sets private functions, to

match the way svn_error__locate is defined.

This hides the private function's declaration from code during non-debug

builds to ensure we are not accidentally calling it directly, while still

allowing the declaration to be seen while compiling the definition.

* subversion/include/svn_hash.h

(SVN_HASH__GETS_SETS): New macro, defined when SVN_DEBUG is defined.

(svn_hash__gets,

svn_hash__sets): Declare only when SVN_HASH__GETS_SETS is defined.

(svn_hash_gets,

svn_hash_sets): Use the forwarding-through-a-function version when

SVN_HASH__GETS_SETS is defined, rather than (directly) when SVN_DEBUG is

defined.

* subversion/libsvn_subr/hash.c

Define SVN_HASH__GETS_SETS before including svn_hash.h.

  1. … 1 more file in changeset.
* subversion/include/svn_hash.h

(svn_hash_sets): Fix remaining breakage from r1663896.

* subversion/include/svn_hash.h

(svn_hash_sets): Rename from svn_hash_gets, to fix r1663896.

Redefine the svn_hash_sets macro to match the way svn_hash_gets is defined,

thus avoiding a backward compatibility problem. A follow-up to r1663760 and

r1663780.

Found by: danielsh

* subversion/include/svn_hash.h

(svn_hash__sets): New function.

(svn_hash_sets): In debug mode, call svn_hash__sets; in release mode, call

apr_hash_set directly.

* subversion/libsvn_subr/hash.c

(svn_hash__sets): New function.

  1. … 1 more file in changeset.
* subversion/include/svn_hash.h

(svn_hash__gets): Remove #if from prototype to match definition.

Redefine the svn_hash_gets and svn_hash_sets macros in a way that allows for

parameter type checking, at least in debug builds.

* subversion/include/svn_hash.h

(svn_hash__gets): New function.

(svn_hash_gets): In debug mode, call svn_hash__gets; in release mode, call

apr_hash_get directly. (The prototype of apr_hash_get checks the type of

the 'ht' parameter but not of the 'key'.)

(svn_hash_sets): Rewrite so as to assign the 'key' parameter to a 'const

char *' variable and so get type checking.

* subversion/libsvn_subr/hash.c

(svn_hash__gets): New function.

  1. … 1 more file in changeset.
Revert svn_hash_gets() and svn_hash_sets() to use the original simple

implementation. The optimizations are not worth it.

Thread: http://mid.gmane.org/CA+t0gk2hjP0hks1WS23DybKtRyHw0-aupP3wU81ptnu=o7-+Nw@mail.gmail.com

* subversion/include/svn_hash.h

(svn_hash_gets, svn_hash_sets): Revert to 1.8 code.

This changes the definition without changing the semantics.

Depending on the #include order of svn_private_config.h vs.

svn_hash.h, SVN_HAS_DUNDER_BUILTINS may not be defined when

the svn_hash_gets macro is being parsed.

Generate a compiler warning when svn_hash.h gets #included

before svn_private_config.h.

* subversion/include/svn_hash.h

(SVN_HAS_DUNDER_BUILTINS): disable optimization when undefined

(svn_hash_gets): extend commentary

Follow-up to r1507366: svn_hash_gets: compute the length of string literal

keys (common case) at compile-time, without multiply-evaluating dynamically-

computed keys.

Review by: philip

breser

* build/ac-macros/svn-macros.m4

(SVN_CHECK_FOR_DUNDER_BUILTINS): New macro.

* configure.ac:

Call SVN_CHECK_FOR_DUNDER_BUILTINS() and set -D SVN_HAS_DUNDER_BUILTINS.

* subversion/include/svn_hash.h

(svn_hash_gets): Use __builtin_choose_expr() and __builtin_constant_p(),

when available.

  1. … 2 more files in changeset.
* subversion/include/svn_hash.h:

(svn_hash_sets): Change temp variable name to avoid shadow warnings.

Suggested by: philip

[This is the commit that was intended to be committed in r1507390]

Fix possible duplication of work when using svn_hash_gets() macro.

This is similar to the situation described about svn_hash_sets() in

r1507155. However, we can't use the fix used there because svn_hash_gets()

has a return value. This essentially rolls back the opportunity for the

compiler to optimize the strlen() call when the key is a literal string. It

also puts svn_hash_gets() back to the same implementation it had in r1443387.

* subversion/include/svn_hash.h

(svn_hash_gets): Use APR_HASH_KEY_STRING as length.

Fix possible duplication of work when using svn_hash_sets() macro.

svn_hash_sets() is a macro that uses the key argument twice, so the expression

used in the key argument will be evaluated twice. We often put calls to

apr_pstrdup() and other functions in that position, which causes unnecessary

extra work and memory usage.

* subversion/include/svn_hash.h

(svn_hash_sets): Use a variable to avoid executing key expression twice.

Revert the remainder of 1483532 and replace it with a much safer /

simpler solution.

Suggested by: julianfoad

* subversion/include/svn_hash.h

(svn_hash_gets,

svn_hash_sets): calculate key length statically when possible

(svn_hash_gets_fixed_key,

svn_hash_sets_fixed_key): drop

* subversion/libsvn_fs_fs/tree.c

(crawl_directory_dag_for_mergeinfo): switch back to svn_hash_gets /

svn_hash_sets

* subversion/libsvn_ra_svn/client.c

(ra_svn_log): same

* subversion/libsvn_repos/log.c

(fill_log_entry): same

* subversion/libsvn_repos/rev_hunt.c

(svn_repos_get_committed_info): same

* subversion/libsvn_subr/compat.c

(svn_compat_log_revprops_clear, svn_compat_log_revprops_out): same

  1. … 5 more files in changeset.
We frequently use property name constants in conjunction with hash containers.

Provide new wrappers around apr_hash_get and apr_hash_set that accept such

string constants and statically determine their size. That minimizes the

hash access costs.

Mass change hash get and set calls for SVN_PROP_* constants.

* subversion/include/svn_hash.h

(svn_hash_gets,

svn_hash_sets): Doxygen-ize the docstring

(svn_hash_gets_fixed_key,

svn_hash_sets_fixed_key): define new apr_hash_* wrapper

* subversion/libsvn_client/add.c

(svn_client__get_all_auto_props): use faster hash wrappers with SVN_PROP_*

* subversion/libsvn_client/commit_util.c

(svn_client__ensure_revprop_table): ditto

* subversion/libsvn_client/copy.c

(repos_to_wc_copy_single): ditto

* subversion/libsvn_client/list.c

(svn_client__ra_stat_compatible): ditto

* subversion/libsvn_client/log.c

(pre_15_receiver): ditto

* subversion/libsvn_client/merge.c

(prepare_merge_props_changed, merge_file_added, merge_dir_added,

merge_dir_deleted): ditto

* subversion/libsvn_client/mergeinfo.c

(svn_client__get_wc_or_repos_mergeinfo_catalog): ditto

* subversion/libsvn_fs_base/tree.c

(txn_body_get_mergeinfo_data_and_entries,

txn_body_get_mergeinfo_for_path): same

* subversion/libsvn_fs_fs/fs_fs.c

(write_revision_zero): same

* subversion/libsvn_fs_fs/tree.c

(crawl_directory_dag_for_mergeinfo, get_mergeinfo_for_path_internal): same

* subversion/libsvn_ra/deprecated.c

(svn_ra_get_commit_editor2): same

* subversion/libsvn_ra_local/ra_plugin.c

(svn_ra_local__get_commit_editor, svn_ra_local__get_commit_ev2): same

* subversion/libsvn_ra_svn/client.c

(ra_svn_commit, ra_svn_log): same

* subversion/libsvn_repos/commit.c

(svn_repos__get_commit_ev2): same

* subversion/libsvn_repos/delta.c

(delta_proplists): same

* subversion/libsvn_repos/deprecated.c

(svn_repos_get_commit_editor4): same

* subversion/libsvn_repos/dump.c

(dump_node, write_revision_record):

* subversion/libsvn_repos/fs-wrap.c

(svn_repos_fs_begin_txn_for_commit2, svn_repos_fs_begin_txn_for_commit,

svn_repos_fs_revision_proplist): same

* subversion/libsvn_repos/log.c

(fill_log_entry): same

* subversion/libsvn_repos/reporter.c

(get_revision_info): same

* subversion/libsvn_repos/rev_hunt.c

(svn_repos_get_committed_info): same

* subversion/libsvn_subr/compat.c

(svn_compat_log_revprops_clear, svn_compat_log_revprops_out): same

* subversion/libsvn_wc/status.c

(collect_ignore_patterns): same

* subversion/mod_dav_svn/activity.c

(dav_svn__create_txn): same

* subversion/mod_dav_svn/lock.c

(append_locks): same

* subversion/svndumpfilter/svndumpfilter.c

(output_revision): same

* subversion/svnmucc/svnmucc.c

(execute, sanitize_log_sources): same

* subversion/svnrdump/load_editor.c

(new_node_record): same

* subversion/svnserve/serve.c

(commit): same

* subversion/svnsync/svnsync.c

(replay_rev_started): same

[Most of this got reverted in r1483610]

[Remainder reverted in r1484181]

  1. … 30 more files in changeset.
Define two macros that should make using our most common type of apr_hash_t *

instances much easier.

* subversion/include/svn_hash.h

(svn_hash_gets,

svn_hash_sets): New macros.

Move private svn_hash API to a private header.

* subversion/include/svn_hash.h

(svn_hash__clear, svn_hash__get_cstring, svn_hash__get_bool):

move from here ...

* subversion/include/private/svn_hash_private.h

... to here; new file

* subversion/libsvn_client/merge.c,

subversion/libsvn_client/patch.c,

subversion/libsvn_fs/fs-loader.c,

subversion/libsvn_fs_fs/caching.c,

subversion/libsvn_fs_fs/fs_fs.c,

subversion/libsvn_repos/repos.c,

subversion/libsvn_subr/hash.c,

subversion/libsvn_wc/adm_ops.c,

subversion/svnrdump/dump_editor.c: include new private header

  1. … 10 more files in changeset.
The semi-annual trailing whitespace cleansing ritual.

* everywhere:

for extsn in c h cpp java py pl rb; do

sed -i -e 's/[ \t]*$//' `find . -name "*.$extsn" | xargs grep '[ \t]$' -l`

done

  1. … 144 more files in changeset.
Make the new hash_get and tristate APIs private by renaming them with "__".

This in an interim step to give us more time to decide what to do with them.

* subversion/include/svn_hash.h,

subversion/libsvn_subr/hash.c

(svn_hash_get_cstring): Rename to svn_hash__get_cstring().

(svn_hash_get_bool): Rename to svn_hash__get_bool().

* subversion/include/svn_types.h,

subversion/libsvn_subr/kitchensink.c

(svn_tristate_to_word): Rename to svn_tristate__to_word().

(svn_tristate_from_word): Rename to svn_tristate__from_word().

* subversion/libsvn_fs_fs/caching.c

(read_config): Track the rename.

* subversion/libsvn_fs/fs-loader.c

(svn_fs_create): Same.

* subversion/libsvn_ra_neon/log.c

(log_start_element): Same.

* subversion/libsvn_ra_serf/log.c

(read_changed_path_attributes): Same.

* subversion/libsvn_repos/repos.c

(svn_repos_create): Same.

* subversion/libsvn_subr/config.c

(get_bool): Same.

* subversion/mod_dav_svn/reports/log.c

(log_receiver): Same.

* subversion/svn/log-cmd.c

(log_entry_receiver_xml): Same.

* subversion/svnserve/main.c

(main): Same.

  1. … 12 more files in changeset.
Doxygen mark-up tweaks: instead of @ref, use # to refer to a structure or

trailing () to refer to a function.

  1. … 7 more files in changeset.
Provide hash lookup functions that will return default values if either

the hash itself or the keyed entry are unavailable. This is useful where

options are stored in hashes instead of svn_config_t structures.

* subversion/include/svn_hash.h

(svn_hash_get_cstring, svn_hash_get_bool): declare new API functions

* subversion/libsvn_subr/hash.c

(svn_hash_get_cstring, svn_hash_get_bool): implement them

  1. … 1 more file in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.

* NOTICE:

Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
Never use an APR hash's built-in iterator, as this is not thread-safe. Always

allocate it in a pool. This is a follow-up to r39869 and fixes the last

remaining instances in the core code. There are still some in swigutil_*.c.

* subversion/include/svn_hash.h,

subversion/libsvn_subr/hash.c

(svn_hash__clear): Add a pool argument and use it for the hash iterator.

* subversion/libsvn_client/merge.c

(path_is_subtree): Add a pool argument and use it for the hash iterator.

(subtree_touched_by_merge): Pass a pool to path_is_subtree().

* subversion/libsvn_client/repos_diff.c

(close_directory): Pass a pool to svn_hash__clear().

* subversion/libsvn_fs_fs/fs_fs.c

(svn_fs_fs__revision_proplist): Pass a pool to svn_hash__clear().

* subversion/tests/libsvn_wc/tree-conflict-data-test.c

(test_write_invalid_tree_conflicts): Pass a pool to svn_hash__clear().

  1. … 5 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.

* LICENSE: New.

* COPYING,

subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.
Adjust a bunch of our public header files:

- make sure everything the header needs is included

- make sure nothing is included which is NOT needed

Added an exception to svn_types.h: it now explicitly includes svn_error.h

since Everybody needs that thing. We go ahead and make it easy for them,

even though that is counter-philosophy.

After altering the header files, some .c files in our codebase would not

compile -- they used stuff that they did not explicitly include. Thus, a

goodly number of .c files were updated, too.

* subversion/libsvn_ra/wrapper_template.h:

* subversion/libsvn_ra/deprecated.c:

* subversion/libsvn_ra/compat.c:

* subversion/libsvn_subr/iter.c:

* subversion/libsvn_subr/cmdline.c:

* subversion/libsvn_subr/ssl_client_cert_pw_providers.c:

* subversion/libsvn_subr/error.c:

* subversion/libsvn_subr/auth.c:

* subversion/libsvn_subr/opt.c:

* subversion/libsvn_subr/checksum.c:

* subversion/libsvn_subr/compat.c:

* subversion/libsvn_subr/sha1.c:

* subversion/libsvn_subr/deprecated.c:

* subversion/libsvn_subr/ssl_server_trust_providers.c:

* subversion/mod_dav_svn/activity.c:

* subversion/mod_dav_svn/reports/log.c:

* subversion/tests/libsvn_fs/fs-test.c:

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

* subversion/svn/list-cmd.c:

* subversion/svn/changelist-cmd.c:

* subversion/svn/log-cmd.c:

* subversion/svn/conflict-callbacks.c:

* subversion/libsvn_fs_base/dag.c:

* subversion/libsvn_fs_base/util/fs_skels.c:

* subversion/include/svn_dirent_uri.h:

* subversion/include/svn_error_codes.h:

* subversion/include/svn_fs.h:

* subversion/include/svn_diff.h:

* subversion/include/svn_sorts.h:

* subversion/include/svn_mergeinfo.h:

* subversion/include/svn_base64.h:

* subversion/include/svn_dso.h:

* subversion/include/svn_ra_svn.h:

* subversion/include/svn_repos.h:

* subversion/include/svn_delta.h:

* subversion/include/svn_path.h:

* subversion/include/svn_subst.h:

* subversion/include/svn_xml.h:

* subversion/include/svn_props.h:

* subversion/include/svn_iter.h:

* subversion/include/svn_types.h:

* subversion/include/svn_config.h:

* subversion/include/svn_string.h:

* subversion/include/svn_io.h:

* subversion/include/svn_wc.h:

* subversion/include/svn_cmdline.h:

* subversion/include/svn_client.h:

* subversion/include/svn_user.h:

* subversion/include/svn_hash.h:

* subversion/include/svn_md5.h:

* subversion/include/svn_error.h:

* subversion/include/svn_pools.h:

* subversion/include/private/svn_log.h:

* subversion/include/svn_time.h:

* subversion/include/svn_utf.h:

* subversion/include/svn_auth.h:

* subversion/include/svn_ra.h:

* subversion/include/svn_opt.h:

* subversion/include/svn_checksum.h:

* subversion/libsvn_wc/deprecated.c:

* subversion/libsvn_wc/util.c:

* subversion/libsvn_wc/merge.c:

* subversion/libsvn_wc/tree_conflicts.c:

* subversion/libsvn_client/list.c:

* subversion/libsvn_client/log.c:

* subversion/libsvn_ra_neon/util.c:

* subversion/libsvn_ra_neon/log.c:

* subversion/libsvn_repos/deprecated.c:

* subversion/libsvn_fs_fs/tree.c:

* subversion/libsvn_fs_fs/fs_fs.c:

(): adjust #include statements appropriately

  1. … 69 more files in changeset.
Mark deprecated functions with SVN_DEPRECATED.

* subversion/include/svn_types.h

(SVN_DEPRECATED): Define.

* subversion/include/svn_auth.h:

* subversion/include/svn_base64.h:

* subversion/include/svn_client.h:

* subversion/include/svn_cmdline.h:

* subversion/include/svn_config.h:

* subversion/include/svn_delta.h:

* subversion/include/svn_diff.h:

* subversion/include/svn_dso.h:

* subversion/include/svn_error.h:

* subversion/include/svn_fs.h:

* subversion/include/svn_hash.h:

* subversion/include/svn_io.h:

* subversion/include/svn_opt.h:

* subversion/include/svn_ra.h:

* subversion/include/svn_ra_svn.h:

* subversion/include/svn_repos.h:

* subversion/include/svn_subst.h:

* subversion/include/svn_utf.h:

* subversion/include/svn_wc.h: Mark deprecated functions with SVN_DEPRECATED.

* www/hacking.html

  (deprecation): Update example.

Review by: blair

julianfoad

  1. … 20 more files in changeset.
Fix code formatting in some headers.

* subversion/include/svn_auth.h:

* subversion/include/svn_base64.h:

* subversion/include/svn_client.h:

* subversion/include/svn_config.h:

* subversion/include/svn_delta.h:

* subversion/include/svn_dso.h:

* subversion/include/svn_error.h:

* subversion/include/svn_fs.h:

* subversion/include/svn_hash.h:

* subversion/include/svn_io.h:

* subversion/include/svn_ra.h:

* subversion/include/svn_ra_svn.h:

* subversion/include/svn_repos.h:

* subversion/include/svn_utf.h: Place function types on separate lines.

Suggested by: julianfoad

  1. … 13 more files in changeset.
* subversion/include/svn_hash.h

(svn_hash_keys, svn_hash_from_cstring_keys): Doc fixes.

Rename and repurpose svn_hash_from_keys(). (Which, by the way, also

has the effect of fixing a broken svn_client_get_changelists() function.)

* subversion/include/svn_hash.h

* subversion/libsvn_subr/hash.c

(svn_hash_from_cstring_keys): Was svn_hash_from_array. Don't try to

be generic with the keys array; require strings.

* subversion/libsvn_client/changelist.c

(svn_client_get_changelists): Track function rename.

  1. … 2 more files in changeset.