Remove unnecessary parameters from a new tree conflicts API. ### Unsure whether this is a valid approach. I suppose ### svn_wc_get_tree_conflict() would fail if called while the program ### has the parent directory open for write access. * subversion/include/svn_wc.h, subversion/libsvn_wc/tree_conflicts.c (svn_wc_get_tree_conflict): Remove the adm_access parameter, as it is unnecessary for a read operation. * subversion/libsvn_client/info.c (info_found_entry_callback, info_error_handler): Adjust calls accordingly. * subversion/libsvn_wc/status.c (assemble_status): Adjust calls accordingly. Index: subversion/include/svn_wc.h =================================================================== --- subversion/include/svn_wc.h (revision 33777) +++ subversion/include/svn_wc.h (working copy) @@ -5264,15 +5264,13 @@ svn_wc_set_changelist(const char *path, /** Set @a *tree_conflict to a newly allocated @c * svn_wc_conflict_description_t structure describing the tree * conflict state of @a victim_path, or to @c NULL if @a victim_path - * is not in a state of tree conflict. @a adm_access is the admin - * access baton for @a victim_path. Use @a pool for all allocations. + * is not in a state of tree conflict. Use @a pool for all allocations. * * @since New in 1.6. */ svn_error_t * svn_wc_get_tree_conflict(svn_wc_conflict_description_t **tree_conflict, const char *victim_path, - svn_wc_adm_access_t *adm_access, apr_pool_t *pool); /** Index: subversion/libsvn_client/info.c =================================================================== --- subversion/libsvn_client/info.c (revision 33777) +++ subversion/libsvn_client/info.c (working copy) @@ -268,8 +268,7 @@ info_found_entry_callback(const char *pa SVN_ERR(svn_wc_adm_probe_try3(&adm_access, fe_baton->adm_access, path, FALSE /* read-only */, 0 /* levels */, NULL, NULL, pool)); - SVN_ERR(svn_wc_get_tree_conflict(&info->tree_conflict, path, adm_access, - pool)); + SVN_ERR(svn_wc_get_tree_conflict(&info->tree_conflict, path, pool)); SVN_ERR(fe_baton->receiver(fe_baton->receiver_baton, path, info, pool)); } return SVN_NO_ERROR; @@ -297,8 +296,7 @@ info_error_handler(const char *path, SVN_ERR(svn_wc_adm_probe_try3(&adm_access, fe_baton->adm_access, svn_path_dirname(path, pool), FALSE, 0, NULL, NULL, pool)); - SVN_ERR(svn_wc_get_tree_conflict(&tree_conflict, path, adm_access, - pool)); + SVN_ERR(svn_wc_get_tree_conflict(&tree_conflict, path, pool)); if (tree_conflict) { Index: subversion/libsvn_wc/status.c =================================================================== --- subversion/libsvn_wc/status.c (revision 33777) +++ subversion/libsvn_wc/status.c (working copy) @@ -301,7 +301,7 @@ assemble_status(svn_wc_status2_t **statu { svn_wc_conflict_description_t *conflict; - SVN_ERR(svn_wc_get_tree_conflict(&conflict, path, adm_access, pool)); + SVN_ERR(svn_wc_get_tree_conflict(&conflict, path, pool)); tree_conflicted_p = (conflict != NULL); } Index: subversion/libsvn_wc/tree_conflicts.c =================================================================== --- subversion/libsvn_wc/tree_conflicts.c (revision 33777) +++ subversion/libsvn_wc/tree_conflicts.c (working copy) @@ -540,41 +540,26 @@ svn_wc__loggy_add_tree_conflict_data( svn_error_t * svn_wc_get_tree_conflict(svn_wc_conflict_description_t **tree_conflict, const char *victim_path, - svn_wc_adm_access_t *adm_access, apr_pool_t *pool) { const char *parent_path = svn_path_dirname(victim_path, pool); svn_wc_adm_access_t *parent_adm_access; - svn_boolean_t parent_adm_access_is_temporary = FALSE; svn_error_t *err; apr_array_header_t *conflicts; const svn_wc_entry_t *entry; int i; - /* Try to get the parent's admin access baton from the baton set. */ - err = svn_wc_adm_retrieve(&parent_adm_access, adm_access, parent_path, - pool); - if (err && (err->apr_err == SVN_ERR_WC_NOT_LOCKED)) + /* Try to access the parent dir. */ + err = svn_wc_adm_open3(&parent_adm_access, NULL, parent_path, + FALSE, 0, NULL, NULL, pool); + + /* If the parent isn't a WC dir, the child can't be + tree-conflicted. */ + if (err && (err->apr_err == SVN_ERR_WC_NOT_DIRECTORY)) { svn_error_clear(err); - - /* Try to access the parent dir independently. We can't add - a parent's access baton to the existing access baton set - of its child, because the lifetimes would be wrong - according to doc string of svn_wc_adm_open3(), so we get - open it temporarily and close it after use. */ - err = svn_wc_adm_open3(&parent_adm_access, NULL, parent_path, - FALSE, 0, NULL, NULL, pool); - parent_adm_access_is_temporary = TRUE; - - /* If the parent isn't a WC dir, the child can't be - tree-conflicted. */ - if (err && (err->apr_err == SVN_ERR_WC_NOT_DIRECTORY)) - { - svn_error_clear(err); - *tree_conflict = NULL; - return SVN_NO_ERROR; - } + *tree_conflict = NULL; + return SVN_NO_ERROR; } SVN_ERR(err); @@ -599,9 +584,8 @@ svn_wc_get_tree_conflict(svn_wc_conflict } } - /* If we opened a temporary admin access baton, close it. */ - if (parent_adm_access_is_temporary) - SVN_ERR(svn_wc_adm_close2(parent_adm_access, pool)); + /* We opened a temporary admin access baton, so close it. */ + SVN_ERR(svn_wc_adm_close2(parent_adm_access, pool)); return SVN_NO_ERROR; }