Checkout Tools
  • last updated 4 hours ago
Constraints: committers
Constraints: files
Constraints: dates
Improvements to the 'WC editor' for issue #4786.

* subversion/include/private/svn_client_private.h

(svn_client__wc_editor): Specify the form of path arguments to the editor.

(svn_client__wc_replay): Same, and add a WC abspath argument.

* subversion/libsvn_client/commit.c

(svn_client__wc_replay): Add a WC abspath argument, and make all editor

paths relative to (the URL of) that path.

* subversion/libsvn_client/client.h,


(svn_client__condense_commit_items2): New.

* subversion/libsvn_client/wc_editor.c



file_close): Add support for making a text-delta against a non-empty


  1. … 4 more files in changeset.
Shelving: implement shelf diff summary mode.

"svn shelf-diff --summarize"

* subversion/include/private/svn_client_private.h,



(svn_client__get_diff_summarize_callbacks): Move from a private to a

semi-public header file. Remove 'const' from the output parameter.

* subversion/libsvn_client/diff.c


svn_client_diff_summarize_peg2): Tweak to match that 'const' change.

* subversion/svn/cl.h,


(svn_cl__get_diff_summarize): Newly exposed API.

(svn_cl__diff): Use it.

* subversion/svn/shelf-cmd.c

(shelf_diff): Implement summary mode.

* subversion/svn/svn.c

(svn_cl__cmd_table): Add '--summarize' option to shelf-diff.

* subversion/tests/cmdline/

(shelf_diff_simple): Extend to test summary mode.

* tools/client-side/bash_completion

(_svn): Add '--summarize' option to shelf-diff.

  1. … 9 more files in changeset.
Another step in reducing coupling between diff drivers and diff writers.

Let svn_client__arbitrary_nodes_diff() anchor the diff processor API at the

requested target paths always, rather than sometimes there and sometimes at

the parent of one of them.

Move the responsibility for prefixing diff header paths with the first

path's basename in certain cases (when the targets are not both directories)

to the caller, where it is more appropriate since it is a presentation


* subversion/libsvn_client/client.h,


(svn_client__arbitrary_nodes_diff): Always anchor at the requested target

paths, even when they are not both directories. Remove the (now unused)

'anchor_at_given_paths' flag and (already unused) 'result_pool' params.

* subversion/libsvn_client/diff.c

(do_diff): Determine the prefix for diff header paths here, instead.

* subversion/tests/cmdline/

(diff_arbitrary_files_and_dirs): Extend this case a little, adding a file

that is modified and a node that is replaced by a different kind.

  1. … 3 more files in changeset.
Reduce coupling between diff drivers and diff writers.

Let diff drivers anchor the diff-processor at the requested target paths,

rather than sometimes there and sometimes at the parent of one of them, in

summarize mode. The quirky anchoring still persists in non-summarize mode.

* subversion/libsvn_client/diff.c

(diff_driver_info_t): Expand comments.



diff_repos_wc): Remove 'root_relpath' and 'root_is_dir' outputs; instead

anchor the diff processor at the requested targets if no 'ddi' coupling

parameter is given.





svn_client_diff_summarize_peg2): Update the calls accordingly.

* subversion/libsvn_client/diff_local.c,


(svn_client__arbitrary_nodes_diff): Remove 'root_relpath' and 'root_is_dir'

outputs. Take an 'anchor_at_given_paths' mode flag and obey it.

* subversion/libsvn_client/diff_summarize.c,



send_summary): Remove path adjustment.

(svn_client__get_diff_summarize_callbacks): Remove path adjustment and

an unused parameter.

* subversion/libsvn_wc/diff_local.c,


(svn_wc__diff7): Remove 'root_relpath' and 'root_is_dir' outputs. Take an

'anchor_at_given_paths' mode flag and obey it.

(svn_wc_diff6): Update the call to svn_wc__diff7() accordingly.

  1. … 5 more files in changeset.
* subversion/libsvn_client/client.h

(svn_client__arbitrary_nodes_diff): Document better.

Shelving: make the revprop get/set API public.

There was no strong reason why it was private, and now I have a client

interested in calling it.

* subversion/include/svn_client.h



svn_client_shelf_revprop_list): Rename and move to here...

* subversion/libsvn_client/client.h,




svn_client__shelf_revprop_list): ... from here.

  1. … 2 more files in changeset.
* subversion/libsvn_client/client.h

Update a really old comment, and fix spelling.

Copy the main part of Shelving v2 (that is, with checkpointing) into trunk

from the 'shelve-checkpoint' branch.

Leave Shelving v1 active, add the new APIs, disable the new CLI using

'#ifdef WITH_SHELVE_V1', and don't update the tests and Bash-completion yet.

* subversion/include/svn_client.h

















svn_client_shelf_list): New.

* subversion/libsvn_client/client.h



svn_client__shelf_revprop_list): New.

* subversion/libsvn_client/shelf.c


New files.

* subversion/svn/cl.h







svn_cl__shelf_unshelve): New declarations.

* subversion/svn/svn.c


(svn_cl__options, svn_cl__cmd_table, sub_main):

Add the new CLI. Switch between old and new based on WITH_SHELVE_V1.

  1. … 5 more files in changeset.
Expose merge_locked() from libsvn_client/merge.c the rest of libsvn_client.

* subversion/libsvn_client/client.h

(svn_client__conflict_report_t): Moved here from merge.c.


svn_client__merge_locked): Declare.

* subversion/libsvn_client/merge.c

(conflict_report_t): Moved to client.h as svn_client__conflict_report_t.

(make_merge_conflict_error, merge_locked): Rename to

svn_client__make_merge_conflict_error and svn_client__merge_locked.

(conflict_report_create, conflict_report_dup, do_merge,


svn_client_merge5, merge_reintegrate_locked,

merge_peg_locked, do_automatic_merge_locked,

svn_client_merge_peg5): Track renames.

  1. … 1 more file in changeset.
Add skeleton code for a merge-by-elements feature.

See dev@ email thread "[RFC] An element-based 'svn merge'" started by me on

2015-12-17, archived at e.g.


This is conditional on an environment variable 'SVN_ELEMENT_MERGE' being


* subversion/libsvn_client/client.h


merge_target_t): Move these definitions to here from merge.c.

(svn_client__merge_elements): New.

* subversion/libsvn_client/merge.c

(merge_peg_locked): Call the merge-by-elements code under certain


* subversion/libsvn_client/merge_elements.c

New file.

  1. … 2 more files in changeset.
Update some documentation to avoid regressions as the one fixed in r1703689.

* subversion/libsvn_client/client.h


Following up on r1703689, tweak documentation.

Revert r1704048 (merge of 'reuse-ra-session' branch): unfortunately the code

is not ready for trunk. The most serious problem that we cannot assume that

API user doesn't change svn_client_ctx_t fields like AUTH_BATON or

OPEN_TUNNEL_FUNC between svn_client_*() functions invocation. JavaHL bindings

is one example of usage of such pattern.

I'll revive 'reuse-ra-session' branch and attempt to fix these problems there.

Discussion: "Merge ra-reuse-session branch to trunk or not?" [1]

  1. … 33 more files in changeset.
[Reverted in r1704255]

Introduce RA session pool in libsvn_client for managing and reusing RA session

for different URLs.

Discussion: "Merge ra-reuse-session branch to trunk or not?" [1]

More details are available in branch history [2].


[2] ^/subversion/branches/reuse-ra-session@1704029

* subversion/include/private/svn_client_private.h

(svn_client__ra_session_from_path2): Update docstring to mention that RA

session may be returned back to RA session pool by

svn_client__ra_session_release() function.

(svn_client__ra_session_release): New function declaration.

* subversion/libsvn_client/add.c

* subversion/libsvn_client/blame.c

* subversion/libsvn_client/cat.c

* subversion/libsvn_client/checkout.c

(mkdir_urls, svn_client_blame5, svn_client_cat3,

svn_client__checkout_internal): Release locally created sessions if there

were no errors.

* subversion/libsvn_client/client.h

(svn_client__ra_cache_t): Add new type declare.

(svn_client__private_ctx_t): Add RA_CACHE field.

* subversion/libsvn_client/commit.c

(check_url_kind_baton): Remove POOL, SESSION and REPOS_ROOT_URL -- they

were used as local RA session pool.

(check_url_kind): Just use svn_client_open_ra_session2() and

svn_client__ra_session_release() instead of trying to reparent existing

RA session.

(svn_client_commit6): Update baton initialization and release locally

created sessions if there were no errors.

* subversion/libsvn_client/copy.c

* subversion/libsvn_client/copy_foreign.c

* subversion/libsvn_client/ctx.c

* subversion/libsvn_client/delete.c

* subversion/libsvn_client/diff.c

* subversion/libsvn_client/export.c

* subversion/libsvn_client/externals.c

* subversion/libsvn_client/import.c

* subversion/libsvn_client/info.c

* subversion/libsvn_client/iprops.c

* subversion/libsvn_client/list.c

* subversion/libsvn_client/locking_commands.c

* subversion/libsvn_client/log.c

* subversion/libsvn_client/mtcc.c

* subversion/libsvn_client/prop_commands.c

(pin_externals_prop, repos_to_repos_copy, repos_to_repos_copy,

wc_to_repos_copy, repos_to_wc_copy, svn_client__copy_foreign,

delete_urls_multi_repos, diff_repos_repos, diff_repos_wc,

svn_client_export5, handle_external_item_change, svn_client_import5,

svn_client_info4, get_inheritable_props, list_internal, release_locks,

svn_client__get_copy_source, svn_client_log5, svn_client__mtcc_commit,

propset_on_url): Release locally created sessions if there were no errors.

* subversion/libsvn_client/merge.c

(ensure_ra_session_url): Add TODO comment to use release RA sessions back

to RA session pool.

(do_merge): Reduce scope of second RA session and return it early back to

RA session pool.

(merge_locked, merge_peg_locked, find_automatic_merge_no_wc,

client_find_automatic_merge, do_automatic_merge_locked): Release locally

created sessions if there were no errors.

* subversion/libsvn_client/mergeinfo.c

(svn_client__get_wc_or_repos_mergeinfo_catalog, get_mergeinfo,

logs_for_mergeinfo_rangelist, svn_client__mergeinfo_log,

svn_client_suggest_merge_sources): Release locally created sessions if

there were no errors.

* subversion/libsvn_client/ra.c

(): Include "ra_cache.h"

(svn_client__open_ra_session_internal): Use

svn_client__ra_cache_open_session() to open RA session, instead of direct

call to svn_ra_open4().

(svn_client__repos_locations, svn_client__get_youngest_common_ancestor):

Release RA sessions after we finished using them.

(svn_client__ra_session_release): New.

* subversion/libsvn_client/ra_cache.c

* subversion/libsvn_client/ra_cache.h


open_tmp_file, get_wc_prop, set_wc_prop, push_wc_prop, invalidate_wc_props,

progress_func, cancel_func, get_client_string, get_wc_contents,

check_tunnel_func, open_tunnel_func, cleanup_ra_cache,

svn_client__ra_cache_init, close_ra_session, remove_inactive_entry,

expunge_cache_entries, find_session_by_url, open_new_session,

get_private_ra_cache, svn_client__ra_cache_open_session,

svn_client__ra_cache_release_session): New.

* subversion/libsvn_client/status.c

* subversion/libsvn_client/switch.c

* subversion/libsvn_client/update.c

* subversion/libsvn_client/util.c

(reporter_finish_report, svn_client_status6, switch_internal,

svn_client__update_internal, svn_client_get_repos_root): Release locally

created sessions if there were no errors.

* tools/dev/ New script to analyze debugging output of

RA session reuse.

  1. … 33 more files in changeset.
Introduce a 'null-blame' command in svnbench.

Suggested by: jcorvel

* subversion/include/private/svn_client_private.h

(svn_client__get_revision_number): Declare function here.

* subversion/libsvn_client/client.h

(svn_client__get_revision_number): ... instead of here.

* subversion/svnbench/cl.h

(svn_cl__null_blame): New function.

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

New file.

* subversion/svnbench/svnbench.c

(svn_cl__cmd_table): Declare null-blame.

  1. … 4 more files in changeset.
* subversion/libsvn_client/client.h

(svn_client__sort_commit_item_urls): Remove function here.

* subversion/libsvn_client/commit_util.c

(svn_client__sort_commit_item_urls): Make static and rename to...

(sort_commit_item_urls): ... this.

(svn_client__condense_commit_items): Update caller.

  1. … 1 more file in changeset.
* subversion/libsvn_client/add.c

(svn_client__get_inherited_ignores): Remove unused function.

* subversion/libsvn_client/client.h

(svn_client__get_inherited_ignores): Remove function.

  1. … 1 more file in changeset.
Merge the pin-externals branch to trunk.

The discussion thread start in this post:

has come to a consensus that the branch can be merged and additional

development of this feature can happen on trunk.

This merge adds a '--pin-externals' option to 'svn copy'.

This option enables automated pinning of URLs in svn:externals properties

during copy operations (issue #1258).

--pin-externals : pin externals with no explicit revision to their

last-changed revision (recommended when tagging)

This feature makes the contrib script unnecessary.

Externals are "pinned" by adding a peg revision to the external's source URL.

For example, the external definition:

^/foo/bar ext_bar

might become:

^/foo/bar@400 ext_bar

This table shows which revision is used for pinning:

copy source: working copy (WC) REPOS


copy WC | external's WC BASE rev | external's repos HEAD rev |

dest: |------------------------+---------------------------+

REPOS | external's WC BASE rev | external's repos HEAD rev |


An external that is already pinned is left as-is.

Please see the branch log for details about these changes.

  1. … 22 more files in changeset.
Rename a library-private struct to soothe the more pedantic types.

* subversion/libsvn_client/client.h,



(svn_client__private_ctx_t): Renamed from client_ctx_t.

  1. … 2 more files in changeset.
Introduce a private libsvn_client context structure that stores

context information that should not be part of the public API.

* subversion/include/svn_client.h

(svn_client_ctx_t): Remove the 'progress' field, which should be private.

* subversion/libsvn_client/client.h

(client_ctx_t): New; the private context struct.

Contains the equivalent of the 'progress' field.

(svn_client__get_private_ctx): New prototype.

* subversion/libsvn_client/ctx.c: Include stddef.h and client.h.

(CLIENT_CTX_MAGIC): New; magic number for the private context.

(svn_client__get_private_ctx): Implement.

(svn_client_create_context2): Allocate and initialize the private

context structure, with the public context embedded within it.

* subversion/libsvn_client/ra.c

(progress_func): Use the total progress counter from the private context.

  1. … 3 more files in changeset.
Avoid creating an unneeded ra-session per 'svn checkout' and per update of

directory external by passing an optional ra session to a few more internal

libsvn_client functions.

* subversion/libsvn_client/checkout.c

(svn_client__checkout_internal): Move output arguments to front. Accept

optional existing ra session. Pass ra session to


(svn_client_checkout3): Update caller.

* subversion/libsvn_client/client.h



Move output arguments to front. Accept optional existing ra session.

(svn_client__handle_externals): Accept optional existing ra session.

* subversion/libsvn_client/copy.c

(repos_to_wc_copy_single): Update caller. Remove unneeded local variable, as

we can just pass the variable from our caller.

* subversion/libsvn_client/externals.c

(switch_dir_external): Accept ra session from caller. Update caller.

(handle_external_item_change): Accept ra session from caller. Use this if

possible to avoid always creating another ra session. Update caller.


svn_client__handle_externals): Pass ra session.

* subversion/libsvn_client/switch.c

(switch_internal): Update caller.

* subversion/libsvn_client/update.c

(update_internal): Separate pool handling. Reorder arguments to standard.

Update caller.

(svn_client__update_internal): Move output arguments to front. Accept

optional existing ra session. Use iterpool.

  1. … 5 more files in changeset.
In the libsvn_client diff handling: replace the output argument of the anchor

base argument with a pair of root_relpath and root_is_dir values.

These two booleans should allow cleaning up the remaining 'dual calculations'

of anchors in the diff code.

The diff runner and diff writer have/had deep knowledge about each others

about this handling and covered for bugs on the other side. This is pumbing

in preparation for replacing this with the usage of generic diff driver rules.

* subversion/include/private/svn_client_private.h

(svn_client__arbitrary_nodes_diff): Move function to client.h

* subversion/include/private/svn_wc_private.h

(svn_wc__diff7): Update private api.

* subversion/libsvn_client/client.h

(svn_client__arbitrary_nodes_diff): Move function here and update output

arguments to new form.

* subversion/libsvn_client/diff.c

(diff_wc_wc): Update output arguments. Update caller.

(diff_repos_repos): Update output arguments. Remove filter that isn't

necessary if our caller wants to do the filtering based on what we


(do_diff): Update caller.


svn_client_diff_peg6): Update caller.


svn_client_diff_summarize_peg2): Update caller.

* subversion/libsvn_client/diff_local.c

(svn_client__arbitrary_nodes_diff): Update output arguments.

* subversion/libsvn_client/diff_summarize.c

(summarize_baton_t): Remove two variables.

(ensure_skip_relpath): Remove now unneeded function.

(send_summary): Update caller.

(svn_client__get_diff_summarize_callbacks): Pass skip_relpath directly.

* subversion/libsvn_wc/diff_local.c

(includes): Add wc_db.h. Remove translate.h.

(svn_wc__diff7): Update argument. Always root at parent directory when we

can tell the caller about this. (This fixes driving a root replacement)

  1. … 6 more files in changeset.
Use the diff tree processor for hooking the diff --summarize handler in


* subversion/libsvn_client/client.h

(svn_client__get_diff_summarize_callbacks): Update api to return a diff

processor instead of diff callbacks. Remove reverse option as that

can be applied by the caller by reversing the tree.

* subversion/libsvn_client/diff.c

(diff_wc_wc): Implement proper result and scratch pool.

(diff_repos_repos): Calculate anchor path. Use result/scratch pool. Make

text delta handling optional.

(diff_repos_wc): Calculate anchor path. Use result/scratch pool.

(do_diff): Add anchor_path output argument. Add result pool. Update caller.

(diff_summarize_repos_wc): Wrap diff processor when we need reverse logic

Update caller. Remove logic that calculates anchor, which is now an

output argument of called function.

diff_summarize_wc_wc): Update caller. Remove logic that calculates

anchor, which is now an output argument of called function.

(diff_summarize_repos_repos): Remove now unused function.

(do_diff_summarize): Update diff_repos_repos instead of

diff_summarize_repos_repos. Remove target calculation for



svn_client_diff_peg6): Update caller.

* subversion/libsvn_client/diff_summarize.c

(includes): Add svn_path.h and private/svn_wc_private.h.

(summarize_baton_t): Add variables.

(ensure_skip_relpath): New function.

(send_summary): Update caller. Update patch calculation.

(cb_dir_closed): Update patch calculation.

(svn_client__get_diff_summarize_callbacks): Fetch a diff tree processor


  1. … 2 more files in changeset.
Fix a docstring.

* subversion/libsvn_client/client.h

(svn_client__checkout_internal): innercheckout isn't an argument remove the

obsolete doccstring.

Move a backwards compatibility wrapper for svnserve versions 1.0-1.1 to the

ra layer. This will make the ra layer easier to use and maintain.

(Callers can stop worrying about this limitation in old svnserve versions)

We can't really move this in ra_svn as within ra_svn we can't use the normal

ra apis.

* subversion/libsvn_client/client.h

(svn_client__ra_stat_compatible): Remove function.

* subversion/libsvn_client/info.c

(svn_client_info4): Use the normal ra function.

* subversion/libsvn_client/list.c

(svn_client__ra_stat_compatible): Remove function. Move code to ra layer.

* subversion/libsvn_ra/ra_loader.c

(includes): Add svn_time.h.

(svn_ra_stat): Move svnserve fallback code here.

  1. … 3 more files in changeset.
Re-use ra sessions when determining where a path is copied from using a

libsvn_client internal api. Give public api a caller from our test suite

by adding a simple C test.

* subversion/libsvn_client/client.h

(svn_client__get_copy_source): Add argument.

* subversion/libsvn_client/log.c

(svn_client__get_copy_source): Add support for using an existing session.

* subversion/libsvn_client/merge.c

(normalize_merge_sources_internal): Pass existing ra session.

* subversion/libsvn_client/mergeinfo.c

(svn_client_suggest_merge_sources): Open ra session and pass it to two

functions instead of having them create and close their own sessions.

Use subpool.

* subversion/tests/libsvn_client/client-test.c

(test_suggest_mergesources): New test.

(test_funcs): Add test_suggest_mergesources.

  1. … 4 more files in changeset.
Make some 'svn mkdir' code use absolute paths internally, to avoid path length

limits on Windows.

* subversion/libsvn_client/add.c

(svn_client__make_local_parents): Document as taking absolute paths, and

don't hide errors.

(svn_client_mkdir4): Make dirents absolute before passing them to


* subversion/libsvn_client/client.h

(svn_client__make_local_parents): Tweak prototype.

Found by: schabi

  1. … 1 more file in changeset.
Remove unused private function.

* subversion/include/private/svn_client_private.h

* subversion/libsvn_client/ra.c

(svn_client__youngest_common_ancestor): Remove.

* subversion/libsvn_client/client.h

(svn_client__get_youngest_common_ancestor): Remove reference to

svn_client__youngest_common_ancestor() from docstring.

  1. … 2 more files in changeset.
Improve 'svn merge' performance over WAN: Use already fetched

history-as-mergeinfo data to find youngest common ancestor in automatic


* subversion/libsvn_client/client.h

(svn_client__get_youngest_common_ancestor): Mention new

svn_client__calc_youngest_common_ancestor in docstring.

(svn_client__calc_youngest_common_ancestor): New declaration.

* subversion/libsvn_client/ra.c

(svn_client__calc_youngest_common_ancestor): New. Extracted from


(svn_client__get_youngest_common_ancestor): Use


* subversion/libsvn_client/merge.c:

(find_automatic_merge): Use svn_client__calc_youngest_common_ancestor().

  1. … 2 more files in changeset.
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


  1. … 8 more files in changeset.
Rename and invert a private API parameter, for clarity.

* subversion/libsvn_client/client.h,


(svn_client__resolve_conflicts): Rename and invert the sense of the

'resolved' output, to become 'conflicts_remain'.

* subversion/libsvn_client/merge.c

(do_merge): Track the change.

Suggested by: rhuijben

  1. … 2 more files in changeset.