subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1553539 - /subversion/trunk/subversion/libsvn_client/commit_util.c
Date Thu, 26 Dec 2013 18:21:15 GMT
Author: rhuijben
Date: Thu Dec 26 18:21:15 2013
New Revision: 1553539

URL: http://svn.apache.org/r1553539
Log:
Make the 'svn cp WC URL' code properly calculate whether mixed revisions will
be committed as replacement or as addition.

* subversion/libsvn_client/commit_util.c
  (harvest_status_callback): In copy mode, check for mixed-revision and switched
    base node if they exist in the parent directory and if they do issue an
    explicit delete.

Modified:
    subversion/trunk/subversion/libsvn_client/commit_util.c

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1553539&r1=1553538&r2=1553539&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Thu Dec 26 18:21:15 2013
@@ -769,9 +769,11 @@ harvest_status_callback(void *status_bat
            && !(state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE))
     {
       svn_revnum_t dir_rev = SVN_INVALID_REVNUM;
+      const char *dir_repos_relpath = NULL;
 
-      if (!copy_mode_root && !status->switched && !is_added)
-        SVN_ERR(svn_wc__node_get_base(NULL, &dir_rev, NULL, NULL, NULL, NULL,
+      if (!copy_mode_root && !is_added)
+        SVN_ERR(svn_wc__node_get_base(NULL, &dir_rev, &dir_repos_relpath, NULL,
+                                      NULL, NULL,
                                       wc_ctx, svn_dirent_dirname(local_abspath,
                                                                  scratch_pool),
                                       FALSE /* ignore_enoent */,
@@ -795,6 +797,25 @@ harvest_status_callback(void *status_bat
               cf_rev = status->revision;
               cf_relpath = status->repos_relpath;
             }
+
+          if (!copy_mode_root && !is_added && baton->check_url_func
+              && dir_repos_relpath)
+            {
+              svn_node_kind_t me_kind;
+              /* Maybe we need to issue an delete (mixed rev/switched) */
+
+              SVN_ERR(baton->check_url_func(
+                            baton->check_url_baton, &me_kind,
+                            svn_path_url_add_component2(repos_root_url,
+                                        svn_relpath_join(dir_repos_relpath,
+                                            svn_dirent_basename(local_abspath,
+                                                                NULL),
+                                            scratch_pool),
+                                        scratch_pool),
+                                        dir_rev, scratch_pool));
+              if (me_kind != svn_node_none)
+                state_flags |= SVN_CLIENT_COMMIT_ITEM_DELETE;
+            }
         }
     }
 
@@ -1619,6 +1640,7 @@ do_item_commit(void **dir_baton,
       else
         notify = NULL;
 
+
       if (notify)
         {
           notify->kind = item->kind;



Mime
View raw message