subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1407021 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/op-depth-test.c
Date Thu, 08 Nov 2012 11:43:48 GMT
Author: rhuijben
Date: Thu Nov  8 11:43:48 2012
New Revision: 1407021

URL: http://svn.apache.org/viewvc?rev=1407021&view=rev
Log:
Turn svn_wc__db_temp_op_make_copy() in a proper db operation, by renaming
and adding conflicts and work_items arguments. This in preparation for adding
another caller in my next patch and possibly another one later on.

* subversion/libsvn_wc/wc_db.c
  (db_base_remove): Update caller. Remove comment.
  (make_copy_baton_t): Add 2 variables.
  (make_copy_txn): Handle conflicts and work items. Move struct out of loop.
  (svn_wc__db_temp_op_make_copy): Rename to ...
  (svn_wc__db_op_make_copy): ... this, add arguments and fill struct.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_temp_op_make_copy): Rename to ...
  (svn_wc__db_op_make_copy): ... this and add arguments.

* subversion/tests/libsvn_wc/op-depth-test.c
  (temp_op_make_copy): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1407021&r1=1407020&r2=1407021&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Nov  8 11:43:48 2012
@@ -2074,16 +2074,15 @@ db_base_remove(void *baton,
                                             wcroot, local_relpath,
                                             scratch_pool, scratch_pool));
 
-  /* ### This function should be turned into a helper of this function,
-         as this is the only valid caller */
   if (status == svn_wc__db_status_normal
       && rb->keep_as_working)
     {
-      SVN_ERR(svn_wc__db_temp_op_make_copy(rb->db,
-                                           svn_dirent_join(wcroot->abspath,
-                                                           local_relpath,
-                                                           scratch_pool),
-                                           scratch_pool));
+      SVN_ERR(svn_wc__db_op_make_copy(rb->db,
+                                      svn_dirent_join(wcroot->abspath,
+                                                      local_relpath,
+                                                      scratch_pool),
+                                      NULL, NULL,
+                                      scratch_pool));
       keep_working = TRUE;
     }
   else
@@ -13085,6 +13084,8 @@ svn_wc__db_temp_op_start_directory_updat
 struct make_copy_baton_t
 {
   int op_depth;
+  const svn_skel_t *conflicts;
+  const svn_skel_t *work_items;
 };
 
 
@@ -13133,6 +13134,7 @@ make_copy_txn(void *baton,
   svn_boolean_t add_working_base_deleted = FALSE;
   svn_boolean_t remove_working = FALSE;
   const apr_array_header_t *children;
+  struct make_copy_baton_t cbt;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   int i;
 
@@ -13197,18 +13199,20 @@ make_copy_txn(void *baton,
   SVN_ERR(gather_repo_children(&children, wcroot, local_relpath,
                                0, scratch_pool, iterpool));
 
+  cbt.op_depth = mcb->op_depth;
+  cbt.conflicts = NULL;
+  cbt.work_items = NULL;
+
   for (i = 0; i < children->nelts; i++)
     {
       const char *name = APR_ARRAY_IDX(children, i, const char *);
-      struct make_copy_baton_t cbt;
+      
       const char *copy_relpath;
 
       svn_pool_clear(iterpool);
 
       copy_relpath = svn_relpath_join(local_relpath, name, iterpool);
 
-      cbt.op_depth = mcb->op_depth;
-
       SVN_ERR(make_copy_txn(&cbt, wcroot, copy_relpath, iterpool));
     }
 
@@ -13216,6 +13220,11 @@ make_copy_txn(void *baton,
                                                 iterpool),
                                                 svn_depth_empty, iterpool));
 
+  if (mcb->conflicts)
+    SVN_ERR(mark_conflict(wcroot, local_relpath, mcb->conflicts, iterpool));
+
+  SVN_ERR(add_work_items(wcroot->sdb, mcb->work_items, iterpool));
+
   svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
@@ -13223,9 +13232,11 @@ make_copy_txn(void *baton,
 
 
 svn_error_t *
-svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
-                             const char *local_abspath,
-                             apr_pool_t *scratch_pool)
+svn_wc__db_op_make_copy(svn_wc__db_t *db,
+                        const char *local_abspath,
+                        const svn_skel_t *conflicts,
+                        const svn_skel_t *work_items,
+                        apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
@@ -13258,6 +13269,8 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_
   SVN_ERR(catch_copy_of_server_excluded(wcroot, local_relpath, scratch_pool));
 
   mcb.op_depth = relpath_depth(local_relpath);
+  mcb.conflicts = conflicts;
+  mcb.work_items = work_items;
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, make_copy_txn, &mcb,
                               scratch_pool));

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1407021&r1=1407020&r2=1407021&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu Nov  8 11:43:48 2012
@@ -3027,9 +3027,11 @@ svn_wc__db_temp_op_end_directory_update(
    leaving any subtree additions and copies as-is.  This allows the
    base node tree to be removed. */
 svn_error_t *
-svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
-                             const char *local_abspath,
-                             apr_pool_t *scratch_pool);
+svn_wc__db_op_make_copy(svn_wc__db_t *db,
+                        const char *local_abspath,
+                        const svn_skel_t *conflicts,
+                        const svn_skel_t *work_items,
+                        apr_pool_t *scratch_pool);
 
 /* Close the wc root LOCAL_ABSPATH and remove any per-directory
    handles associated with it. */

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1407021&r1=1407020&r2=1407021&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu Nov  8 11:43:48 2012
@@ -1628,7 +1628,7 @@ temp_op_make_copy(svn_test__sandbox_t *b
 
   SVN_ERR(insert_dirs(b, before));
 
-  SVN_ERR(svn_wc__db_temp_op_make_copy(b->wc_ctx->db, dir_abspath, b->pool));
+  SVN_ERR(svn_wc__db_op_make_copy(b->wc_ctx->db, dir_abspath, NULL, NULL, b->pool));
 
   SVN_ERR(check_db_rows(b, "", after));
 



Mime
View raw message