Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix a problem relocating some externals.

Reported by: Larry Baird <lab{_AT_}gta.com>

* subversion/libsvn_client/relocate.c

(svn_client_relocate2): Handle case where prefix is too long

to be valid for externals.

* subversion/tests/cmdline/relocate_tests.py

(relocate_with_relative_externals): Extend.

  1. … 1 more file in changeset.
Use the information from the EXTERNALS storage to drive the

relocation of externals, instead of the svn:externals property.

* subversion/libsvn_client/relocate.c

(relocate_externals): Remove function. Fold into caller.

(svn_client_relocate2): Read EXTERNALS instead of getting and parsing

svn:externals.

Following the availability of apr_hash_this_key() etc. in APR v1.5, use

these in Subversion code instead of svn__apr_hash_index_key() etc. Provide

substitutes only when APR is too old to provide them.

* subversion/include/svn_types.h,

subversion/libsvn_subr/iter.c

(svn__apr_hash_index_key,

svn__apr_hash_index_klen,

svn__apr_hash_index_val):

Rename to apr_hash_this_key, apr_hash_this_key_len, apr_hash_this_val.

Declare and define them only if APR is older than 1.5.

Everywhere else: track the renames.

  1. … 102 more files in changeset.
* subversion/libsvn_client/relocate.c

(validator_func): Replace another reimplementation of

svn_client_get_repos_root with a call to this function.

Remove an effectively static function parameter.

* subversion/libsvn_client/relocate.c

(relocate_externals): Lose 'ignore_externals' parameter and use

thereof. Duh?

(svn_client_relocate2): Update call to relocate_externals().

* subversion/libsvn_client/relocate.c

(relocate_externals): Remove an initialized but unused variable.

Update calls to three deprecated APIs to use svn_client_get_repos_root()

instead, mark the deprecated APIs as such and move their implementations to

'deprecated.c'. A follow-up to r1186244.

* subversion/include/svn_client.h

(svn_client_get_repos_root): Mention that it may open a temporary RA

session.

(svn_client_root_url_from_path, svn_client_uuid_from_url,

svn_client_uuid_from_path2): Mark as deprecated.

* subversion/libsvn_client/ra.c

(svn_client_uuid_from_url, svn_client_uuid_from_path2): Move these ...

* subversion/libsvn_client/url.c

(svn_client_root_url_from_path): ... and this ...

* subversion/libsvn_client/deprecated.c

(svn_client_uuid_from_url, svn_client_uuid_from_path2,

svn_client_root_url_from_path): ... to here.

* subversion/libsvn_client/cmdline.c

(svn_client_args_to_target_array2): Update calls.

* subversion/libsvn_client/copy.c

(repos_to_wc_copy_locked): Update calls.

* subversion/libsvn_client/merge.c

(merge_cousins_and_supplement_mergeinfo): Update calls.

* subversion/libsvn_client/relocate.c

(relocate_externals, svn_client_relocate2): Update calls.

  1. … 7 more files in changeset.
Make 'svn relocate' act recursively on all externals, not just immediate

externals of the top level working copy.

* subversion/libsvn_client/relocate.c

(relocate_externals): Add ignore_externals parameter.

(svn_client_relocate2): Pass ignore_externals.

* subversion/tests/cmdline/upgrade_tests.py

(upgrade_file_externals): No need for second nested relocate.

  1. … 1 more file in changeset.
Followup to r1140505. Fix indentation.

* [everywhere]: Fix indentation fallout from the

svn_error_return() -> svn_error_trace() rename.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

  1. … 37 more files in changeset.
Rename the 'svn_error_return' macro to 'svn_error_trace'.

See email thread "[RFC] Rename 'svn_error_return' to 'svn_error_trace'?" on

2011-06-23, <http://svn.haxx.se/dev/archive-2011-06/0708.shtml>.

* subversion/include/svn_error.h

(svn_error_return): Rename to svn_error_trace.

(SVN_ERR, svn_error_purge_tracing): Track the rename.

* [everywhere]: Track the rename.

  1. … 120 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.
* subversion/libsvn_client/relocate.c

(svn_client_relocate2): Following up on r1128881, handle hash values as c-strings instead

of const svn_string_t *.

Add a new wc_db api which gathers all svn:externals properties and relevant

depths for an update/switch in a single transaction.

* subversion/include/private/svn_wc_private.h

(svn_wc__externals_gather_definitions): New function.

* subversion/libsvn_client/client.h

(svn_client__crawl_for_externals): Remove function.

(svn_client__gather_local_external_changes): Remove function.

* subversion/libsvn_client/externals.c

(externals_crawl_proplist_receiver,

svn_client__crawl_for_externals,

svn_client__gather_local_external_changes): Remove functions.

* subversion/libsvn_client/relocate.c

(includes): Add svn_wc_private.h

(svn_client_relocate2): Update caller.

* subversion/libsvn_client/switch.c

(switch_internal): Update caller.

* subversion/libsvn_client/update.c

(update_internal): Update caller.

* subversion/libsvn_wc/externals.c

(svn_wc__externals_gather_definitions): New function.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_EXTERNAL_PROPERTIES): New query.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_externals_gather_definitions): New function.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_externals_gather_definitions): New function.

  1. … 9 more files in changeset.
Make svn_client__crawl_for_externals() use the new recursive proplist

libsvn_wc API instead of a status crawl.

Apart from being faster, this will also make externals on locally added

directories show up. A future commit will make use of this capability to

address issue #2267, "support svn:externals on locally added directories".

The only existing caller of svn_client__crawl_for_externals() is

svn_client_relocate2(), which will now relocate existing relative

externals within locally added directories.

* subversion/libsvn_client/relocate.c

(relocate_externals): Tolerate externals that are missing from disk

even though they are listed in the externals definition.

The external may have been removed accidentally, or the definition is

set on a locally added directory. In the latter case there is currently

no way to make the external appear, so erroring out is unfriendly.

* subversion/libsvn_client/externals.c

(): Include svn_props.h.

(externals_update_func, status_noop_func): Remove.

(externals_crawl_proplist_receiver): New. Replaces the above two functions,

and is used with svn_wc__prop_list_recursive().

(svn_client__crawl_for_externals): Use svn_wc__prop_list_recursive()

instead of svn_wc_walk_status() to gather externals.

  1. … 1 more file in changeset.
Just padding my stats.

(Actually, doing my regular trailing whitespace removal, similar to r875968.)

* 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. … 166 more files in changeset.
Make 'svn relocate' verify that the target working copy root dir is

local. Part of issue #3620.

* subversion/libsvn_client/relocate.c,

subversion/svn/relocate-cmd.c

(svn_client_relocate2, svn_cl__relocate): Raise an error if target

working copy dir is not local.

* subversion/tests/cmdline/input_validation_tests.py

(invalid_relocate_targets, test_list): New test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

(tweaked by me)

  1. … 2 more files in changeset.
Add a new module-private helper function,

svn_client__crawl_for_externals(), which allows you to easily scan a

working copy for externals definitions. (Really, this just promotes a

previously existing bit of static logic to a higher degree of

visibility, with reuse as a goal.)

* subversion/libsvn_client/client.h

(svn_client__crawl_for_externals): New function.

* subversion/libsvn_client/externals.c

(externals_update_func, status_noop_func): Moved here from relocate.c.

(svn_client__crawl_for_externals): New function, largely cored from

code previously in svn_client_relocate2().

* subversion/libsvn_client/relocate.c

(externals_update_func, status_noop_func): Moved to externals.c.

(svn_client_relocate2): Now use svn_client__crawl_for_externals().

  1. … 2 more files in changeset.
For consistency, rename some code parameters/variables in the same

fashion that those parameters were renamed in r1031114.

* subversion/libsvn_client/relocate.c

(svn_client_relocate2): Rename 'from' and 'to' to 'from_prefix' and

'to_prefix', respectively.

* subversion/libsvn_client/export.c

(svn_client_export5): Rename 'from' and 'to' to 'from_path_or_url'

and 'to_path', respectively.

* subversion/libsvn_client/deprecated.c

(svn_client_export4, svn_client_export3, svn_client_export2,

svn_client_export): Rename 'from' and 'to' to 'from_path_or_url'

and 'to_path', respectively.

(svn_client_relocate): Rename 'from' and 'to' to 'from_prefix' and

'to_prefix', respectively.

Suggested by: hwright

  1. … 2 more files in changeset.
Fix issue #3597 -- "relocate should update externals from the same

repository, too".

* subversion/include/svn_client.h

(svn_client_relocate2): Add 'ignore_externals' parameter.

(svn_client_relocate): Update docstring to note how the behavior

relates to svn_client_relocate2()'s new 'ignore_externals' parameter.

* subversion/libsvn_client/externals.c

(switch_dir_external): Update call to svn_client_relocate2(),

passing FALSE for 'ignore_externals'.

* subversion/libsvn_client/deprecated.c

(svn_client_relocate): Update call to svn_client_relocate2().

* subversion/svn/main.c

(svn_cl__cmd_table): Make the 'relocate' subcommand accept

--ignore-externals.

* subversion/svn/relocate-cmd.c

(svn_cl__relocate): Update calls to svn_client_relocate2().

* subversion/svn/switch-cmd.c

(rewrite_urls): Add 'ignore_externals' parameter, passed to updated

calls to svn_client_relocate2().

(svn_cl__switch): Update call to rewrite_urls().

* subversion/libsvn_client/relocate.c

(externals_update_func, status_noop_func): New callback functions.

(relocate_externals): New helper function.

(svn_client_relocate2): Add 'ignore_externals' parameter. If

not ignoring externals, attempt to relocate any external working

copies whose repository root URLs match the primary working copies.

* subversion/tests/cmdline/switch_tests.py

(relocate_with_relative_externals): Update tests to also use a "../"

type of relative external URL.

(test_list): No longer expect relocate_with_relative_externals() to

fail.

  1. … 7 more files in changeset.
Disallow relocation of working copy subtrees and relocation at depths

other than infinity. This change breaks some compatibility with

previous APIs at both the svn_client and svn_wc levels -- I'll just be

honest about that. But from what I've seen, while the APIs used to

"work" (that is, do what they claimed), the result was a working copy

that didn't. Also, the command-line client disallowed some of this

stuff already, and just errored out on some parts that it didn't

disallow. In all, relocation was a mess. So I'm extremely

comfortable with calling this a bugfix.

* subversion/include/svn_wc.h

(svn_wc_relocate4): Note that local_abspath is the root directory of

a working copy.

(svn_wc_relocate3): Note that 'recurse' is replaced by 'depth' now.

* subversion/include/svn_client.h

(svn_client_relocate2): New.

(svn_client_relocate): Deprecated with noted limitations to backward

compatibility.

* subversion/libsvn_wc/relocate.c

(svn_wc_relocate4): Check local_abspath to see if it's a strict

working copy root; if not, disallow the relocation. Try to tell

the caller where to find the working copy root.

* subversion/libsvn_wc/deprecated.c

(svn_wc_relocate3): Disallow recurse=FALSE with an error. Update

call to svn_wc_relocate4().

* subversion/libsvn_client/relocate.c

(svn_client_relocate2): Rev svn_client_relocate(), this time without

a 'recurse' parameter.

(svn_client_relocate): Moved to deprecate.c.

* subversion/libsvn_client/deprecated.c

(svn_client_relocate): Moved here from relocate.c and made into a

simple wrapper around svn_client_relocate2().

* subversion/libsvn_client/externals.c

(switch_dir_external): Now use svn_client_relocate2().

* subversion/svn/main.c

(main): Since we disallow --relocate with --depth, it makes sense to

also disallow --relocate with --non-recursive, so do so.

* subversion/svn/switch-cmd.c

(rewrite_urls): Lose 'recurse' parameter, and now use

svn_client_relocate2().

(svn_cl__switch): Update call to rewrite_urls().

* subversion/tests/cmdline/switch_tests.py

(relocate_beyond_repos_root): Rewrite a bit to still test the

intended things without triggering the new error situation.

(single_file_relocate): Tweak expected error message.

  1. … 9 more files in changeset.
Reintegrate the issue-2779-dev branch. Permanent redirect responses

from an HTTP server now cause the client -- in particular

circumstances -- to automatically follow the redirect.

NOTE: The test suite changes brought in by this merge require

modifications to developers' httpd.conf files. So if you see the

redirect_tests.py all failing, make sure you've updated your Apache

configuration per the instructions in the

subversion/tests/cmdline/README file.

  1. … 44 more files 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.
Update deprecated path function calls.

* subversion/libsvn_ra/ra_loader.c,

subversion/libsvn_client/relocate.c,

subversion/libsvn_client/switch.c,

subversion/libsvn_client/externals.c,

subversion/libsvn_client/merge.c,

subversion/libsvn_ra_serf/merge.c,

subversion/libsvn_repos/log.c,

subversion/libsvn_repos/replay.c,

subversion/libsvn_fs_fs/tree.c:

Replace all calls to svn_path_is_ancestor() with the appropriate dirent or

uri version.

  1. … 8 more files in changeset.

* subversion/libsvn_client/client.h

(svn_client__open_ra_session_internal): Remove access baton parameter,

and update docs.

* subversion/libsvn_client/ra.c

(svn_client__open_ra_session_internal): Remove the now-unused access baton

parameter.

* subversion/libsvn_client/relocate.c,

subversion/libsvn_client/delete.c,

subversion/libsvn_client/externals.c,

subversion/libsvn_client/status.c,

subversion/libsvn_client/info.c,

subversion/libsvn_client/merge.c,

subversion/libsvn_client/prop_commands.c,

subversion/libsvn_client/url.c,

subversion/libsvn_client/ra.c,

subversion/libsvn_client/locking_commands.c,

subversion/libsvn_client/diff.c,

subversion/libsvn_client/copy.c,

subversion/libsvn_client/list.c,

subversion/libsvn_client/mergeinfo.c,

subversion/libsvn_client/update.c,

subversion/libsvn_client/add.c,

subversion/libsvn_client/commit.c:

Update callers throughout by removing the access baton parameter.

  1. … 17 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.
Rework the creation and destruction of svn_wc_context_t within the client

library. Specifically, always create a wc_context as part of a client

context, and use that internally within the client library.

Suggested by: gstein

* subversion/include/svn_client.h

(svn_client_ctx_t.wc_ctx): Update docs.

* subversion/libsvn_client/relocate.c,

subversion/libsvn_client/export.c,

subversion/libsvn_client/merge.c,

subversion/libsvn_client/prop_commands.c,

subversion/libsvn_client/ra.c,

subversion/libsvn_client/locking_commands.c,

subversion/libsvn_client/cat.c,

subversion/libsvn_client/copy.c,

subversion/libsvn_client/mergeinfo.c,

subversion/libsvn_client/blame.c,

subversion/libsvn_client/commit_util.c,

subversion/libsvn_client/cleanup.c,

subversion/libsvn_client/add.c,

subversion/libsvn_client/commit.c,

subversion/libsvn_client/client.h,

subversion/libsvn_client/mergeinfo.h:

Don't create a wc_context, just use the one in the client context. Also,

adjust function parameter lists and batons to eliminate redundant

wc_context members.

* subversion/libsvn_client/ctx.c

(svn_client_create_context): Create a wc context.

  1. … 17 more files in changeset.
Convert libsvn_client's relocate function to use the updated libsvn_wc API.

This removes the use of more access baton cruft in favor of a working copy

context.

* subversion/libsvn_client/relocate.c

(svn_client_relocate): Call svn_wc_relocate4() in place of svn_wc_relocate3(),

and use a context in place of an adm_access baton.

Add a check and test to ensure we don't attempt to relocate a single file.

The working copy code doesn't allow it, and up to this point we've just been

silently doing nothing.

* subversion/tests/cmdline/switch_tests.py

(single_file_relocate): New test.

(test_list): Run it.

* subversion/libsvn_client/relocate.c

(svn_client_relocate): Error out if the target of the relocate operation is

a file.

  1. … 1 more file in changeset.
Switch to use svn_wc_adm_close2()

* subversion/libsvn_wc/revision_status.c:

* subversion/libsvn_wc/util.c:

* subversion/libsvn_wc/adm_files.c:

* subversion/libsvn_wc/update_editor.c:

* subversion/libsvn_wc/tree_conflicts.c:

* subversion/libsvn_wc/copy.c:

* subversion/libsvn_wc/log.c:

* subversion/libsvn_client/relocate.c:

* subversion/libsvn_client/switch.c:

* subversion/libsvn_client/delete.c:

* subversion/libsvn_client/externals.c:

* subversion/libsvn_client/util.c:

* subversion/libsvn_client/revisions.c:

* subversion/libsvn_client/export.c:

* subversion/libsvn_client/status.c:

* subversion/libsvn_client/merge.c:

* subversion/libsvn_client/prop_commands.c:

* subversion/libsvn_client/ra.c:

* subversion/libsvn_client/url.c:

* subversion/libsvn_client/checkout.c:

* subversion/libsvn_client/revert.c:

* subversion/libsvn_client/locking_commands.c:

* subversion/libsvn_client/cat.c:

* subversion/libsvn_client/diff.c:

* subversion/libsvn_client/copy.c:

* subversion/libsvn_client/mergeinfo.c:

* subversion/libsvn_client/log.c:

* subversion/libsvn_client/changelist.c:

* subversion/libsvn_client/update.c:

* subversion/libsvn_client/resolved.c:

* subversion/libsvn_client/add.c:

* subversion/libsvn_client/commit.c:

(various): replace call to svn_wc_adm_close() with close2().

  1. … 31 more files in changeset.
Directly return some errors, removing superfluous invocations of SVN_ERR().

This only handles libsvn_client; the other libraries could be similarly

audited.

I tried not to be too agressive when doing this. There's a balance between

maintainability and efficiency: there are probably other places where we can

directly return, but tracking those down is tricky, and can introduce subtle

bugs for future maintainers.

* subversion/libsvn_client/relocate.c,

subversion/libsvn_client/delete.c,

subversion/libsvn_client/externals.c,

subversion/libsvn_client/repos_diff.c,

subversion/libsvn_client/export.c,

subversion/libsvn_client/info.c,

subversion/libsvn_client/merge.c,

subversion/libsvn_client/prop_commands.c,

subversion/libsvn_client/ra.c,

subversion/libsvn_client/revert.c,

subversion/libsvn_client/locking_commands.c,

subversion/libsvn_client/cat.c,

subversion/libsvn_client/diff.c,

subversion/libsvn_client/copy.c,

subversion/libsvn_client/mergeinfo.c,

subversion/libsvn_client/repos_diff_summarize.c,

subversion/libsvn_client/changelist.c,

subversion/libsvn_client/update.c,

subversion/libsvn_client/resolved.c,

subversion/libsvn_client/commit_util.c,

subversion/libsvn_client/add.c,

subversion/libsvn_client/commit.c:

Directly return errors from some called functions.

  1. … 21 more files in changeset.