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 2013/01/10 15:04:05 UTC

svn commit: r1431368 - in /subversion/trunk/subversion: libsvn_client/merge.c libsvn_wc/copy.c

Author: rhuijben
Date: Thu Jan 10 14:04:04 2013
New Revision: 1431368

URL: http://svn.apache.org/viewvc?rev=1431368&view=rev
Log:
Following up on r1431352, apply some simplifications in the copy code.

Perform the mixed revision test for moving trees with tracking once per move
instead of once for every directory moved.

* subversion/libsvn_client/merge.c
  (ensure_wc_is_suitable_merge_target): Use proper format for svn_revnum_t.

* subversion/libsvn_wc/copy.c
  (copy_versioned_file): Remove unused argument.
  (copy_versioned_dir): Move the mixed revision copy test to the caller, and
    remove now unused arguments. Update caller.
  (copy_or_move): Remove unneeded checksum handling. Perform the mixed revision
    test here. Use proper format for svn_revnum_t. Update caller.

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_wc/copy.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1431368&r1=1431367&r2=1431368&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Thu Jan 10 14:04:04 2013
@@ -9602,7 +9602,7 @@ ensure_wc_is_suitable_merge_target(const
       if (min_rev != max_rev)
         return svn_error_createf(SVN_ERR_CLIENT_MERGE_UPDATE_REQUIRED, NULL,
                                  _("Cannot merge into mixed-revision working "
-                                   "copy [%lu:%lu]; try updating first"),
+                                   "copy [%ld:%ld]; try updating first"),
                                    min_rev, max_rev);
     }
 

Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=1431368&r1=1431367&r2=1431368&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Thu Jan 10 14:04:04 2013
@@ -166,9 +166,6 @@ copy_to_tmpdir(svn_skel_t **work_item,
    If IS_MOVE is true, record move information in working copy meta
    data in addition to copying the file.
 
-   If COPY_PRISTINE_FILE is true, make sure the necessary pristine files are
-   available in the destination working copy.
-
    If the versioned file has a text conflict, and the .mine file exists in
    the filesystem, copy the .mine file to DST_ABSPATH.  Otherwise, copy the
    versioned file itself.
@@ -181,7 +178,6 @@ copy_versioned_file(svn_wc__db_t *db,
                     const char *dst_abspath,
                     const char *dst_op_root_abspath,
                     const char *tmpdir_abspath,
-                    svn_boolean_t copy_pristine_file,
                     svn_boolean_t metadata_only,
                     svn_boolean_t conflicted,
                     svn_boolean_t is_move,
@@ -282,9 +278,7 @@ copy_versioned_file(svn_wc__db_t *db,
    otherwise copy both the versioned metadata and the filesystem nodes (even
    if they are the wrong kind, and including unversioned children).
    If IS_MOVE is true, record move information in working copy meta
-   data in addition to copying the directory. If IS_MOVE is TRUE and
-   ALLOW_MIXED_REVISIONS is FALSE, raise an error if a move of a
-   mixed-revision subtree is attempted.
+   data in addition to copying the directory.
 
    WITHIN_ONE_WC is TRUE if the copy/move is within a single working copy (root)
  */
@@ -296,8 +290,6 @@ copy_versioned_dir(svn_wc__db_t *db,
                    const char *tmpdir_abspath,
                    svn_boolean_t metadata_only,
                    svn_boolean_t is_move,
-                   svn_boolean_t allow_mixed_revisions,
-                   svn_boolean_t within_one_wc,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    svn_wc_notify_func2_t notify_func,
@@ -313,24 +305,6 @@ copy_versioned_dir(svn_wc__db_t *db,
   svn_node_kind_t disk_kind;
   apr_pool_t *iterpool;
 
-  if (is_move && !allow_mixed_revisions)
-    {
-      svn_revnum_t min_rev;
-      svn_revnum_t max_rev;
-
-      /* Verify that the move source is a single-revision subtree. */
-      SVN_ERR(svn_wc__db_min_max_revisions(&min_rev, &max_rev, db,
-                                           src_abspath, FALSE, scratch_pool));
-      if (SVN_IS_VALID_REVNUM(min_rev) && SVN_IS_VALID_REVNUM(max_rev) &&
-          min_rev != max_rev)
-        return svn_error_createf(SVN_ERR_WC_MIXED_REVISIONS, NULL,
-                                 _("Cannot move mixed-revision subtree '%s' "
-                                   "[%lu:%lu]; try updating it first"),
-                                   svn_dirent_local_style(src_abspath,
-                                                          scratch_pool),
-                                   min_rev, max_rev);
-    }
-
   /* Prepare a temp copy of the single filesystem node (usually a dir). */
   if (!metadata_only)
     {
@@ -417,7 +391,6 @@ copy_versioned_dir(svn_wc__db_t *db,
                                             child_dst_abspath,
                                             dst_op_root_abspath,
                                             tmpdir_abspath,
-                                            !within_one_wc && info->has_checksum,
                                             metadata_only, info->conflicted,
                                             is_move,
                                             cancel_func, cancel_baton,
@@ -429,7 +402,6 @@ copy_versioned_dir(svn_wc__db_t *db,
                                        child_src_abspath, child_dst_abspath,
                                        dst_op_root_abspath, tmpdir_abspath,
                                        metadata_only, is_move,
-                                       allow_mixed_revisions, within_one_wc,
                                        cancel_func, cancel_baton, NULL, NULL,
                                        iterpool));
           else
@@ -555,7 +527,6 @@ copy_or_move(svn_boolean_t *move_degrade
   svn_kind_t src_db_kind;
   const char *dstdir_abspath;
   svn_boolean_t conflicted;
-  const svn_checksum_t *checksum;
   const char *tmpdir_abspath;
   const char *src_wcroot_abspath;
   const char *dst_wcroot_abspath;
@@ -576,7 +547,7 @@ copy_or_move(svn_boolean_t *move_degrade
 
     err = svn_wc__db_read_info(&src_status, &src_db_kind, NULL, NULL,
                                &src_repos_root_url, &src_repos_uuid, NULL,
-                               NULL, NULL, NULL, &checksum, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, &conflicted,
                                NULL, NULL, NULL, NULL, NULL, NULL,
                                db, src_abspath, scratch_pool, scratch_pool);
@@ -776,7 +747,6 @@ copy_or_move(svn_boolean_t *move_degrade
     {
       err = copy_versioned_file(db, src_abspath, dst_abspath, dst_abspath,
                                 tmpdir_abspath,
-                                !within_one_wc && (checksum != NULL),
                                 metadata_only, conflicted, is_move,
                                 cancel_func, cancel_baton,
                                 notify_func, notify_baton,
@@ -784,9 +754,26 @@ copy_or_move(svn_boolean_t *move_degrade
     }
   else
     {
+      if (is_move && !allow_mixed_revisions)
+        {
+          svn_revnum_t min_rev;
+          svn_revnum_t max_rev;
+        
+          /* Verify that the move source is a single-revision subtree. */
+          SVN_ERR(svn_wc__db_min_max_revisions(&min_rev, &max_rev, db,
+                                               src_abspath, FALSE, scratch_pool));
+          if (SVN_IS_VALID_REVNUM(min_rev) && SVN_IS_VALID_REVNUM(max_rev) &&
+              min_rev != max_rev)
+            return svn_error_createf(SVN_ERR_WC_MIXED_REVISIONS, NULL,
+                                     _("Cannot move mixed-revision subtree '%s' "
+                                       "[%ld:%ld]; try updating it first"),
+                                       svn_dirent_local_style(src_abspath,
+                                                              scratch_pool),
+                                       min_rev, max_rev);
+        }
+
       err = copy_versioned_dir(db, src_abspath, dst_abspath, dst_abspath,
                                tmpdir_abspath, metadata_only, is_move,
-                               allow_mixed_revisions, within_one_wc,
                                cancel_func, cancel_baton,
                                notify_func, notify_baton,
                                scratch_pool);