You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/15 17:17:16 UTC
svn commit: r1092734 - in /subversion/trunk/subversion/libsvn_client:
commit.c commit_util.c
Author: rhuijben
Date: Fri Apr 15 15:17:15 2011
New Revision: 1092734
URL: http://svn.apache.org/viewvc?rev=1092734&view=rev
Log:
Fix two small issues in the commit target processing, uncovered by the issue
#2381 fix, and reported by markphip on dev@s.a.o.
* subversion/libsvn_client/commit.c
(determine_lock_targets): Try to lock the parent of the common ancestor if
the common ancestor itself is one of the targets.
* subversion/libsvn_client/commit_util.c
(svn_client__condense_commit_items): Filter nested deletes before driving the
commit editor.
Modified:
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/libsvn_client/commit_util.c
Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1092734&r1=1092733&r2=1092734&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Fri Apr 15 15:17:15 2011
@@ -1095,18 +1095,32 @@ determine_lock_targets(apr_array_header_
}
else
{
- /* The old code did an ancestor check; lock the parent
- just to be sure */
+ /* Lock the parent to allow deleting the target */
APR_ARRAY_PUSH(*lock_targets, const char *)
= svn_dirent_dirname(target_abspath, result_pool);
}
}
- else
+ else if (wc_targets->nelts > 1)
{
- SVN_ERR(svn_dirent_condense_targets(&common, NULL, wc_targets,
- FALSE, result_pool, iterpool));
+ SVN_ERR(svn_dirent_condense_targets(&common, &wc_targets, wc_targets,
+ FALSE, iterpool, iterpool));
- APR_ARRAY_PUSH(*lock_targets, const char *) = common;
+ qsort(wc_targets->elts, wc_targets->nelts, wc_targets->elt_size,
+ svn_sort_compare_paths);
+
+ if (wc_targets->nelts == 0
+ || !svn_path_is_empty(APR_ARRAY_IDX(wc_targets, 0, const char*))
+ || !strcmp(common, wcroot_abspath))
+ {
+ APR_ARRAY_PUSH(*lock_targets, const char *)
+ = apr_pstrdup(result_pool, common);
+ }
+ else
+ {
+ /* Lock the parent to allow deleting the target */
+ APR_ARRAY_PUSH(*lock_targets, const char *)
+ = svn_dirent_dirname(common, result_pool);
+ }
}
}
Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1092734&r1=1092733&r2=1092734&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Fri Apr 15 15:17:15 2011
@@ -1021,6 +1021,34 @@ svn_client__condense_commit_items(const
svn_dirent_local_style(item->path, pool),
svn_dirent_local_style(last_item->path, pool));
+ if (last_item != NULL
+ /* This is a delete */
+ && (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+ && !(item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
+ /* Last was a delete */
+ && (last_item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+ && !(item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
+ /* And last_item is an ancestor of item */
+ && svn_uri_is_ancestor(last_item->url, item->url))
+ {
+ /* We are committing an explicit delete below another delete.
+
+ These used to be filtered by svn_dirent_condense_targets,
+ when no filtering depth was provided. */
+ int j;
+
+ /* Remove the offending delete by moving the rest and continue */
+ for (j = i+1; j < ci->nelts; j++)
+ {
+ APR_ARRAY_IDX(ci, j-1, svn_client_commit_item3_t *)
+ = APR_ARRAY_IDX(ci, j, svn_client_commit_item3_t *);
+ }
+
+ ci->nelts--;
+ i--;
+ continue;
+ }
+
/* In the first iteration, our BASE_URL is just our only
encountered commit URL to date. After that, we find the
longest ancestor between the current BASE_URL and the current