libsvn_client

Checkout Tools
  • last updated 4 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix 'svn patch' setting UNIX permissions to 0600 on patched files with props.

* subversion/libsvn_client/patch.c

(init_patch_target): Use the working copy's own temp directory to store

temporary files for patching, instead of using the system-wide temp dir.

With a system-wide dir, permission paranoia in svn_io_open_unique_file3()

may kick in and result in patched files with permissions not matching the

umask. Generally, any temp files that may end up as user-visible files

in the working copy should be created in the working copy's temp dir.

Reported by: Doug Robinson at wandisco com

Fix conflict resolver bug where local and incoming edits got swapped.

When auto-resolving an incoming file move vs local file edit tree

conflict after an update or switch operation, text conflicts were

created with the incoming changes (theirs) and local changes (mine)

swapped within text conflict markers. When such a text conflict was

then resolved with the --accept mf/mc/tf/tc options the result was

the opposite of what it should have been.

Reported by: Jonathan Guy

* subversion/libsvn_client/conflicts.c

(resolve_incoming_move_file_text_merge): After update/switch, run the

text merge in a way that makes local and incoming changes properly

land on their respective sides of a text conflict.

* subversion/libsvn_client/delete.c

(path_driver_cb_func,

single_repos_delete):

Update to use the recently revved svn_delta_path_driver3().

* subversion/libsvn_client/shelf.c: Fix non-debug builds: remove SVN_DBG.
Reintegrate the 'shelving-v3' branch.
  1. … 4 more files in changeset.
Change the shelf storage directory name from 'v2' to 'v3'.

Also remove the knowledge of the existence of a shelves directory from the

WC API, and instead just have knowledge of the 'experimental' features dir

at this level.

* subversion/include/private/svn_wc_private.h,

subversion/libsvn_wc/wcroot_anchor.c

(svn_wc__get_experimental_dir): Replacement for 'svn_wc__get_shelves_dir'.

* subversion/libsvn_client/shelf.c

(get_shelves_dir): New.

(shelf_construct,

svn_client__shelf_list): Use it.

  1. … 2 more files in changeset.
Add resolver support for moved-file vs moved-file upon update.

The resolver now supports move vs move tree conflicts for files after

an update operation.

Two new resolution operations are available:

(m) - override incoming move and merge incoming changes from 'alpha-moved'

to 'alpha-also-moved'

(M) - accept incoming move and merge local changes from 'alpha-also-moved'

to 'alpha-moved'

Where the file was originally called 'alpha', was renamed to 'alpha-moved'

in the repository, and renamed to 'alpha-also-moved' in the working copy.

Because the local move is broken during the update operation when the

delete-half of the move is updated, the resolver only has the copied half

move available in the working copy. To find the local move destination the

resolver queries the working copy database for nodes which are copies of

the conflict victim's repository path. This can of course lead to ambiguous

results in case a node is first copied and then moved, in which case the

resolver offers the user a choice of local move targets in the usual way.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_copies_of_repos_path): Declare.

* subversion/libsvn_client/conflicts.c

(conflict_tree_update_local_moved_away_details): New conflict details struct.

(resolve_both_moved_file_update_keep_local_move,

resolve_both_moved_file_update_keep_incoming_move): New resolution handlers.

(conflict_tree_get_details_update_local_moved_away): New details fetcher

which locates copied nodes corresponding to the local move.

(get_both_moved_file_paths): New helper function.

(conflict_tree_get_description_update_both_moved_file_merge,

conflict_tree_get_description_update_both_moved_file_move_merge): New

functions which describe incoming move vs local move conflicts flagged

during updates of files.

(configure_option_both_moved_file_merge): Hook up the new options.

(svn_client_conflict_option_get_moved_to_abspath_candidates2,

svn_client_conflict_option_set_moved_to_abspath2,

conflict_type_specific_setup): Support the newly added conflict options.

* subversion/libsvn_wc/node.c

(svn_wc__find_copies_of_repos_path): New.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_COPIES_OF_REPOS_RELPATH): New query which locates copies of a

particular repository relpath with a particular node kind in working copy.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_copies_of_repos_path): New wc_db API to execute above query.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_copies_of_repos_path): Declare.

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

(create_file_move_vs_file_move_update_conflict): New helper function.

(test_update_file_move_vs_file_move,

test_update_file_move_vs_file_move_accept_move, test_funcs): New tests

which exercise both of the newly added conflict resolution options.

  1. … 6 more files in changeset.
Only enable the 'incoming_move_file_merge' resolution option if the

local change is a file edit.

This resolution option was introduced in r1747727 and accidentally enabled

for any local change vs an incoming deletion. So while this resolution

handler only supports local edits, it was enabled even for other conflicts,

such as those involving locally moved-away files.

In that case Subversion was pretending to resolve the conflict when in fact

it did not resolve it. The resolution handler in libsvn_client internally

failed with a "path not found" error which was masked by 'svn resolve' (since

this error is sometimes legitimate) and the conflict marker was still in

place after Subversion proudly proclaimed:

"Applying recommended resolution 'Move and merge'"

Subversion now tells the truth instead:

"Subversion is not smart enough to resolve this tree conflict automatically!"

* subversion/libsvn_client/conflicts.c

(configure_option_incoming_move_file_merge): Only configure this option if

the local change is an 'edit'.

Let the WC mods editor and WC replay editor APIs take explicit notification

callbacks.

* subversion/include/private/svn_client_private.h

(svn_client__wc_replay,

svn_client__wc_copy_mods): Take a notification callback.

* subversion/libsvn_client/commit.c

(svn_client__wc_replay): Take a notification callback.

* subversion/libsvn_client/wc_editor.c

(svn_client__wc_copy_mods): Take a notification callback.

* subversion/svn/shelf-cmd.c

(svn_cl__wc_copy_mods): Adjust caller.

  1. … 2 more files in changeset.
* subversion/libsvn_client/wc_editor.c

(svn_client__wc_copy_mods): Remove the WC locking, now that the

WC editor does it, following r1852559.

Teach the WC editor to acquire and release a WC write lock.

* subversion/include/private/svn_client_private.h

(svn_client__wc_editor): Document that it manages the write lock.

(svn_client__wc_editor_internal): Add an option flag to manage the write lock.

* subversion/libsvn_client/copy.c

(copy_foreign_dir,

svn_client__repos_to_wc_copy_by_editor): Ask the WC editor not to manage

the write lock for us here, as the caller does it.

* subversion/libsvn_client/shelf.c

(svn_client__shelf_apply): Don't aquire and release the write lock here:

let the WC editor do it.

* subversion/libsvn_client/wc_editor.c

(edit_baton_t): Add fields to manage the write lock.

(release_write_lock,

pool_cleanup_handler): New.

(edit_open): If requested, acquire the write lock and arrange for it to be

released on pool clean-up.

(edit_close): If acquired, release the write lock.

(svn_client__wc_editor_internal): Add the option flag to manage the write

lock. Initialize the 'abort_edit' method so that it will release the

write lock, the same as 'close_edit'.

(svn_client__wc_editor): Ask for the write lock to be managed.

  1. … 1 more file in changeset.
Upgrade uses of the editor path driver callback, following r1852526.

* subversion/libsvn_client/add.c

(path_driver_cb_func): Take the editor and edit-baton as direct parameters.

(mkdir_urls): Upgrade to svn_delta_path_driver3.

* subversion/libsvn_client/commit_util.c

(item_commit_baton): Remove the editor and edit-baton from here.

(do_item_commit): Take the editor and edit-baton as direct parameters.

(svn_client__do_commit): Upgrade to svn_delta_path_driver3.

* subversion/libsvn_client/copy.c

(path_driver_cb_baton): Remove the editor and edit-baton from here.

(path_driver_cb_func): Take the editor and edit-baton as direct parameters.

(repos_to_repos_copy): Upgrade to svn_delta_path_driver3.

* subversion/libsvn_delta/branch_compat.c

(apply_change): Take the editor and edit-baton as direct parameters.

(drive_changes): Upgrade to svn_delta_path_driver3.

* subversion/libsvn_delta/compat.c

(apply_change): Take the editor and edit-baton as direct parameters.

(drive_changes): Upgrade to svn_delta_path_driver3.

* subversion/libsvn_repos/replay.c

(path_driver_cb_baton): Remove the editor and edit-baton from here.

(path_driver_cb_func): Take the editor and edit-baton as direct parameters.

(svn_repos_replay2): Upgrade to svn_delta_path_driver3.

  1. … 3 more files in changeset.
Make the editor path driver callback a little easier to use.

Add 'editor' and 'edit_baton' parameters to the path driver callback. All

but trivial callback implementations need these, and they otherwise had to

be passed through the callback baton, which was straightforward but more

trouble than it need be.

* subversion/include/svn_delta.h

(svn_delta_path_driver_cb_func2_t,

svn_delta_path_driver3): New.

* subversion/libsvn_delta/path_driver.c

(svn_delta_path_driver3): Rename from 'svn_delta_path_driver2'.

(svn_delta_path_driver_state_t,

svn_delta_path_driver_start): Change the callback function type.

(svn_delta_path_driver_step): Pass the extra parameters.

* subversion/libsvn_delta/deprecated.c

(path_driver_2_to_3_baton_t,

path_driver_2_to_3_func,

svn_delta_path_driver2): New.

* subversion/libsvn_client/shelf.c

(path_driver_cb_func): Take 'editor' and 'edit_baton' as direct parameters.

(path_driver_cb_baton_t,

svn_client__shelf_replay): Remove them from the path driver baton.

  1. … 3 more files in changeset.
Make the new shelf-replay-to-delta-editor API public (experimental).

* subversion/include/svn_client.h,

subversion/libsvn_client/shelf.c

(svn_client__shelf_apply): Rename from 'shelf_replay' and make public.

  1. … 1 more file in changeset.
* subversion/libsvn_client/shelf.c (shelf_name_from_filename): Use consistent data types.
* subversion/libsvn_client/shelf.c (path_driver_cb_func): Fix the build, following r1852382.
* subversion/libsvn_client/shelf.c

(path_driver_cb_func): Always initialize the 'dir baton' output parameter,

as other implementations of this callback type do, even though driver

may not require it.

Fix 'unshelve' of property mods.

Found by: stsp

* subversion/libsvn_client/shelf.c

(path_driver_cb_func): Open the correct directory before trying to apply

its property mods. Fix other doc strings too.

In the WC-mods-editor: fix properties handling; simplify.

Handle property changes correctly. Previously, property deletions were

ignored.

Simplify by applying incoming changes as they arrive. Previously we were

batching up some changes such as property changes and creating new files and

dirs, which could be more efficient but is harder to get right, as evidenced

by the above bug fix.

Simplify by not managing subpools for the directory and file batons. The

edit driver should do that.

* subversion/libsvn_client/wc_editor.c

(mkdir,

mkfile): New.

(dir_baton_t,

dir_open_or_add,

edit_open,

dir_open,

file_baton_t,

file_open_or_add,

file_open): Don't track the 'created' state and properties here.

(dir_add,

file_add): Always create the versioned node here.

(dir_change_prop,

file_change_prop): Always apply property changes here.

(dir_close,

file_close): Never create nodes and apply property changes here.

(ensure_added_dir,

ensure_added_file): Delete.

Remove internal pool management from the WC editor.

The path driver, which wraps this editor, already provides a result pool

hierarchy. This can be used by the WC editor instead of having it manage

another such hierarchy internally.

Review by: julianfoad

* subversion/libsvn_client/wc_editor.c

(edit_baton_t, svn_client__wc_editor_internal): Remove local pool.

(dir_baton_t) Remove the local pool users counter.

(dir_open_or_add, edit_open, dir_open, dir_add, dir_change_prop,

file_open_or_add, file_add): Allocate results in result_pool provided

by the caller, i.e. the path driver.

(file_close, maybe_done): Remove maybe_done() helper which is now unused.

Tweaks in the WC mods editor, issue SVN-4786.

* subversion/libsvn_client/wc_editor.c

(dir_open_or_add): Support opening the root dir. Move higher up.

(edit_open): Use dir_open_or_add.

(dir_open, dir_add): Adjust callers.

(dir_change_prop, file_change_prop): Shorten slightly.

(ensure_added_dir): Rename from 'ensure_added', and update callers.

Remove a useless common ancestor search from the conflict resolver.

* subversion/libsvn_client/conflicts.c

(resolve_incoming_move_dir_merge): Stop searching a YCA and then using it

as the left-side of the merge source when merging into the move target.

Doing so is wrong because it could lead to dubious conflicts since we will

end up ignoring mergeinfo. Use the 'incoming old' path and revision as the

left-merge side instead, which is properly bound by merge-tracking done

during the merge which recorded the conflict.

Problem found by code inspection while working on r1851913.

Follow-up to r1851913:

* subversion/libsvn_client/conflicts.c

(resolve_both_moved_dir_merge): Fix docstring of this function.

Add two resolver options for 'dir move vs dir move upon merge' conflicts.

These new options work similar to their existing counterparts for files.

* subversion/include/svn_client.h

(svn_client_conflict_option_both_moved_dir_merge,

svn_client_conflict_option_both_moved_dir_move_merge): Declare.

* subversion/libsvn_client/conflicts.c

(resolve_both_moved_dir_merge,

resolve_both_moved_dir_move_merge): New resolution option handlers.

(svn_client_conflict_tree_get_resolution_options,

configure_option_both_moved_dir_merge): Enable new options on applicable

tree conflicts.

(svn_client_conflict_option_get_moved_to_repos_relpath_candidates2,

svn_client_conflict_option_set_moved_to_repos_relpath2,

svn_client_conflict_option_get_moved_to_abspath_candidates2,

svn_client_conflict_option_set_moved_to_abspath2): Handle new options.

* subversion/svn/conflict-callbacks.c

(builtin_resolver_options): Assign resolver menu keys to the new options.

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

(test_merge_dir_move_vs_dir_move,

test_merge_dir_move_vs_dir_move_accept_move, test_funcs): Add new tests.

(create_dir_move_vs_dir_move_merge_conflict): New helper for above tests.

  1. … 3 more files in changeset.
* subversion/libsvn_client/conflicts.c

(resolve_incoming_move_dir_merge): Don't forget to unlock the working copy

again if the revert operation fails.

A follow-up to r1851739: teach 'unshelve' to do adds through the WC editor.

* subversion/libsvn_client/shelf.c

(apply_prop_mods): Update doc string.

(apply_file_mods): Ensure null arguments are acceptable.

(path_driver_cb_func): Implement 'add' through the WC editor.

A follow-up to r1851739: close the streams we opened.

(Found because the rename attempt failed on Windows.)

* subversion/include/svn_delta.h

(svn_txdelta_apply): Document that it closes its target stream but not its

source stream.

* subversion/libsvn_client/wc_editor.c

(file_baton_t

file_textdelta,

file_close): Close the source stream before we try to overwrite the file

it was reading from.

  1. … 1 more file in changeset.
Teach 'unshelve' to drive the new WC local mods editor.

Re: SVN-4786 "Create a WC working-mods editor", SVN-3625 "Commit shelving".

Instead of applying changes directly to the WC, the changes now go through

the standard svn_delta_editor_t API. When completed, this will allow a much

more exact transfer of the possible changes, and a more resuable

implementation.

The ability to merge file text changes is lost, for the time being. This

will need to be re-implemented in the WC local mods editor. (Note that the

implementation of merging here was incomplete anyway.)

* subversion/libsvn_client/shelf.c

(wc_file_merge,

wc_dir_props_merge,

wc_node_delete,

wc_node_add): Remove.

(apply_prop_mods,

apply_file_mods,

path_driver_cb_baton_t,

path_driver_cb_func,

shelf_replay_path_baton_t,

shelf_replay_path_visitor,

shelf_replay): New.

(test_apply_files_baton_t,

test_apply_file_visitor): Renamed remnants of a combined function.

(svn_client__shelf_test_apply_file): Update the caller.

(wc_mods_editor): New.

(svn_client__shelf_apply): Use wc_mods_editor() and shelf_replay()

instead.

* subversion/tests/cmdline/shelf_tests.py

(unshelve_text_mod_merge,

unshelve_text_mod_conflict,

unshelve_undeclared_binary_mod_conflict

unshelve_binary_mod_conflict,

unshelve_text_prop_conflict): Mark as XFail, as merge and conflict

behaviour has changed.

  1. … 1 more file in changeset.
Follow up to r1851268: our coding guidelines say that output parameters

should come first in the function argument list.

* subversion/include/svn_client.h

(svn_client_blame6): Move start_revnum_p and end_revnum_p to the

beginning of the argument list and update the docstring to say that

either of these may be NULL.

* subversion/libsvn_client/blame.c

(svn_client_blame6): Update signature.

* subversion/svn/blame-cmd.c (svn_cl__blame),

subversion/libsvn_client/deprecated.c (svn_client_blame5),

subversion/bindings/javahl/native/SVNClient.cpp (SVNClient::blame):

Update all callers.

  1. … 3 more files in changeset.
In shelving code: lock the whole WC when unshelving.

The immediate benefit is code simplification rather than functional.

* subversion/libsvn_client/shelf.c

(wc_file_merge,

wc_dir_props_merge,

wc_node_delete,

wc_node_add): Don't lock the WC here...

(svn_client__shelf_apply): ... but here.