Modified: subversion/branches/swig-py3/subversion/include/svn_version.h URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/include/svn_version.h?rev=1847678&r1=1847677&r2=1847678&view=diff ============================================================================== --- subversion/branches/swig-py3/subversion/include/svn_version.h (original) +++ subversion/branches/swig-py3/subversion/include/svn_version.h Wed Nov 28 21:25:32 2018 @@ -61,7 +61,7 @@ extern "C" { * Modify when new functionality is added or new interfaces are * defined, but all changes are backward compatible. */ -#define SVN_VER_MINOR 11 +#define SVN_VER_MINOR 12 /** * Patch number.
Modified: subversion/branches/swig-py3/subversion/include/svn_wc.h URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/include/svn_wc.h?rev=1847678&r1=1847677&r2=1847678&view=diff ============================================================================== --- subversion/branches/swig-py3/subversion/include/svn_wc.h (original) +++ subversion/branches/swig-py3/subversion/include/svn_wc.h Wed Nov 28 21:25:32 2018 @@ -7644,8 +7644,8 @@ svn_wc_revert6(svn_wc_context_t *wc_ctx, void *notify_baton, apr_pool_t *scratch_pool); -/** Similar to svn_wc_revert6() but with @a remove_added_from_disk always - * set to FALSE. +/** Similar to svn_wc_revert6() but with @a added_keep_local always + * set to TRUE. * * @since New in 1.9. * @deprecated Provided for backward compatibility with the 1.10 API. Modified: subversion/branches/swig-py3/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c?rev=1847678&r1=1847677&r2=1847678&view=diff ============================================================================== --- subversion/branches/swig-py3/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c (original) +++ subversion/branches/swig-py3/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c Wed Nov 28 21:25:32 2018 @@ -118,6 +118,8 @@ password_get_gnome_keyring(svn_boolean_t { GError *gerror = NULL; gchar *gpassword; + + *done = FALSE; if (!available_collection(non_interactive, pool)) return SVN_NO_ERROR; @@ -129,6 +131,7 @@ password_get_gnome_keyring(svn_boolean_t NULL); if (gerror) { + /* ### TODO: return or log the error? */ g_error_free(gerror); } else if (gpassword) @@ -156,6 +159,8 @@ password_set_gnome_keyring(svn_boolean_t GError *gerror = NULL; gboolean gstatus; + *done = FALSE; + if (!available_collection(non_interactive, pool)) return SVN_NO_ERROR; @@ -170,6 +175,7 @@ password_set_gnome_keyring(svn_boolean_t NULL); if (gerror) { + /* ### TODO: return or log the error? */ g_error_free(gerror); } else if (gstatus) Modified: subversion/branches/swig-py3/subversion/libsvn_client/client.h URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/libsvn_client/client.h?rev=1847678&r1=1847677&r2=1847678&view=diff ============================================================================== --- subversion/branches/swig-py3/subversion/libsvn_client/client.h (original) +++ subversion/branches/swig-py3/subversion/libsvn_client/client.h Wed Nov 28 21:25:32 2018 @@ -682,34 +682,6 @@ svn_client__get_diff_editor2(const svn_d /* ---------------------------------------------------------------- */ -/*** Editor for diff summary ***/ - -/* Set *DIFF_PROCESSOR to a diff processor that will report a diff summary - to SUMMARIZE_FUNC. - - P_ROOT_RELPATH will return a pointer to a string that must be set to - the root of the operation before the processor is called. - - ORIGINAL_PATH specifies the original path and will be used with - **ANCHOR_PATH to create paths as the user originally provided them - to the diff function. - - SUMMARIZE_FUNC is called with SUMMARIZE_BATON as parameter by the - created callbacks for each changed item. -*/ -svn_error_t * -svn_client__get_diff_summarize_callbacks( - const svn_diff_tree_processor_t **diff_processor, - const char ***p_root_relpath, - svn_client_diff_summarize_func_t summarize_func, - void *summarize_baton, - const char *original_target, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool); - -/* ---------------------------------------------------------------- */ - - /*** Copy Stuff ***/ /* This structure is used to associate a specific copy or move SRC with a @@ -754,40 +726,23 @@ typedef struct svn_client__copy_pair_t /*** Commit Stuff ***/ -/* WARNING: This is all new, untested, un-peer-reviewed conceptual - stuff. +/* The "Harvest Committables" System - The day that 'svn switch' came into existence, our old commit - crawler (svn_wc_crawl_local_mods) became obsolete. It relied far - too heavily on the on-disk hierarchy of files and directories, and - simply had no way to support disjoint working copy trees or nest - working copies. The primary reason for this is that commit - process, in order to guarantee atomicity, is a single drive of a + The commit process requires, per repository, a single drive of a commit editor which is based not on working copy paths, but on - URLs. With the completion of 'svn switch', it became all too - likely that the on-disk working copy hierarchy would no longer be - guaranteed to map to a similar in-repository hierarchy. - - Aside from this new brokenness of the old system, an unrelated - feature request had cropped up -- the ability to know in advance of - your commit, exactly what would be committed (so that log messages - could be initially populated with this information). Since the old - crawler discovered commit candidates while in the process of - committing, it was impossible to harvest this information upfront. - As a workaround, svn_wc_statuses() was used to stat the whole - working copy for changes before the commit started...and then the - commit would again stat the whole tree for changes. - - Enter the new system. + URLs. The on-disk working copy hierarchy does not, in general, + map to a similar in-repository hierarchy, due to switched subtrees + and disjoint working copies. + + Also we wish to know exactly what would be committed, in advance of + the commit, so that a log message editor can be initially populated + with this information. The primary goal of this system is very straightforward: harvest all commit candidate information up front, and cache enough info in the process to use this to drive a URL-sorted commit. - *** END-OF-KNOWLEDGE *** - - The prototypes below are still in development. In general, the - idea is that commit-y processes ('svn mkdir URL', 'svn delete URL', + The idea is that commit-y processes ('svn mkdir URL', 'svn delete URL', 'svn commit', 'svn copy WC_PATH URL', 'svn copy URL1 URL2', 'svn move URL1 URL2', others?) generate the cached commit candidate information, and hand this information off to a consumer which is @@ -844,7 +799,7 @@ typedef svn_error_t *(*svn_client__check - if the candidate has a lock token, add it to the LOCK_TOKENS hash. - if the candidate is a directory scheduled for deletion, crawl - the directories children recursively for any lock tokens and + the directory's children recursively for any lock tokens and add them to the LOCK_TOKENS array. At the successful return of this function, COMMITTABLES will point @@ -1129,24 +1084,26 @@ svn_client__resolve_conflicts(svn_boolea svn_client_ctx_t *ctx, apr_pool_t *scratch_pool); -/* Produce a diff with depth DEPTH between two files or two directories at - * LEFT_ABSPATH1 and RIGHT_ABSPATH, using the provided diff callbacks to - * show changes in files. The files and directories involved may be part of - * a working copy or they may be unversioned. For versioned files, show - * property changes, too. - * - * If ANCHOR_ABSPATH is not null, set it to the anchor of the diff before - * the first processor call. (The anchor is LEFT_ABSPATH or an ancestor of it) +/* Produce a diff with depth DEPTH between the file or directory at + * LEFT_ABSPATH and the file or directory at RIGHT_ABSPATH, reporting + * differences to DIFF_PROCESSOR. + * + * The files and directories involved may be part of a working copy or + * they may be unversioned. For versioned files, show property changes, + * too. + * + * No copy or move information is reported to the diff processor. + * + * Anchor the DIFF_PROCESSOR at the requested diff targets (LEFT_ABSPATH, + * RIGHT_ABSPATH). As any children reached by recursion are matched by + * name, a diff processor relpath applies equally to both sides of the diff. */ svn_error_t * -svn_client__arbitrary_nodes_diff(const char **root_relpath, - svn_boolean_t *root_is_dir, - const char *left_abspath, +svn_client__arbitrary_nodes_diff(const char *left_abspath, const char *right_abspath, svn_depth_t depth, const svn_diff_tree_processor_t *diff_processor, svn_client_ctx_t *ctx, - apr_pool_t *result_pool, apr_pool_t *scratch_pool); @@ -1267,39 +1224,6 @@ svn_client__merge_locked(svn_client__con apr_pool_t *result_pool, apr_pool_t *scratch_pool); -/** Set @a shelf's revprop @a prop_name to @a prop_val. - * - * If @a prop_val is NULL, delete the property (if present). - */ -svn_error_t * -svn_client__shelf_revprop_set(svn_client_shelf_t *shelf, - const char *prop_name, - const svn_string_t *prop_val, - apr_pool_t *scratch_pool); - -/** Get @a shelf's revprop @a prop_name into @a *prop_val. - * - * If the property is not present, set @a *prop_val to NULL. - * - * The lifetime of the result is limited to that of @a shelf and/or - * of @a result_pool. - */ -svn_error_t * -svn_client__shelf_revprop_get(svn_string_t **prop_val, - svn_client_shelf_t *shelf, - const char *prop_name, - apr_pool_t *result_pool); - -/** Get @a shelf's revprops into @a props. - * - * The lifetime of the result is limited to that of @a shelf and/or - * of @a result_pool. - */ -svn_error_t * -svn_client__shelf_revprop_list(apr_hash_t **props, - svn_client_shelf_t *shelf, - apr_pool_t *result_pool); - #ifdef __cplusplus } #endif /* __cplusplus */ Modified: subversion/branches/swig-py3/subversion/libsvn_client/commit.c URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/libsvn_client/commit.c?rev=1847678&r1=1847677&r2=1847678&view=diff ============================================================================== --- subversion/branches/swig-py3/subversion/libsvn_client/commit.c (original) +++ subversion/branches/swig-py3/subversion/libsvn_client/commit.c Wed Nov 28 21:25:32 2018 @@ -500,6 +500,110 @@ append_externals_as_explicit_targets(apr return SVN_NO_ERROR; } +/* Crawl the working copy for commit items. + */ +static svn_error_t * +harvest_committables(apr_array_header_t **commit_items_p, + apr_hash_t **committables_by_path_p, + apr_hash_t **lock_tokens, + const char *base_dir_abspath, + const apr_array_header_t *targets, + int depth_empty_start, + svn_depth_t depth, + svn_boolean_t just_locked, + const apr_array_header_t *changelists, + svn_client_ctx_t *ctx, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + struct check_url_kind_baton cukb; + svn_client__committables_t *committables; + apr_hash_index_t *hi; + + /* Prepare for when we have a copy containing not-present nodes. */ + cukb.pool = scratch_pool; + cukb.session = NULL; /* ### Can we somehow reuse session? */ + cukb.repos_root_url = NULL; + cukb.ctx = ctx; + + SVN_ERR(svn_client__harvest_committables(&committables, lock_tokens, + base_dir_abspath, targets, + depth_empty_start, depth, + just_locked, + changelists, + check_url_kind, &cukb, + ctx, result_pool, scratch_pool)); + if (apr_hash_count(committables->by_repository) == 0) + { + *commit_items_p = NULL; + return SVN_NO_ERROR; /* Nothing to do */ + } + else if (apr_hash_count(committables->by_repository) > 1) + { + return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, + _("Commit can only commit to a single repository at a time.\n" + "Are all targets part of the same working copy?")); + } + + hi = apr_hash_first(scratch_pool, committables->by_repository); + *commit_items_p = apr_hash_this_val(hi); + if (committables_by_path_p) + *committables_by_path_p = committables->by_path; + return SVN_NO_ERROR; +} + +svn_error_t * +svn_client__wc_replay(const apr_array_header_t *targets, + svn_depth_t depth, + const apr_array_header_t *changelists, + const svn_delta_editor_t *editor, + void *edit_baton, + svn_client_ctx_t *ctx, + apr_pool_t *pool) +{ + const char *base_abspath; + apr_array_header_t *rel_targets; + apr_hash_t *lock_tokens; + apr_array_header_t *commit_items; + const char *base_url; + + /* Condense the target list. This makes all targets absolute. */ + SVN_ERR(svn_dirent_condense_targets(&base_abspath, &rel_targets, targets, + FALSE, pool, pool)); + + /* No targets means nothing to commit, so just return. */ + if (base_abspath == NULL) + return SVN_NO_ERROR; + + SVN_ERR_ASSERT(rel_targets != NULL); + + /* If we calculated only a base and no relative targets, this + must mean that we are being asked to commit (effectively) a + single path. */ + if (rel_targets->nelts == 0) + APR_ARRAY_PUSH(rel_targets, const char *) = ""; + + /* Crawl the working copy for commit items. */ + SVN_ERR(harvest_committables(&commit_items, NULL /*committables_by_path_p*/, + &lock_tokens, + base_abspath, rel_targets, + -1 /*depth_empty_start*/, + depth, + FALSE /*just_locked*/, + changelists, + ctx, pool, pool)); + + /* Sort and condense our COMMIT_ITEMS. */ + SVN_ERR(svn_client__condense_commit_items(&base_url, commit_items, pool)); + + ctx->notify_func2 = NULL; + SVN_ERR(svn_client__do_commit(base_url, commit_items, + editor, edit_baton, + NULL /*notify_prefix*/, NULL /*sha1_checksums*/, + ctx, pool, pool)); + return SVN_NO_ERROR; +} + svn_error_t * svn_client_commit6(const apr_array_header_t *targets, svn_depth_t depth, @@ -525,7 +629,7 @@ svn_client_commit6(const apr_array_heade apr_array_header_t *rel_targets; apr_array_header_t *lock_targets; apr_array_header_t *locks_obtained; - svn_client__committables_t *committables; + apr_hash_t *committables_by_path; apr_hash_t *lock_tokens; apr_hash_t *sha1_checksums; apr_array_header_t *commit_items; @@ -615,55 +719,27 @@ svn_client_commit6(const apr_array_heade pool); /* Crawl the working copy for commit items. */ - { - struct check_url_kind_baton cukb; - - /* Prepare for when we have a copy containing not-present nodes. */ - cukb.pool = iterpool; - cukb.session = NULL; /* ### Can we somehow reuse session? */ - cukb.repos_root_url = NULL; - cukb.ctx = ctx; - - cmt_err = svn_error_trace( - svn_client__harvest_committables(&committables, - &lock_tokens, - base_abspath, - rel_targets, - depth_empty_after, - depth, - ! keep_locks, - changelists, - check_url_kind, - &cukb, - ctx, - pool, - iterpool)); - - svn_pool_clear(iterpool); - } + cmt_err = svn_error_trace( + harvest_committables(&commit_items, &committables_by_path, + &lock_tokens, + base_abspath, + rel_targets, + depth_empty_after, + depth, + ! keep_locks, + changelists, + ctx, + pool, + iterpool)); + svn_pool_clear(iterpool); if (cmt_err) goto cleanup; - if (apr_hash_count(committables->by_repository) == 0) + if (!commit_items) { goto cleanup; /* Nothing to do */ } - else if (apr_hash_count(committables->by_repository) > 1) - { - cmt_err = svn_error_create( - SVN_ERR_UNSUPPORTED_FEATURE, NULL, - _("Commit can only commit to a single repository at a time.\n" - "Are all targets part of the same working copy?")); - goto cleanup; - } - - { - apr_hash_index_t *hi = apr_hash_first(iterpool, - committables->by_repository); - - commit_items = apr_hash_this_val(hi); - } /* If our array of targets contains only locks (and no actual file or prop modifications), then we return here to avoid committing a @@ -713,7 +789,7 @@ svn_client_commit6(const apr_array_heade if (moved_from_abspath && delete_op_root_abspath) { svn_client_commit_item3_t *delete_half = - svn_hash_gets(committables->by_path, delete_op_root_abspath); + svn_hash_gets(committables_by_path, delete_op_root_abspath); if (!delete_half) { @@ -769,7 +845,7 @@ svn_client_commit6(const apr_array_heade if (moved_to_abspath && copy_op_root_abspath && strcmp(moved_to_abspath, copy_op_root_abspath) == 0 && - svn_hash_gets(committables->by_path, copy_op_root_abspath) + svn_hash_gets(committables_by_path, copy_op_root_abspath) == NULL) { cmt_err = svn_error_createf(
