subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1152016 [3/5] - in /subversion/branches/revprop-packing: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ notes/ subversion/bindings/swig/ subversion/bindings/swig/perl/native/t/ subversion/include/ subversion/include/priv...
Date Thu, 28 Jul 2011 21:59:01 GMT
Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/copy.c Thu Jul 28 21:58:49 2011
@@ -312,14 +312,9 @@ copy_versioned_file(svn_wc__db_t *db,
 
   /* Copy the (single) node's metadata, and move the new filesystem node
      into place. */
-  if (is_move)
-    SVN_ERR(svn_wc__db_op_move(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
-  else
-    SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
+  SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
+                             dst_op_root_abspath, is_move, work_items,
+                             scratch_pool));
   SVN_ERR(svn_wc__wq_run(db, dir_abspath,
                          cancel_func, cancel_baton, scratch_pool));
 
@@ -383,14 +378,9 @@ copy_versioned_dir(svn_wc__db_t *db,
 
   /* Copy the (single) node's metadata, and move the new filesystem node
      into place. */
-  if (is_move)
-    SVN_ERR(svn_wc__db_op_move(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
-  else
-    SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
+  SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
+                             dst_op_root_abspath, is_move, work_items,
+                             scratch_pool));
   SVN_ERR(svn_wc__wq_run(db, dir_abspath,
                          cancel_func, cancel_baton, scratch_pool));
 
@@ -499,14 +489,9 @@ copy_versioned_dir(svn_wc__db_t *db,
         {
           /* This will be copied as some kind of deletion. Don't touch
              any actual files */
-          if (is_move)
-            SVN_ERR(svn_wc__db_op_move(db, child_src_abspath,
-                                       child_dst_abspath, dst_op_root_abspath,
-                                       NULL, scratch_pool));
-          else
-            SVN_ERR(svn_wc__db_op_copy(db, child_src_abspath,
-                                       child_dst_abspath, dst_op_root_abspath,
-                                       NULL, iterpool));
+          SVN_ERR(svn_wc__db_op_copy(db, child_src_abspath,
+                                     child_dst_abspath, dst_op_root_abspath,
+                                     is_move, NULL, iterpool));
 
           /* Don't recurse on children while all we do is creating not-present
              children */
@@ -657,7 +642,7 @@ copy_or_move(svn_wc_context_t *wc_ctx,
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
                                            &src_repos_root_url,
                                            &src_repos_uuid, NULL, NULL, NULL,
-                                           NULL,
+                                           NULL, NULL, NULL,
                                            db, src_abspath,
                                            scratch_pool, scratch_pool));
         else
@@ -674,7 +659,7 @@ copy_or_move(svn_wc_context_t *wc_ctx,
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
                                            &dst_repos_root_url,
                                            &dst_repos_uuid, NULL, NULL, NULL,
-                                           NULL,
+                                           NULL, NULL, NULL,
                                            db, dstdir_abspath,
                                            scratch_pool, scratch_pool));
         else
@@ -1006,10 +991,11 @@ svn_wc_move(svn_wc_context_t *wc_ctx,
                                            scratch_pool));
   }
 
-  SVN_ERR(svn_wc_delete4(wc_ctx, src_abspath, TRUE, FALSE,
-                         cancel_func, cancel_baton,
-                         notify_func, notify_baton,
-                         scratch_pool));
+  SVN_ERR(svn_wc__delete_internal(wc_ctx, src_abspath, TRUE, FALSE,
+                                  dst_abspath,
+                                  cancel_func, cancel_baton,
+                                  notify_func, notify_baton,
+                                  scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/diff_editor.c Thu Jul 28 21:58:49 2011
@@ -569,7 +569,7 @@ file_diff(struct edit_baton *eb,
   if (status == svn_wc__db_status_added)
     SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL,
                                      &original_repos_relpath, NULL, NULL,
-                                     NULL, db, local_abspath,
+                                     NULL, NULL, NULL, db, local_abspath,
                                      scratch_pool, scratch_pool));
 
   /* A wc-wc diff of replaced files actually shows a diff against the
@@ -959,8 +959,8 @@ report_wc_file_as_added(struct edit_bato
 
   if (status == svn_wc__db_status_added)
     SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL, NULL,
-                                     NULL, NULL, NULL, db, local_abspath,
-                                     scratch_pool, scratch_pool));
+                                     NULL, NULL, NULL, NULL, NULL, db,
+                                     local_abspath, scratch_pool, scratch_pool));
 
   /* We can't show additions for files that don't exist. */
   SVN_ERR_ASSERT(status != svn_wc__db_status_deleted || eb->use_text_base);
@@ -1659,7 +1659,7 @@ close_file(void *file_baton,
 
   if (status == svn_wc__db_status_added)
     SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL, NULL,
-                                     NULL, NULL, NULL, eb->db,
+                                     NULL, NULL, NULL, NULL, NULL, eb->db,
                                      fb->local_abspath,
                                      scratch_pool, scratch_pool));
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/diff_local.c Thu Jul 28 21:58:49 2011
@@ -205,7 +205,7 @@ file_diff(struct diff_baton *eb,
   if (status == svn_wc__db_status_added)
     SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL,
                                      &original_repos_relpath, NULL, NULL,
-                                     NULL, db, local_abspath,
+                                     NULL, NULL, NULL, db, local_abspath,
                                      scratch_pool, scratch_pool));
 
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/entries.c Thu Jul 28 21:58:49 2011
@@ -285,7 +285,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
                                        &parent_repos_relpath,
                                        &entry->repos,
                                        &entry->uuid,
-                                       NULL, NULL, NULL, NULL,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
                                        db, parent_abspath,
                                        result_pool, scratch_pool));
 
@@ -615,6 +615,7 @@ read_one_entry(const svn_wc_entry_t **ne
                                            &scanned_original_relpath,
                                            NULL, NULL, /* original_root|uuid */
                                            &original_revision,
+                                           NULL, NULL,
                                            db,
                                            entry_abspath,
                                            result_pool, scratch_pool));
@@ -716,9 +717,8 @@ read_one_entry(const svn_wc_entry_t **ne
                                              NULL, NULL, NULL,
                                              &parent_repos_relpath,
                                              &parent_root_url,
-                                             NULL, NULL,
-                                             db,
-                                             parent_abspath,
+                                             NULL, NULL, NULL, NULL,
+                                             db, parent_abspath,
                                              scratch_pool,
                                              scratch_pool);
               if (err)

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/info.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/info.c Thu Jul 28 21:58:49 2011
@@ -153,7 +153,7 @@ build_info_for_node(svn_wc__info2_t **in
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
                                            &tmpinfo->repos_root_URL,
                                            &tmpinfo->repos_UUID,
-                                           NULL, NULL, NULL, NULL,
+                                           NULL, NULL, NULL, NULL, NULL, NULL,
                                            db, local_abspath,
                                            result_pool, scratch_pool));
 
@@ -214,7 +214,7 @@ build_info_for_node(svn_wc__info2_t **in
                                            &tmpinfo->repos_root_URL,
                                            &tmpinfo->repos_UUID,
                                            NULL, NULL, NULL,
-                                           &tmpinfo->rev,
+                                           &tmpinfo->rev, NULL, NULL,
                                            db, added_abspath,
                                            result_pool, scratch_pool));
 
@@ -285,8 +285,6 @@ build_info_for_node(svn_wc__info2_t **in
       tmpinfo->lock->creation_date = lock->date;
     }
 
-  /* ### Temporary hacks to keep our test suite happy: */
-
   *info = tmpinfo;
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/lock.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/lock.c Thu Jul 28 21:58:49 2011
@@ -1104,7 +1104,7 @@ child_is_disjoint(svn_boolean_t *disjoin
         SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &parent_repos_relpath,
                                          &parent_repos_root,
                                          &parent_repos_uuid,
-                                         NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL, NULL,
                                          db, parent_abspath,
                                          scratch_pool, scratch_pool));
       else

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/node.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/node.c Thu Jul 28 21:58:49 2011
@@ -193,7 +193,7 @@ svn_wc__internal_get_repos_info(const ch
       else if (wrk_del_abspath)
         SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
                                          repos_root_url, repos_uuid,
-                                         NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL, NULL,
                                          db, svn_dirent_dirname(
                                                    wrk_del_abspath,
                                                    scratch_pool),
@@ -205,7 +205,7 @@ svn_wc__internal_get_repos_info(const ch
          repository location by scanning up the tree.  */
       SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
                                        repos_root_url, repos_uuid,
-                                       NULL, NULL, NULL, NULL,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
                                        db, local_abspath,
                                        result_pool, scratch_pool));
     }
@@ -381,7 +381,7 @@ svn_wc__node_get_repos_relpath(const cha
         {
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, repos_relpath,
                                            NULL, NULL, NULL, NULL,
-                                           NULL, NULL,
+                                           NULL, NULL, NULL, NULL,
                                            wc_ctx->db, local_abspath,
                                            result_pool, scratch_pool));
         }
@@ -527,8 +527,8 @@ svn_wc__internal_get_copyfrom_info(const
       SVN_ERR(svn_wc__db_scan_addition(&status, &op_root_abspath, NULL, NULL,
                                        NULL, &original_repos_relpath,
                                        &original_root_url, NULL,
-                                       &original_revision, db, local_abspath,
-                                       result_pool, scratch_pool));
+                                       &original_revision, NULL, NULL, db,
+                                       local_abspath, result_pool, scratch_pool));
       if (status == svn_wc__db_status_copied ||
           status == svn_wc__db_status_moved_here)
         {
@@ -977,7 +977,7 @@ svn_wc__internal_get_commit_base_rev(svn
          revision (not this node's base revision). */
       SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
                                        NULL, NULL, commit_base_revision,
-                                       db, local_abspath,
+                                       NULL, NULL, db, local_abspath,
                                        scratch_pool, scratch_pool));
 
 
@@ -999,7 +999,7 @@ svn_wc__internal_get_commit_base_rev(svn
            * revision. */
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
                                            NULL, NULL,
-                                           commit_base_revision,
+                                           commit_base_revision, NULL, NULL,
                                            db,
                                            svn_dirent_dirname(work_del_abspath,
                                                               scratch_pool),
@@ -1394,8 +1394,8 @@ svn_wc__internal_get_origin(svn_boolean_
         SVN_ERR(svn_wc__db_scan_addition(&status, &op_root_abspath, NULL,
                                          NULL, NULL, &original_repos_relpath,
                                          repos_root_url,
-                                         repos_uuid,
-                                         revision, db, local_abspath,
+                                         repos_uuid, revision, NULL, NULL,
+                                         db, local_abspath,
                                          result_pool, scratch_pool));
 
         if (status == svn_wc__db_status_added)
@@ -1766,3 +1766,46 @@ svn_wc__check_for_obstructions(svn_wc_no
   return SVN_NO_ERROR;
 }
 
+
+svn_error_t *
+svn_wc__node_was_moved_here(const char **moved_from_abspath,
+                            const char **delete_op_root_abspath,
+                            svn_wc_context_t *wc_ctx,
+                            const char *local_abspath,
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
+{
+  svn_boolean_t is_added;
+
+  if (moved_from_abspath)
+    *moved_from_abspath = NULL;
+  if (delete_op_root_abspath)
+    *delete_op_root_abspath = NULL;
+
+  SVN_ERR(svn_wc__node_is_added(&is_added, wc_ctx, local_abspath,
+                                scratch_pool));
+  if (is_added && (moved_from_abspath || delete_op_root_abspath))
+    {
+      svn_wc__db_status_t status;
+      const char *db_moved_from_abspath;
+      const char *db_delete_op_root_abspath;
+
+      SVN_ERR(svn_wc__db_scan_addition(&status, NULL,
+                                       NULL, NULL, NULL, NULL, NULL,
+                                       NULL, NULL, &db_moved_from_abspath,
+                                       &db_delete_op_root_abspath,
+                                       wc_ctx->db, local_abspath,
+                                       scratch_pool, scratch_pool));
+      if (status == svn_wc__db_status_moved_here)
+        {
+          if (moved_from_abspath)
+            *moved_from_abspath = apr_pstrdup(result_pool,
+                                              db_moved_from_abspath);
+          if (delete_op_root_abspath)
+            *delete_op_root_abspath = apr_pstrdup(result_pool,
+                                                  db_delete_op_root_abspath);
+        }
+    }
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/props.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/props.c Thu Jul 28 21:58:49 2011
@@ -1929,7 +1929,7 @@ svn_wc__get_pristine_props(apr_hash_t **
          while a simple add does not.  */
       SVN_ERR(svn_wc__db_scan_addition(&status, NULL,
                                        NULL, NULL, NULL,
-                                       NULL, NULL, NULL, NULL,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
                                        db, local_abspath,
                                        scratch_pool, scratch_pool));
     }

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/status.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/status.c Thu Jul 28 21:58:49 2011
@@ -336,7 +336,7 @@ get_repos_root_url_relpath(const char **
       SVN_ERR(svn_wc__db_scan_addition(NULL, NULL,
                                        repos_relpath, repos_root_url,
                                        repos_uuid, NULL, NULL, NULL, NULL,
-                                       db, local_abspath,
+                                       NULL, NULL, db, local_abspath,
                                        result_pool, scratch_pool));
     }
   else if (info->have_base)

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/update_editor.c Thu Jul 28 21:58:49 2011
@@ -1300,8 +1300,8 @@ create_tree_conflict(svn_wc_conflict_des
       SVN_ERR(svn_wc__db_scan_addition(&added_status, NULL,
                                        &added_repos_relpath,
                                        &repos_root_url,
-                                       NULL, NULL, NULL, NULL, NULL,
-                                       eb->db, local_abspath,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
+                                       NULL, eb->db, local_abspath,
                                        result_pool, scratch_pool));
 
       /* This better really be an added status. */
@@ -2128,7 +2128,7 @@ add_directory(const char *path,
       /* Is the local add a copy? */
       if (status == svn_wc__db_status_added)
         SVN_ERR(svn_wc__db_scan_addition(&add_status, NULL, NULL, NULL, NULL,
-                                         NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL, NULL,
                                          eb->db, db->local_abspath,
                                          pool, pool));
 
@@ -2208,7 +2208,7 @@ add_directory(const char *path,
      ### to theirs with 'svn revert'. */
   if (db->shadowed && db->obstruction_found)
     {
-      SVN_ERR(svn_wc__db_op_delete(eb->db, db->local_abspath,
+      SVN_ERR(svn_wc__db_op_delete(eb->db, db->local_abspath, NULL,
                                    NULL, NULL /* notification */,
                                    eb->cancel_func, eb->cancel_baton,
                                    pool));
@@ -3155,7 +3155,7 @@ add_file(const char *path,
       /* Is the local node a copy or move */
       if (status == svn_wc__db_status_added)
         SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL, NULL,
-                                         NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL, NULL,
                                          eb->db, fb->local_abspath,
                                          scratch_pool, scratch_pool));
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc-queries.sql?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc-queries.sql Thu Jul 28 21:58:49 2011
@@ -811,8 +811,18 @@ SELECT wc_id, local_relpath, ?4 /*op_dep
        kind
 FROM nodes
 WHERE wc_id = ?1
-  AND (local_relpath = ?2
-       OR (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0'))
+  AND (local_relpath > ?2 || '/' AND local_relpath < ?2 || '0')
+  AND op_depth = ?3
+  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'absent')
+
+-- STMT_INSERT_DELETE_NODE
+INSERT INTO nodes (
+    wc_id, local_relpath, op_depth, parent_relpath, presence, kind, moved_to)
+SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, 'base-deleted',
+       kind, ?5 /* moved_to */
+FROM nodes
+WHERE wc_id = ?1
+  AND local_relpath = ?2
   AND op_depth = ?3
   AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'absent')
 
@@ -1321,6 +1331,17 @@ WHERE wc_id = ?1
   AND presence='normal'
   AND file_external IS NULL
 
+-- STMT_SELECT_MOVED_FROM_RELPATH
+SELECT local_relpath FROM nodes_current
+WHERE wc_id = ?1 AND moved_to = ?2
+
+-- STMT_UPDATE_MOVED_TO_RELPATH
+UPDATE NODES SET moved_to = ?3
+WHERE wc_id = ?1 AND local_relpath = ?2
+  AND op_depth =
+   (SELECT MAX(op_depth) FROM nodes
+    WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
+
 /* ------------------------------------------------------------------------- */
 
 /* Queries for verification. */

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c Thu Jul 28 21:58:49 2011
@@ -366,6 +366,8 @@ scan_addition(svn_wc__db_status_t *statu
               const char **original_repos_relpath,
               apr_int64_t *original_repos_id,
               svn_revnum_t *original_revision,
+              const char **moved_from_relpath,
+              const char **delete_op_root_relpath,
               svn_wc__db_wcroot_t *wcroot,
               const char *local_relpath,
               apr_pool_t *result_pool,
@@ -3343,7 +3345,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
       SVN_ERR(scan_addition(NULL, &op_root_relpath,
                             NULL, NULL, /* repos_* */
                             copyfrom_relpath, copyfrom_id, copyfrom_rev,
-                            wcroot, local_relpath,
+                            NULL, NULL, wcroot, local_relpath,
                             scratch_pool, scratch_pool));
       if (*copyfrom_relpath)
         {
@@ -3372,7 +3374,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
           SVN_ERR(scan_addition(NULL, &op_root_relpath,
                                 NULL, NULL, /* repos_* */
                                 copyfrom_relpath, copyfrom_id, copyfrom_rev,
-                                wcroot, parent_del_relpath,
+                                NULL, NULL, wcroot, parent_del_relpath,
                                 scratch_pool, scratch_pool));
           *copyfrom_relpath
             = svn_relpath_join(*copyfrom_relpath,
@@ -3422,8 +3424,8 @@ op_depth_for_copy(apr_int64_t *op_depth,
                   apr_pool_t *scratch_pool);
 
 
-/* Like svn_wc__db_op_copy()/svn_wc__db_op_move(), but with
-   WCROOT+LOCAL_RELPATH instead of DB+LOCAL_ABSPATH.  */
+/* Like svn_wc__db_op_copy(), but with WCROOT+LOCAL_RELPATH
+ * instead of DB+LOCAL_ABSPATH.  */
 static svn_error_t *
 db_op_copy(svn_wc__db_wcroot_t *src_wcroot,
            const char *src_relpath,
@@ -3655,6 +3657,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
                    const char *dst_op_root_abspath,
+                   svn_boolean_t is_move,
                    const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool)
 {
@@ -3676,7 +3679,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
   VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
 
   ocb.work_items = work_items;
-  ocb.is_move = FALSE;
+  ocb.is_move = is_move;
 
   /* Call with the sdb in src_wcroot. It might call itself again to
      also obtain a lock in dst_wcroot */
@@ -4715,43 +4718,6 @@ svn_wc__db_temp_working_set_props(svn_wc
 
 
 svn_error_t *
-svn_wc__db_op_move(svn_wc__db_t *db,
-                   const char *src_abspath,
-                   const char *dst_abspath,
-                   const char *dst_op_root_abspath,
-                   const svn_skel_t *work_items,
-                   apr_pool_t *scratch_pool)
-{
-  struct op_copy_baton ocb = {0};
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.src_wcroot,
-                                                &ocb.src_relpath, db,
-                                                src_abspath,
-                                                scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(ocb.src_wcroot);
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.dst_wcroot,
-                                                &ocb.dst_relpath,
-                                                db, dst_abspath,
-                                                scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
-
-  ocb.work_items = work_items;
-  ocb.is_move = TRUE;
-
-  /* Call with the sdb in src_wcroot. It might call itself again to
-     also obtain a lock in dst_wcroot */
-  SVN_ERR(svn_sqlite__with_lock(ocb.src_wcroot->sdb, op_copy_txn, &ocb,
-                                scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
 svn_wc__db_op_modified(svn_wc__db_t *db,
                        const char *local_abspath,
                        apr_pool_t *scratch_pool)
@@ -6051,6 +6017,7 @@ info_below_working(svn_boolean_t *have_b
 
 struct op_delete_baton_t {
   apr_int64_t delete_depth;  /* op-depth for root of delete */
+  const char *moved_to_relpath; /* NULL if delete is not part of a move */
 };
 
 static svn_error_t *
@@ -6100,6 +6067,37 @@ op_delete_txn(void *baton,
     }
   SVN_ERR(svn_sqlite__reset(stmt));
 
+  if (b->moved_to_relpath)
+    {
+      const char *moved_from_relpath;
+      const char *delete_op_root_relpath;
+
+      /* ### call scan_addition_txn() directly? */
+      if (status == svn_wc__db_status_added)
+        SVN_ERR(scan_addition(&status, NULL, NULL, NULL,
+                              NULL, NULL, NULL,
+                              &moved_from_relpath,
+                              &delete_op_root_relpath,
+                              wcroot, local_relpath,
+                              scratch_pool, scratch_pool));
+
+      if (status == svn_wc__db_status_moved_here &&
+          strcmp(moved_from_relpath, delete_op_root_relpath) == 0)
+        {
+          /* The node has already been moved and is being moved again.
+           * Update the existing moved_to path at the delete-half of
+           * the prior move. The source of a move is in the BASE tree
+           * so it remains constant if a node is moved around multiple
+           * times. */
+          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                            STMT_UPDATE_MOVED_TO_RELPATH));
+          SVN_ERR(svn_sqlite__bindf(stmt, "iss", wcroot->wc_id,
+                                    moved_from_relpath, b->moved_to_relpath));
+          SVN_ERR(svn_sqlite__step_done(stmt));
+          SVN_ERR(svn_sqlite__reset(stmt));
+        }
+    }
+
   if (op_root)
     {
       svn_boolean_t below_base;
@@ -6164,6 +6162,22 @@ op_delete_txn(void *baton,
 
   if (add_work)
     {
+      /* Delete the node at LOCAL_RELPATH, and possibly mark it as moved. */
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                 STMT_INSERT_DELETE_NODE));
+      if (b->moved_to_relpath)
+        SVN_ERR(svn_sqlite__bindf(stmt, "isiis",
+                                  wcroot->wc_id, local_relpath,
+                                  select_depth, b->delete_depth,
+                                  b->moved_to_relpath));
+      else
+        SVN_ERR(svn_sqlite__bindf(stmt, "isii",
+                                  wcroot->wc_id, local_relpath,
+                                  select_depth, b->delete_depth));
+
+      SVN_ERR(svn_sqlite__step_done(stmt));
+
+      /* Delete children, if any. */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                  STMT_INSERT_DELETE_FROM_NODE_RECURSIVE));
       SVN_ERR(svn_sqlite__bindf(stmt, "isii",
@@ -6226,6 +6240,7 @@ do_delete_notify(void *baton,
 svn_error_t *
 svn_wc__db_op_delete(svn_wc__db_t *db,
                      const char *local_abspath,
+                     const char *moved_to_abspath,
                      svn_wc_notify_func2_t notify_func,
                      void *notify_baton,
                      svn_cancel_func_t cancel_func,
@@ -6233,7 +6248,9 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
                      apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
+  svn_wc__db_wcroot_t *moved_to_wcroot;
   const char *local_relpath;
+  const char *moved_to_relpath;
   struct op_delete_baton_t odb;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -6242,8 +6259,30 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
                                                 db, local_abspath,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
+  
+  if (moved_to_abspath)
+    {
+      SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&moved_to_wcroot,
+                                                    &moved_to_relpath,
+                                                    db, moved_to_abspath,
+                                                    scratch_pool,
+                                                    scratch_pool));
+      VERIFY_USABLE_WCROOT(moved_to_wcroot);
+
+      if (wcroot->wc_id != moved_to_wcroot->wc_id)
+        return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                 _("Cannot move '%s' to '%s' because they "
+                                   "are not in the same working copy"),
+                                 svn_dirent_local_style(local_abspath,
+                                                        scratch_pool),
+                                 svn_dirent_local_style(moved_to_abspath,
+                                                        scratch_pool));
+    }
+  else
+    moved_to_relpath = NULL;
 
   odb.delete_depth = relpath_depth(local_relpath);
+  odb.moved_to_relpath = moved_to_relpath;
 
   SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_infinity,
                         scratch_pool));
@@ -7260,7 +7299,7 @@ read_url_txn(void *baton,
       if (status == svn_wc__db_status_added)
         {
           SVN_ERR(scan_addition(NULL, NULL, &repos_relpath, &repos_id, NULL,
-                                NULL, NULL, wcroot, local_relpath,
+                                NULL, NULL, NULL, NULL, wcroot, local_relpath,
                                 scratch_pool, scratch_pool));
         }
       else if (status == svn_wc__db_status_deleted)
@@ -7293,7 +7332,7 @@ read_url_txn(void *baton,
                                                              scratch_pool);
 
               SVN_ERR(scan_addition(NULL, NULL, &repos_relpath, &repos_id,
-                                    NULL, NULL, NULL,
+                                    NULL, NULL, NULL, NULL, NULL,
                                     wcroot, work_relpath,
                                     scratch_pool, scratch_pool));
 
@@ -8042,7 +8081,7 @@ svn_wc__db_global_relocate(svn_wc__db_t 
       if (status == svn_wc__db_status_added)
         {
           SVN_ERR(scan_addition(NULL, NULL, NULL, &rb.old_repos_id,
-                                NULL, NULL, NULL,
+                                NULL, NULL, NULL, NULL, NULL,
                                 wcroot, local_dir_relpath,
                                 scratch_pool, scratch_pool));
         }
@@ -8953,6 +8992,105 @@ svn_wc__db_scan_base_repos(const char **
 }
 
 
+/* A helper for scan_addition().
+ * Compute moved-from information for the node at LOCAL_RELPATH which
+ * has been determined as having been moved-here.
+ * Return an appropriate status in *STATUS (usually "moved-here").
+ * If MOVED_FROM_RELPATH is not NULL, set *MOVED_FROM_RELPATH to the
+ * path of the move-source node in *MOVED_FROM_RELPATH.
+ * If DELETE_OP_ROOT_RELPATH is not NULL, set *DELETE_OP_ROOT_RELPATH
+ * to the path of the op-root of the delete-half of the move.
+ * If moved-from information cannot be derived, set both *MOVED_FROM_RELPATH
+ * and *DELETE_OP_ROOT_RELPATH to NULL, and return a "copied" status.
+ * COPY_OPT_ROOT_RELPATH is the relpath of the op-root of the copied-half
+ * of the move. */
+static svn_error_t *
+get_moved_from_info(svn_wc__db_status_t *status,
+                    const char **moved_from_relpath,
+                    const char **delete_op_root_relpath,
+                    const char *copy_op_root_relpath,
+                    svn_wc__db_wcroot_t *wcroot,
+                    const char *local_relpath,
+                    apr_pool_t *result_pool,
+                    apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt;
+  svn_boolean_t have_row;
+
+  /* Run a query to get the moved-from path from the DB. */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_SELECT_MOVED_FROM_RELPATH));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, copy_op_root_relpath));
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+  if (!have_row)
+    {
+      /* The move was only recorded at the copy-half, possibly because
+       * the move operation was interrupted mid-way between the copy
+       * and the delete. Treat this node as a normal copy. */
+      *status = svn_wc__db_status_copied;
+      if (moved_from_relpath)
+        *moved_from_relpath = NULL;
+      if (delete_op_root_relpath)
+        *delete_op_root_relpath = NULL;
+
+      SVN_ERR(svn_sqlite__reset(stmt));
+      return SVN_NO_ERROR;
+    }
+
+  /* It's a properly recorded move. */
+  *status = svn_wc__db_status_moved_here;
+
+  if (moved_from_relpath || delete_op_root_relpath)
+    {
+      const char *db_delete_op_root_relpath;
+
+      /* The moved-from path from the DB is the relpath of
+       * the op_root of the delete-half of the move. */
+      db_delete_op_root_relpath = svn_sqlite__column_text(stmt, 0,
+                                                          result_pool);
+      if (delete_op_root_relpath)
+        *delete_op_root_relpath = db_delete_op_root_relpath;
+
+      if (moved_from_relpath)
+        {
+          if (strcmp(copy_op_root_relpath, local_relpath) == 0)
+            {
+              /* LOCAL_RELPATH is the op_root of the copied-half of the
+               * move, so the correct MOVED_FROM_ABSPATH is the op-root
+               * of the delete-half. */
+              *moved_from_relpath = db_delete_op_root_relpath;
+            }
+          else
+            {
+              const char *child_relpath;
+
+              /* LOCAL_RELPATH is a child that was copied along with the
+               * op_root of the copied-half of the move. Construct the
+               * corresponding path beneath the op_root of the delete-half. */
+
+              /* Grab the child path relative to the path of the
+               * copied-half's op_root. */
+              child_relpath = svn_relpath_skip_ancestor(copy_op_root_relpath,
+                                                        local_relpath);
+
+              SVN_ERR_ASSERT(child_relpath && strlen(child_relpath) > 0);
+
+              /* This join is valid because LOCAL_RELPATH has not been moved
+               * within the copied-half of the move yet -- else, it would
+               * be its own op_root. */
+              *moved_from_relpath = svn_relpath_join(db_delete_op_root_relpath,
+                                                     child_relpath,
+                                                     result_pool);
+            }
+        }
+    }
+
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  return SVN_NO_ERROR;
+}
+
 struct scan_addition_baton_t
 {
   svn_wc__db_status_t *status;
@@ -8962,6 +9100,8 @@ struct scan_addition_baton_t
   const char **original_repos_relpath;
   apr_int64_t *original_repos_id;
   svn_revnum_t *original_revision;
+  const char **moved_from_relpath;
+  const char **delete_op_root_relpath;
   apr_pool_t *result_pool;
 };
 
@@ -8972,7 +9112,7 @@ scan_addition_txn(void *baton,
                   apr_pool_t *scratch_pool)
 {
   struct scan_addition_baton_t *sab = baton;
-  const char *current_relpath = local_relpath;
+  const char *op_root_relpath = local_relpath;
   const char *build_relpath = "";
 
   /* Initialize most of the OUT parameters. Generally, we'll only be filling
@@ -9037,20 +9177,20 @@ scan_addition_txn(void *baton,
 
     /* Calculate the op root local path components */
     op_depth = svn_sqlite__column_int64(stmt, 0);
-    current_relpath = local_relpath;
+    op_root_relpath = local_relpath;
 
     for (i = (int)relpath_depth(local_relpath); i > op_depth; --i)
       {
         /* Calculate the path of the operation root */
         repos_prefix_path =
-          svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
+          svn_relpath_join(svn_relpath_basename(op_root_relpath, NULL),
                            repos_prefix_path,
                            scratch_pool);
-        current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
+        op_root_relpath = svn_relpath_dirname(op_root_relpath, scratch_pool);
       }
 
     if (sab->op_root_relpath)
-      *sab->op_root_relpath = apr_pstrdup(sab->result_pool, current_relpath);
+      *sab->op_root_relpath = apr_pstrdup(sab->result_pool, op_root_relpath);
 
     if (sab->original_repos_relpath
         || sab->original_repos_id
@@ -9058,13 +9198,13 @@ scan_addition_txn(void *baton,
                 && *sab->original_revision == SVN_INVALID_REVNUM)
         || sab->status)
       {
-        if (local_relpath != current_relpath)
+        if (local_relpath != op_root_relpath)
           /* requery to get the add/copy root */
           {
             SVN_ERR(svn_sqlite__reset(stmt));
 
             SVN_ERR(svn_sqlite__bindf(stmt, "is",
-                                      wcroot->wc_id, current_relpath));
+                                      wcroot->wc_id, op_root_relpath));
             SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
             if (!have_row)
@@ -9076,7 +9216,7 @@ scan_addition_txn(void *baton,
                 return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                                          _("The node '%s' was not found."),
                                          path_for_error_message(wcroot,
-                                                                current_relpath,
+                                                                op_root_relpath,
                                                                 scratch_pool));
               }
 
@@ -9085,8 +9225,6 @@ scan_addition_txn(void *baton,
               *sab->original_revision = svn_sqlite__column_revnum(stmt, 12);
           }
 
-        /* current_relpath / current_abspath
-           as well as the record in stmt contain the data of the op_root */
         if (sab->original_repos_relpath)
           *sab->original_repos_relpath = svn_sqlite__column_text(stmt, 11,
                                                             sab->result_pool);
@@ -9103,7 +9241,13 @@ scan_addition_txn(void *baton,
             if (sab->status)
               {
                 if (svn_sqlite__column_boolean(stmt, 13 /* moved_here */))
-                  *sab->status = svn_wc__db_status_moved_here;
+                  SVN_ERR(get_moved_from_info(sab->status,
+                                              sab->moved_from_relpath,
+                                              sab->delete_op_root_relpath,
+                                              op_root_relpath, wcroot,
+                                              local_relpath,
+                                              sab->result_pool,
+                                              scratch_pool));
                 else
                   *sab->status = svn_wc__db_status_copied;
               }
@@ -9122,13 +9266,13 @@ scan_addition_txn(void *baton,
 
         /* Pointing at op_depth, look at the parent */
         repos_prefix_path =
-          svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
+          svn_relpath_join(svn_relpath_basename(op_root_relpath, NULL),
                            repos_prefix_path,
                            scratch_pool);
-        current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
+        op_root_relpath = svn_relpath_dirname(op_root_relpath, scratch_pool);
 
 
-        SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
+        SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, op_root_relpath));
         SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
         if (! have_row)
@@ -9137,15 +9281,15 @@ scan_addition_txn(void *baton,
         op_depth = svn_sqlite__column_int64(stmt, 0);
 
         /* Skip to op_depth */
-        for (i = (int)relpath_depth(current_relpath); i > op_depth; i--)
+        for (i = (int)relpath_depth(op_root_relpath); i > op_depth; i--)
           {
             /* Calculate the path of the operation root */
             repos_prefix_path =
-              svn_relpath_join(svn_relpath_basename(current_relpath, NULL),
+              svn_relpath_join(svn_relpath_basename(op_root_relpath, NULL),
                                repos_prefix_path,
                                scratch_pool);
-            current_relpath =
-              svn_relpath_dirname(current_relpath, scratch_pool);
+            op_root_relpath =
+              svn_relpath_dirname(op_root_relpath, scratch_pool);
           }
       }
 
@@ -9165,7 +9309,7 @@ scan_addition_txn(void *baton,
       SVN_ERR(base_get_info(NULL, NULL, NULL, &base_relpath, sab->repos_id,
                             NULL, NULL, NULL, NULL, NULL,
                             NULL, NULL, NULL, NULL,
-                            wcroot, current_relpath,
+                            wcroot, op_root_relpath,
                             scratch_pool, scratch_pool));
 
       if (sab->repos_relpath)
@@ -9219,6 +9363,8 @@ scan_addition(svn_wc__db_status_t *statu
               const char **original_repos_relpath,
               apr_int64_t *original_repos_id,
               svn_revnum_t *original_revision,
+              const char **moved_from_relpath,
+              const char **delete_op_root_relpath,
               svn_wc__db_wcroot_t *wcroot,
               const char *local_relpath,
               apr_pool_t *result_pool,
@@ -9233,6 +9379,8 @@ scan_addition(svn_wc__db_status_t *statu
   sab.original_repos_relpath = original_repos_relpath;
   sab.original_repos_id = original_repos_id;
   sab.original_revision = original_revision;
+  sab.moved_from_relpath = moved_from_relpath;
+  sab.delete_op_root_relpath = delete_op_root_relpath;
   sab.result_pool = result_pool;
 
   return svn_error_trace(svn_wc__db_with_txn(wcroot, local_relpath,
@@ -9251,6 +9399,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
                          const char **original_root_url,
                          const char **original_uuid,
                          svn_revnum_t *original_revision,
+                         const char **moved_from_abspath,
+                         const char **delete_op_root_abspath,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          apr_pool_t *result_pool,
@@ -9265,6 +9415,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
     = (repos_root_url || repos_uuid) ? &repos_id : NULL;
   apr_int64_t *original_repos_id_p
     = (original_root_url || original_uuid) ? &original_repos_id : NULL;
+  const char *moved_from_relpath;
+  const char *delete_op_root_relpath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -9274,7 +9426,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
 
   SVN_ERR(scan_addition(status, &op_root_relpath, repos_relpath, repos_id_p,
                         original_repos_relpath, original_repos_id_p,
-                        original_revision, wcroot, local_relpath,
+                        original_revision, &moved_from_relpath,
+                        &delete_op_root_relpath, wcroot, local_relpath,
                         result_pool, scratch_pool));
 
   if (op_root_abspath)
@@ -9289,6 +9442,14 @@ svn_wc__db_scan_addition(svn_wc__db_stat
                            wcroot->sdb, original_repos_id,
                            result_pool));
 
+  if (moved_from_abspath)
+    *moved_from_abspath = svn_dirent_join(wcroot->abspath,
+                                          moved_from_relpath,
+                                          result_pool);
+  if (delete_op_root_abspath)
+    *delete_op_root_abspath = svn_dirent_join(wcroot->abspath,
+                                              delete_op_root_relpath,
+                                              result_pool);
   return SVN_NO_ERROR;
 }
 
@@ -9405,7 +9566,7 @@ scan_deletion_txn(void *baton,
                      || work_presence == svn_wc__db_status_base_deleted);
 
       have_base = !svn_sqlite__column_is_null(stmt,
-                                              0 /* BASE_NODE.presence */);
+                                              0 /* NODES_BASE.presence */);
       if (have_base)
         {
           svn_wc__db_status_t base_presence

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.h Thu Jul 28 21:58:49 2011
@@ -1209,12 +1209,17 @@ svn_wc__db_externals_gather_definitions(
  * This copy is NOT recursive. It simply establishes this one node, plus
  * incomplete nodes for the children.
  *
+ * If IS_MOVE is TRUE, mark this copy operation as the copy-half of
+ * a move. The delete-half of the move needs to be created separately
+ * with svn_wc__db_op_delete().
+ *
  * Add WORK_ITEMS to the work queue. */
 svn_error_t *
 svn_wc__db_op_copy(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
                    const char *dst_op_root_abspath,
+                   svn_boolean_t is_move,
                    const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool);
 
@@ -1227,8 +1232,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
  * properly deleted.
  *
  * Usually this operation is directly followed by a call to svn_wc__db_op_copy
- * or svn_wc__db_op_move which performs the real copy from src_abspath to
- * dst_abspath.
+ * which performs the real copy from src_abspath to dst_abspath.
  */
 svn_error_t *
 svn_wc__db_op_copy_shadowed_layer(svn_wc__db_t *db,
@@ -1409,6 +1413,9 @@ svn_wc__db_temp_working_set_props(svn_wc
 
 /* Mark LOCAL_ABSPATH, and all children, for deletion.
  *
+ * If MOVED_TO_ABSPATH is not NULL, mark the deletion of LOCAL_ABSPATH
+ * as the delete-half of a move from LOCAL_ABSPATH to MOVED_TO_ABSPATH.
+ *
  * If NOTIFY_FUNC is not NULL, then it will be called (with NOTIFY_BATON)
  * for each node deleted. While this processing occurs, if CANCEL_FUNC is
  * not NULL, then it will be called (with CANCEL_BATON) to detect cancellation
@@ -1420,6 +1427,7 @@ svn_wc__db_temp_working_set_props(svn_wc
 svn_error_t *
 svn_wc__db_op_delete(svn_wc__db_t *db,
                      const char *local_abspath,
+                     const char *moved_to_abspath,
                      /* ### flip to CANCEL, then NOTIFY. precedent.  */
                      svn_wc_notify_func2_t notify_func,
                      void *notify_baton,
@@ -1428,23 +1436,6 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
                      apr_pool_t *scratch_pool);
 
 
-/* Move the node at SRC_ABSPATH (in NODES and ACTUAL_NODE tables) to
- * DST_ABSPATH, both in DB but not necessarily in the same WC.  The parent
- * of DST_ABSPATH must be a versioned directory.
- *
- * This move is NOT recursive. It simply establishes this one node, plus
- * incomplete nodes for the children.
- *
- * Add WORK_ITEMS to the work queue. */
-svn_error_t *
-svn_wc__db_op_move(svn_wc__db_t *db,
-                   const char *src_abspath,
-                   const char *dst_abspath,
-                   const char *dst_op_root_abspath,
-                   const svn_skel_t *work_items,
-                   apr_pool_t *scratch_pool);
-
-
 /* ### mark PATH as (possibly) modified. "svn edit" ... right API here? */
 svn_error_t *
 svn_wc__db_op_modified(svn_wc__db_t *db,
@@ -2425,6 +2416,11 @@ svn_wc__db_scan_base_repos(const char **
        BASE node. And again, the REPOS_* values are implied by this node's
        position in the subtree under the ancestor unshadowed BASE node.
        ORIGINAL_* will indicate the source of the move.
+       Additionally, information about the local move source is provided.
+       If MOVED_FROM_ABSPATH is not NULL, set *MOVED_FROM_ABSPATH to the
+       absolute path of the move source node in the working copy.
+       If DELETE_OP_ROOT_ABSPATH is not NULL, set *DELETE_OP_ROOT_ABSPATH
+       to the absolute path of the op-root of the delete-half of the move.
 
    All OUT parameters may be NULL to indicate a lack of interest in
    that piece of information.
@@ -2455,6 +2451,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
                          const char **original_root_url,
                          const char **original_uuid,
                          svn_revnum_t *original_revision,
+                         const char **moved_from_abspath,
+                         const char **delete_op_root_abspath,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          apr_pool_t *result_pool,

Modified: subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_authz_svn/mod_authz_svn.c Thu Jul 28 21:58:49 2011
@@ -245,7 +245,7 @@ static char *
 get_username_to_authorize(request_rec *r, authz_svn_config_rec *conf)
 {
   char *username_to_authorize = r->user;
-  if (conf->force_username_case)
+  if (username_to_authorize && conf->force_username_case)
     {
       username_to_authorize = apr_pstrdup(r->pool, r->user);
       convert_case(username_to_authorize,

Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/repos.c Thu Jul 28 21:58:49 2011
@@ -1063,7 +1063,7 @@ prep_private(dav_resource_combined *comb
             {
               svn_error_clear(serr);
               comb->res.exists = FALSE;
-              return dav_svn__new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+              return dav_svn__new_error(pool, HTTP_NOT_FOUND, 0,
                                         "Named transaction doesn't exist.");
             }
           return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,

Modified: subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/revprop-packing/subversion/mod_dav_svn/util.c Thu Jul 28 21:58:49 2011
@@ -37,6 +37,7 @@
 
 #include "dav_svn.h"
 #include "private/svn_fspath.h"
+#include "private/svn_string_private.h"
 
 dav_error *
 dav_svn__new_error(apr_pool_t *pool,
@@ -678,7 +679,7 @@ request_body_to_string(svn_string_t **re
   content_length_str = apr_table_get(r->headers_in, "Content-Length");
   if (content_length_str)
     {
-      if (apr_strtoff(&content_length, content_length_str, &endp, 10)
+      if (svn__strtoff(&content_length, content_length_str, &endp, 10)
           || endp == content_length_str || *endp || content_length < 0)
         {
           ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Invalid Content-Length");

Modified: subversion/branches/revprop-packing/subversion/po/de.po
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/po/de.po?rev=1152016&r1=1152015&r2=1152016&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/po/de.po [UTF-8] (original)
+++ subversion/branches/revprop-packing/subversion/po/de.po [UTF-8] Thu Jul 28 21:58:49 2011
@@ -8506,7 +8506,7 @@ msgstr ""
 "     sonst REV. Ohne Angabe von PFAD2 wird der letzte Abschnitt von PFAD1\n"
 "     als lokaler Verzeichnisname verwendet. Ohne Angabe von REV werden alle\n"
 "     lokalen Ă„nderungen beibehalten. Objekte, die sich nicht unter\n"
-"     Versionskontrolle befinden, werden in diesem Fall auch nicht kopiert.\n"
+"     Versionskontrolle befinden, werden nicht kopiert.\n"
 "\n"
 "  PEGREV gibt an, in welcher Revision das Ziel zuerst gesucht wird.\n"
 



Mime
View raw message