subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1771465 - /subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
Date Sat, 26 Nov 2016 11:32:38 GMT
Author: stsp
Date: Sat Nov 26 11:32:38 2016
New Revision: 1771465

URL: http://svn.apache.org/viewvc?rev=1771465&view=rev
Log:
* subversion/libsvn_wc/wc_db_update_move.c
  (update_incoming_move): Error out if local modifications exist at
   the incoming move target location.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1771465&r1=1771464&r2=1771465&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Sat Nov 26 11:32:38 2016
@@ -2459,6 +2459,7 @@ update_incoming_move(svn_revnum_t *old_r
   svn_wc_conflict_version_t new_version;
   apr_int64_t repos_id;
   node_move_baton_t nmb = { 0 };
+  svn_boolean_t is_modified;
 
   SVN_ERR_ASSERT(svn_relpath_skip_ancestor(dst_relpath, local_relpath) == NULL);
 
@@ -2481,6 +2482,28 @@ update_incoming_move(svn_revnum_t *old_r
   SVN_ERR(verify_write_lock(wcroot, local_relpath, scratch_pool));
   SVN_ERR(verify_write_lock(wcroot, dst_relpath, scratch_pool));
 
+  /* Make sure there are no local modifications in the move destination. */
+  SVN_ERR(svn_wc__node_has_local_mods(&is_modified, NULL, db,
+                                      svn_dirent_join(wcroot->abspath,
+                                                      dst_relpath,
+                                                      scratch_pool),
+                                      TRUE, cancel_func, cancel_baton,
+                                      scratch_pool));
+  if (is_modified)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("Cannot merge local changes from '%s' because "
+                               "'%s' already contains other local changes "
+                               "(please commit or revert these other changes "
+                               "and try again)"),
+                             svn_dirent_local_style(
+                               svn_dirent_join(wcroot->abspath, local_relpath,
+                                               scratch_pool),
+                               scratch_pool),
+                             svn_dirent_local_style(
+                               svn_dirent_join(wcroot->abspath, dst_relpath,
+                                               scratch_pool),
+                               scratch_pool));
+
   /* Read version info from the updated incoming post-move location. */
   SVN_ERR(svn_wc__db_base_get_info_internal(NULL, &new_version.node_kind,
                                             &new_version.peg_rev,



Mime
View raw message