Checkout Tools
  • last updated 5 hours ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1853592 is being indexed.

On branch swig-py3: accept both of bytes/str for input char * arguments

* Replace typemap(in) for char * using 'parse' modifier with one using

function allows both of bytes/str in py2/py3 in libsvn_swig_py library

* Fix functions to convert Python objects into char pointer to accept

both of bytes/str object in py2/py3

* Fix to accept None as representation of NULL value on conversion

prop dict into apr_hash_t * and apr_array_header_t * of svn_props_t *

[In subversion/bindings/swig]

* core.i (%typemap(in) (const char *data, apr_size_t *len): Allow str

as well as bytes for data argment of svn_stream_write()

* include/svn_global.swg

(remove)(%typemap(in) char *, char const *, char * const,

char const * const): Move this typemap into include/svn_strings as

typemap (in) IN_STRING

* include/svn_string.swg (new)(%typemap(in) IN_STRING): replacement of

%typemap(in) char *, char const *, char * const, char const * const.

actual processing code is moved new svn_swig_py_string_to_cstring()

function in python/libsvn_swig_py/swigutil_py.c

* include/svn_types.swg (%typemap(in) const char *MAY_BE_NULL):

Move processing code into new svn_swig_py_string_to_cstring() function

in python/libsvn_swig_py/swigutil_py.c

* python/libsvn_swig_py/swigutil_py.c

(svn_swig_py_string_to_cstring): New function to convert Python

bytes or str into const char *, with better TypeError exception message

(svn_swig_py_string_type_exception): New function to construct

TypeError exception for new make_string_from_ob_maybe_null() function

(make_string_from_ob, make_svn_string_from_ob):

- Allow str as well as bytes for ob

- Don't raise TypeError exception because all callers don't expect it

(make_string_from_ob_maybe_null, make_svn_string_from_ob_maybe_null):

New function same as make_string_from_ob() and make_svn_string_fromob()

but allows None input represents NULL value and raise TypeError

if input value don't have appropriate type

(svn_swig_py_stringhash_from_dict, svn_swig_py_mergeinfo_from_dict,

svn_swig_py_proparray_from_dict, svn_swig_py_prophash_from_dict,


svn_swig_py_struct_ptr_hash_from_dict): separate check of key conversion

result and value conversion result

(svn_swig_py_proparray_from_dict, svn_swig_py_prophash_from_dict):

allow NULL for prop values


- Allow str as well as bytes for source argument


- Allow str as well as bytes for py_file argument as file path


- Use new function make_string_from_ob_maybe_null() instead of

make_string_from_ob() to check TypeError

- Report Python exception caused by Python callback function as

callback exception error

* python/libsvn_swig_py/swigutil_py.h

Expose new public function make_string_from_ob_maybe_null(), which is

used by typemap(in) char IN_STRING, typemap(in) const char *MAY_BY_NULL

* python/tests/

(SubversionClientTestCase.log_entry_receiver_whole): New helper

callback function for new SubversionClientTestCase.test_log5_revprops

(SubversionClientTestCase.test_log5_revprops): new test for

typemap(in) apr_array_t *STRINGLIST and its helper function


* python/tests/


- As unicode input is now valid, use int value as invalid input

- Add case to be expected to cause UnicodeEncodeError

(SubversionCoreTestCase.test_stream_write_str):(Only for Python 3)

New test case for svn_stream_write() to pass str object as data argument


Renamed from SubversionCoreTestCase.test_stream_write

* python/tests/ Register new test module typemap

* python/tests/ New unittest module for typemaps

(SubversionTypemapTestCase): New unittest subclass for unit test about


(SubversionTypemapTestCase.test_char_ptr_in): New test case


New test case

(SubversionTypemapTestCase.test_char_ptr_may_be_null): New test case


New test case

(SubversionTypemapTestCase.test_make_string_from_ob): New test case


New test case


New test case


New test case

(suite): New function to drive SubversionTypemapTestCase

Follow-up to r1853580: Fix test fallout.

* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements): Add STMT_SELECT_COPIES_OF_REPOS_RELPATH here.

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_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_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.



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_accept_move, test_funcs): New tests

which exercise both of the newly added conflict resolution options.

* STATUS: Nominate r1853483.
* STATUS: Nominate r1853483.
* STATUS: Nominate r1853450.

* STATUS: Nominate r1853450.

Fix #4760 "Missing children when svnadmin dump --include/exclude converts

copy-dir to add-dir".

Follow-up to r1811992: Canonicalize PATH before passing it to the FILTER_FUNC.

In some cases (e.g. for nodes under copied directories) PATH passed by

repos layer to AUTHZ_FUNC may be non-canonical (missing leading '/'). This

causes FILTER_FUNC implemented in svnadmin to wrongly report PATH as "not


* subversion/libsvn_repos/dump.c

(dump_filter_authz_func): Canonicalize PATH before passing it

to the FILTER_FUNC. Add comment.

* subversion/tests/cmdline/

(dump_include_copied_directory): New.

(test_list): Add new test to table.

Patch by: sergey.raevskiy{_AT_}

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'.

On the 'shelving-v3' branch: don't include unversioned files in count of changed paths.

* subversion/libsvn_client/shelf.c

(shelf_status_walk): Tweak a comment.

(shelf_copy_base): Be sure to remove all unversioned files.

On the 'shelving-v3' branch: remove debugging that broke tests.

* subversion/tests/cmdline/

(shelve_unshelve_verify): Remove a debugging 'raise' statement.

Re-implement shelving to use a separate WC for the storage of each shelf.

* subversion/include/svn_client.h

(svn_client__shelf_mods_editor): New.

(svn_client__shelf_replay): Add a notification callback.

* subversion/libsvn_client/shelf.c

(shelf_version_files_dir_abspath): Tweak the directory name to end in

".wc", for clarity.





get_working_props_abspath): Delete.








status_write): Delete.

(status_augment): New.

(status_read): Read WC status directly from shelf-storage WC.





shelf_status_walk): Adjust to use a WC status walk directly.












shelf_write_changes): Delete.

(get_shelves_dir): New.

(shelf_construct): Use a different storage dir.




svn_client__shelf_paths_changed): Remove unneeded 'as abspath' option.







shelf_replay_path_visitor): Delete.

(svn_client__shelf_replay): Use the WC replay API instead of a shelf-

specific implementation.

(test_apply_file_visitor): Tweak constness.





diff_visitor): Delete.

(wc_mods_editor): Add explicit notification callback and result pool.

(svn_client__shelf_mods_editor): Expose in the semi-public API.

(svn_client__shelf_apply): Adjust calls.


unapply_visitor): New.

(svn_client__shelf_unapply): Rewrite, using a shelf status walk that

reverts each visited path.

(svn_client__shelf_diff): Rewrite, using a WC diff instead of a

shelf-specific implementation.

(shelf_copy_base): New.


shelf_save_notifier): New.

(svn_client__shelf_save_new_version3): Rewrite, using a WC replay piped

into a shelf mods editor.

(svn_client__shelf_list): Adjust the shelf storage dir.

* subversion/tests/cmdline/


shelve_replace_dir): Don't expect "cannot shelve". Do expect failure, for




shelve_dir_copy): Don't expect "cannot shelve".

(refuse_to_shelve_conflict): Change the test case to avoid a known,

unrelated bug.

* subversion/tests/cmdline/svntest/

( Expect each sandbox to use an additional WC directory


* notes/shelving/shelf-structure.txt

Update to this version.

Make a branch for shelving v3.
* notes/shelving/shelf-structure.txt: Update for shelving v2 in svn 1.11.
Let the WC mods editor and WC replay editor APIs take explicit notification


* subversion/include/private/svn_client_private.h


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.

* subversion/tests/cmdline/

(commit_sees_tree_conflict_on_unversioned_path): New test, XFail.

(test_list): Run it.

On branch swig-py3: A follow up r1851888: Save/restore Python error indicator

For all callback APIs which don't return svn_error_t * cannot notify

Python exception their caller, and as exceptions chain in Python 3,

exception conext should be detached from caller.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(svn_swig_py_notify_func, svn_swig_py_notify_func2,

svn_swig_py_status_func, svn_swig_py_client_status_func,

svn_swig_py_status_func2, ra_callbacks_progress_func,

svn_swig_py_config_enumerator2, svn_swig_py_config_section_enumerator2):

Save error indicator before Python function call and then restore it

after call

* subversion/libsvn_client/wc_editor.c

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

WC editor does it, following r1852559.

Comment out a failing swig-rb test.

Issue 4805, "delta path editor binding broken for root path".

* subversion/bindings/swig/ruby/test/test_delta.rb

(test_path_driver): Comment out (as no XFail mechanism is available).

Improve backward compatibility for svn_delta_path_driver2().

This ensures the input array is not modified, and changes the behaviour to

be less surprising.

* subversion/include/svn_delta.h,


(svn_delta_path_driver2): Add back slash prefixes if any, rather than the

first, of the inputs had one. Duplicate the array if modifying it.

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


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.


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.

In the updated delta editor path driver, ensure paths are relpaths.

This also fixes a bug with '/'-prefixed paths in svn_delta_path_driver2(). A

path given as the string "/" was handled as a regular path (first open the

editor root, then call the callback passing it the root parent-dir-baton)

rather than as a root path.

* subversion/include/svn_delta.h



svn_delta_path_driver_step): Declare that paths are relpaths.

(svn_delta_path_driver2): Document that a slash prefix is allowed.

* subversion/libsvn_delta/deprecated.c



svn_delta_path_driver2): Implement backward compatibility for a slash


* subversion/libsvn_delta/path_driver.c

(svn_delta_path_driver3): Rename variables to 'relpath', for clarity.

(svn_delta_path_driver_step): Assert the path is a relpath, remove support

for a slash prefix, and rename variables.

Minor cleanup: extract a helper function.

* subversion/libsvn_delta/path_driver.c

(push_dir_stack_item): New.

(open_dir): Use it here.

(svn_delta_path_driver_step): Use it twice here.

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.

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_driver3): New.

* subversion/libsvn_delta/path_driver.c

(svn_delta_path_driver3): Rename from 'svn_delta_path_driver2'.


svn_delta_path_driver_start): Change the callback function type.

(svn_delta_path_driver_step): Pass the extra parameters.

* subversion/libsvn_delta/deprecated.c



svn_delta_path_driver2): New.

* subversion/libsvn_client/shelf.c

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


svn_client__shelf_replay): Remove them from the path driver baton.

* subversion/include/svn_delta.h (svn_delta_path_driver_cb_func_t): Improve docs.
* STATUS: Nominate r1852436.

* STATUS: Nominate r1852436.

* STATUS: Nominate r1852436.

Make 'svn update' not record a tree conflict when deleting an unmodified

directory which happens to contain unversioned items. Instead, just leave

the unversioned items behind on disk when deleting the unmodified directory,

which matches the behaviour of Subversion 1.8.

Prompted by a question on users@:

* subversion/libsvn_wc/update_editor.c

(check_tree_conflict): Ignore unversioned items during check for local mods.

This prevents a tree conflict from being recorded.

* subversion/tests/cmdline/

(tolerate_local_mods): Don't expect an unversioned item to cause a tree

conflict. Add the item to version control instead to meet this test's


* subversion/tests/cmdline/

(update_keeps_unversioned_items_in_deleted_dir, test_list): New test

which ensures that update will leave unversioned items on disk when

deleting an unmodified directory.