Checkout Tools
  • last updated 1 hour ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1464122 is being indexed.

Avoid parsing the hooks-env file multiple times for closely-knit hook

invocations, specifically the pre-/post- pairs for commit, revprop

change, lock, and unlock operations.

* subversion/libsvn_repos/repos.h,

* subversion/libsvn_repos/hooks.c

(svn_repos__parse_hooks_env): Was parse_hooks_env().









svn_repos__hooks_post_unlock): Add 'hooks_env' parameter, used now

instead of calling parse_hooks_env() from within.

* subversion/libsvn_repos/commit.c

(complete_cb, svn_repos__get_commit_ev2): Call

svn_repos__parse_hooks_env(), and update calls to hook wrapper


* subversion/libsvn_repos/fs-wrap.c

(svn_repos_fs_commit_txn, svn_repos_fs_begin_txn_for_commit2,

svn_repos_fs_change_rev_prop4, svn_repos_fs_lock, svn_repos_fs_unlock):

Call svn_repos__parse_hooks_env(), and update calls to hook wrapper


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

(close_revision): Call svn_repos__parse_hooks_env(), and update

calls to hook wrapper functions.

Revert my r1464079 commit, which failed an IRC-based popularity test.

Fix issue #4329 'automatic merge uses reintegrate type merge if source is

fully synced' and issue #4258 'Automatic merge after subtree merge in

opposite direction'.

* subversion/libsvn_client/merge.c

(operative_rev_receiver): New svn_log_entry_receiver_t callback.

(find_last_merged_location): Replace target mergeinfo argument with a

svn_client__pathrev_t representing the target. Reimplement using

svn_client_mergeinfo_log2 to find the youngest revision fully merged from

source to target and the oldest revision eligible for merging from

source to target.


find_base_on_target): Update calls to find_last_merged_location().

* subversion/tests/cmdline/


effective_sync_results_in_reintegrate): Remove XFail decorator and

update comments re failure status.

* subversion/tests/cmdline/

(reintegrate_with_subtree_merges): Expand test to cover issue #4329.

On the fsfs-format7 branch, add an entry to BRANCH-README.

Avoid parsing the hooks-env file with every hook invocation by caching

the results of the first such parsing in the svn_repos_t.

* subversion/libsvn_repos/repos.h

(svn_repos_t): Add 'hooks_env' member.

* subversion/libsvn_repos/hooks.c

(parse_hooks_env): Lose 'result_pool' and 'local_abspath'

parameters; add 'repos'. Now consult/populate a cache of this

hooks-env data found in the svn_repos_t object.









svn_repos__hooks_post_unlock): Update calls to parse_hooks_env().

Avoid an unenforceable API restriction. Add a 'pool' to svn_repos_t,

and use it in svn_repos_hooks_setenv(). This way, callers *can't* not

use the same pool as the one from which the svn_repos_t was allocated,

and thus can't violate the previously stated restriction.

* subversion/libsvn_repos/repos.h

(svn_repos_t): Add 'pool' member.

* subversion/include/svn_repos.h

(svn_repos_hooks_setenv): Lose 'result_pool' parameter.

* subversion/libsvn_repos/repos.c

(svn_repos_hooks_setenv): Lose 'result_pool' parameter. Use,

instead, the new repos->pool instead.

(create_svn_repos_t): Initialize new 'pool' structure member.

* subversion/libsvn_ra_local/split_url.c

(svn_ra_local__split_URL): Update call to svn_repos_hooks_setenv().

* subversion/svnserve/serve.c

(find_repos): Update call to svn_repos_hooks_setenv().

* subversion/mod_dav_svn/repos.c

(get_resource): Update call to svn_repos_hooks_setenv().

Remove some (void) casts of ignored return values.

* subversion/libsvn_repos/hooks.c

(parse_hooks_env_section, parse_hooks_env): Remove cast.

* subversion/libsvn_delta/path_driver.c

(pop_stack): Remove cast.

Remove (void) casts of ignored return values from mod_dav_svn, add

some extra handling for parameters that could be used when errors

are ignored.

* subversion/mod_dav_svn/liveprops.c

(is_writable): Remove cast, only dereference non-NULL pointer.

(dav_svn__insert_all_liveprops): Remove cast.

* subversion/mod_dav_svn/lock.c

(unescape_xml): Remove cast, initialise buffer.

* subversion/mod_dav_svn/mod_dav_svn.c

(merge_xml_in_filter): Remove cast.

* subversion/mod_dav_svn/util.c

(dav_svn__final_flush_or_error): Remove cast, initialise length.

* subversion/mod_dav_svn/merge.c

(dav_svn__merge_response): Don't ignore return value of brigade

output calls.

* subversion/libsvn_repos/hooks.c (parse_hooks_env): Remove unused variable.

Read repository hooks environment file just before hook execution.

* subversion/libsvn_repos/repos.c

(parse_hooks_env_option_baton, parse_hooks_env_option,

parse_hooks_env_section_baton, parse_hooks_env_section, parse_hooks_env):

Move to subversion/libsvn_repos/hooks.c.

(svn_repos_hooks_setenv): Just save new hooks enviroment file path without

reading file.

(create_svn_repos_t): Initialize hooks_env_path to NULL.

* subversion/libsvn_repos/hooks.c

(): Include "svn_config.h"

(parse_hooks_env_option_baton, parse_hooks_env_option,

parse_hooks_env_section_baton, parse_hooks_env_section,

parse_hooks_env): Moved from subversion/libsvn_repos/repos.c.

(svn_repos__hooks_start_commit, svn_repos__hooks_pre_commit,

svn_repos__hooks_post_commit, svn_repos__hooks_pre_revprop_change,

svn_repos__hooks_post_revprop_change, svn_repos__hooks_pre_lock,

svn_repos__hooks_post_lock, svn_repos__hooks_pre_unlock,

svn_repos__hooks_post_unlock): Read hooks environment file and pass it


* subversion/libsvn_repos/repos.h

(svn_repos_t): Add HOOKS_ENV_PATH and remove HOOKS_ENV.

* subversion/bindings/javahl/src/org/apache/subversion/javahl/

(SVNClient.move): Silence a deprecation warning.

Update JavaHL to use the revised svn_client_mergeinfo_log API.

[in subversion/bindings/javahl/src/org/apache/subversion/javahl]

*, (ISVNClient.getMergeinfoLog):

Add overload that accepts the start and end source revision.

[i subversion/bindings/javahl/native]

* SVNClient.h, SVNClient.cpp (SVNClient::getMergeinfoLog):

Update native implementation to use the revision range.

(org_apache_subversion_javahl_SVNClient.cpp): Update JNI wrapper.

* subversion/libsvn_client/commit.c

(svn_client_commit6): Fix a sleep-for-timestamps bug I introduced in


Found by: philip

Convert the conf/hooks-env file created when making a new repo to be


Just seems silly to parse a file that's fully commented out and that

many people may never use.

* subversion/libsvn_repos/repos.c

(create_conf): Make the conf/hooks-env file be written as hooks-env.tmpl.

Uncomment the sections that is in it.

* subversion/svnserve/serve.c

(load_authz_config): Fix error leak.

Found by: julianf

Fix Doxygen mark-up.

* subversion/include/svn_config.h

(svn_config_get_int64): s/@cfg/@a cfg/.

* subversion/include/svn_io.h

(svn_io_start_cmd3): s/@env/@a env/.

Fix some sleep-for-timestamps code: avoid missing some cases where we need

to sleep -- especially error cases -- and avoid sleeping in some cases where

we don't need to. Simplify the code by using a consistent pattern: make the

decision of whether to sleep at the lowest level possible (ideally in the WC

layer, but not yet), and do the sleep at the highest level possible

(immediately below the libsvn_client API).

Currently we sleep before releasing the WC write lock in some places, and

after releasing it in other places. We should pick one and be consistent.

* subversion/libsvn_client/client.h




svn_client__handle_externals): Document that the 'sleep' output is set

even if the function returns an error, and don't let it be NULL.

(svn_client__export_externals): Remove the unused and unneeded 'sleep'

output parameter.

* subversion/libsvn_client/checkout.c

(svn_client__checkout_internal): Rely on the caller to sleep even if we

throw an error. Don't always sleep on success, only if we actually

update the WC.

(svn_client_checkout3): Handle the sleep here.

* subversion/libsvn_client/commit.c

(svn_client_commit6): Sleep, if needed, even if there is an error during

the post-commit 'bumping' of the WC.

* subversion/libsvn_client/copy.c



repos_to_wc_copy_single): Return a flag instead of sleeping here. A

multi-target repos-to-WC copy will now only sleep once, not once per





try_copy): Pass the flag through.


svn_client_move7): Handle the sleep here.

* subversion/libsvn_client/export.c

(export_directory): Remove the unneeded 'sleep' variable.

* subversion/libsvn_client/externals.c

(svn_client__export_externals): Remove the unused and unneeded 'sleep'

output parameter.

* subversion/libsvn_client/revert.c

(svn_client_revert2): Sleep even when returning an error. It was missing

the case where, after reverting at least one target, a subsequent target


* subversion/libsvn_client/switch.c

(switch_internal): Rely on the caller to sleep even if we throw an error.

It missed the case where externals handling fails. Don't require a sleep

if we're using commit times as the WC timestamps.

(svn_client_switch3): Handle the sleep here.

* subversion/libsvn_client/update.c

(update_internal): Rely on the caller to sleep even if we throw an error.

It missed the case where externals handling fails. Don't require a sleep

if we're using commit times as the WC timestamps. This is also used by

checkout, so these changes affect checkout as well.

(svn_client_update4): Handle the sleep here in all cases. It missed the

case where, after updating at least one target, a subsequent target


Fix non-peg merge compatibility wrapper in JavaHL.

[in subversion/bindings/javahl/src/org/apache/subversion/javahl]

* (SVNClient.merge): Fix silly typo in order of parameters in

wrapped call to native method.

* Whitespace change, no functional difference.

* subversion/bindings/javahl/native/SVNClient.h (SVNClient::merge):

Remove extraneous overload declaration.

* tools/dev/unix-build/Makefile.svn

(sign-email): Fix indentation issue in output.

* tools/dev/unix-build/Makefile.svn

(sign-email): Prepare for future SVN releases which don't depend on neon.

Fix WC upgrades from old formats that didn't yet have a NODES table to

format 31 and beyond.

Format 31 introduced a new column in NODES, called inherited_props. When an

svn client which uses format 31 or greater is used to upgrade a pre-NODES WC,

this new column will be created as part of the CREATE TABLE statement which

creates the NODES table.

The format 31 upgrade code would unconditionally attempt to add a new

inherited_props column, which raises an error if the column already exists.

To fix this, check whether the inherited_props column exists before

attempting to create the column. Unfortunately this has to be done

from C as there doesn't seem to be a way of executing an ALTER TABLE

statement based on the result of a PRAGMA table_info() statement.

(If somebody knows a better way of doing this, I welcome any suggestions.)

* subversion/libsvn_wc/wc-metadata.sql

(STMT_UPGRADE_TO_31): Split this query into two parts, ...

(STMT_UPGRADE_TO_31_ALTER_TABLE): ... this one, which creates the new

column and can be skipped if needed, and ...

(STMT_UPGRADE_TO_31_FINALIZE): ... this one, which runs other upgrade

statements which are idempotent.

* subversion/libsvn_wc/wc-queries.sql

(STMT_PRAGMA_TABLE_INFO_NODES): New statement which returns info about

the NODES table, such as the names of existing columns.

* subversion/libsvn_wc/upgrade.c

(bump_to_31): Check if the inherited_props column exists before running

the SQL statement which attempts to create it.

Follow-up to r1462828: have another try at clarifying the usage of

@a start and @a end in svn_fs_verify.

* subversion/include/svn_fs.h

(svn_fs_verify): rephrase docstring

* subversion/svn/schema/info.rnc

(attlist.tree-conflict): Add the 'action' and 'reason' values that are new

in Subversion 1.7 and 1.8.

Don't error out with "svn: E200030: sqlite: no such table: nodes"

when opening old working copies and if compiled with SVN_DEBUG.

Instead, print a message advising an upgrade.

I found this problem while trying to use a format 18 WC with a trunk client.

* subversion/libsvn_wc/wc_db_wcroot.c

(svn_wc__db_wcroot_parse_local_abspath): Verification triggers don't

install properly with old WC format databases, so ignore sqlite errors

while installing the triggers. Allows old working copies in 1.7-dev

format to be upgraded to format 29 (at which point there is yet another

problem which I'll investigate next).

Be as specific as possible with error messages about loading authz

configurations in mod_authz_svn.

We were saying AuthzSVNAccessFile even when the AuthzSVNReposRelativeAccessFile

directive had been used. Now that there is a split groups file, we can't be

sure if it was the AccessFile or the GroupsFile directive that had a problem

if svn_repos_authz_read2() failed.

* subversion/mod_authz_svn/mod_authz_svn.c

(get_access_conf): If we know the configuration directive that failed

give it. If not give a generic description.

Include the groups file in the cache_key for mod_authz_svn.

This prevents a potential security issue. If we neglected to include the

groups file in the cache key and two repos were configured with the same

authz file but not the same groups file then the groups file would be used

for whichever repo was accessed first in a connection. Potentially,

allowing a user to escalate the privledges they have on a repo.

* subversion/mod_authz_svn/mod_authz_svn.c

(get_access_conf): Add groups_file to the cache_key string.

Allow SVNAuthzGroupsFile to accept repos-relative paths. Inadvertingly broke

this with r1463374.

* subversion/mod_authz_svn/mod_authz_svn.c

(resolve_repos_relative_url): Split the logic to resolve a repos-relative

URL out into a separate function.

(get_access_conf): Use resolve_repos_relative_url() to resolve repos-relative

URLs for both the AccessFile and the GroupsFile.

Use the absolute URL as the cache_key for repos-relative URLs in


This fixes what might have been a security problem since two different

repos might have the different authz files at the same path. If we

use the repos-relative path as a cache_key then the second request

will use the first requests authz file for path based authorization.

Thus potentially allowing an attacker to bypass the authz rules by

making a request against a public repo, followed by a request against

a private repo without closing the connection. The sort of configuration

that would allow such a thing to happen is precisely what in-repo authz

was intended to allow.

* subversion/mod_authz_svn/mod_authz_svn.c

(get_access_conf): Move the resolution and canonicalization of a

repos-relative URL before the determination of the cache_key.

Remove the ability of svn_repos_authz_read2() to handle repos-relative URLs.

This cleans up a case where it was impossible to canonicalize the paths

being passed into it and also ends up removing the need to pass repos_root

into it. If callers want to support repos-relative URLs then they should

resolve them into absolute file URLs and canonicalize them prior to calling


* subversion/include/svn_repos.h

(svn_repos_authz_read2): Remove repos_root argument and adjust documentation

to account for no longer accepting repos-root URLs. Also change "a file"

in the documented formats for path to a dirent to be more precise.

* subversion/libsvn_repos/authz.c

(authz_retrieve_config_repo, svn_repos__authz_read, svn_repos_authz_read2):

Remove repos_root parameter and support for repos-relative URLs in path.

* subversion/libsvn_repos/deprecated.c

(svn_repos_authz_read): Adjust call of svn_repos__authz_read().

* subversion/libsvn_repos/repos.h

(svn_repos_authz_read): Adjust declaration and documentation to match the

removal of repos_root and support for repos-relative URLs.

* subversion/mod_authz_svn/mod_authz_svn.c

(canonicalize_access_file): Adjust comment about why we are not canonicalizing


(get_access_conf): When access_file is a repos-relative URL resolve and

canonicalize it before calling svn_repos_authz_read2().

* subversion/svnserve/serve.c

(canonicalize_access_file): Change access_file to an arginout and return

an svn_error_t so that we can resolve and canonicalize repos-relative


(load_authz_config): Adjust calls to canonicalize_access_file() due to

above changes.

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

(in_repo_authz, in_repo_groups_authz): Remove repos-relative URL tests

and convert still needed tests that were using repos-relative URls to

absolute URLs.

* tools/server-side/svnauthz.c

(get_authz): Fix call to svn_repos_authz_read2() to match above changes.