subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1661580 - in /subversion/trunk/subversion: libsvn_wc/crop.c libsvn_wc/externals.c libsvn_wc/update_editor.c libsvn_wc/wc_db.c libsvn_wc/wc_db.h libsvn_wc/workqueue.c tests/libsvn_wc/op-depth-test.c
Date Sun, 22 Feb 2015 23:33:17 GMT
Author: rhuijben
Date: Sun Feb 22 23:33:16 2015
New Revision: 1661580

URL: http://svn.apache.org/r1661580
Log:
In preparation for some cleanup of the working copy crop (and backing) code,
and a big number of bugfixes in svn_wc__db_base_remove() make it possible to
install a not-present node with the svn_wc__db_base_remove() function.

* subversion/libsvn_wc/crop.c
  (crop_children): Update caller.

* subversion/libsvn_wc/externals.c
  (svn_wc__external_remove): Update caller.

* subversion/libsvn_wc/update_editor.c
  (delete_entry,
   close_edit): Update caller.

* subversion/libsvn_wc/wc_db.c
  (db_base_remove): Remove support for removing locks and allow
    setting an excluded node instead of just not-present.
  (bump_node_revision): Use just one of the 20 features of
    db_base_remove, by doing the delete directly.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_base_remove): Update arguments and docs.

* subversion/libsvn_wc/workqueue.c
  (run_base_remove): Update caller.

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

Modified:
    subversion/trunk/subversion/libsvn_wc/crop.c
    subversion/trunk/subversion/libsvn_wc/externals.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/libsvn_wc/workqueue.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/crop.c?rev=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/crop.c (original)
+++ subversion/trunk/subversion/libsvn_wc/crop.c Sun Feb 22 23:33:16 2015
@@ -110,7 +110,7 @@ crop_children(svn_wc__db_t *db,
             SVN_ERR(svn_wc__db_base_remove(db, child_abspath,
                                            FALSE /* keep_as_working */,
                                            FALSE /* queue_deletes */,
-                                           FALSE /* remove_locks */,
+                                           FALSE, FALSE,
                                            SVN_INVALID_REVNUM,
                                            NULL, NULL, iterpool));
 

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Sun Feb 22 23:33:16 2015
@@ -1498,7 +1498,7 @@ svn_wc__external_remove(svn_wc_context_t
       SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
                                      FALSE /* keep_as_working */,
                                      TRUE /* queue_deletes */,
-                                     FALSE /* remove_locks */,
+                                     FALSE, FALSE,
                                      SVN_INVALID_REVNUM,
                                      NULL, NULL, scratch_pool));
       SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sun Feb 22 23:33:16 2015
@@ -1809,7 +1809,7 @@ delete_entry(const char *path,
       SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
                                      FALSE /* keep_as_working */,
                                      FALSE /* queue_deletes */,
-                                     FALSE /* remove_locks */,
+                                     FALSE, FALSE,
                                      SVN_INVALID_REVNUM /* not_present_rev */,
                                      NULL, NULL,
                                      scratch_pool));
@@ -1909,7 +1909,8 @@ delete_entry(const char *path,
     {
       /* Delete, and do not leave a not-present node.  */
       SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
-                                     keep_as_working, queue_deletes, FALSE,
+                                     keep_as_working, queue_deletes,
+                                     FALSE, FALSE,
                                      SVN_INVALID_REVNUM /* not_present_rev */,
                                      tree_conflict, NULL,
                                      scratch_pool));
@@ -1918,7 +1919,8 @@ delete_entry(const char *path,
     {
       /* Delete, leaving a not-present node.  */
       SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
-                                     keep_as_working, queue_deletes, FALSE,
+                                     keep_as_working, queue_deletes,
+                                     TRUE, FALSE,
                                      *eb->target_revision,
                                      tree_conflict, NULL,
                                      scratch_pool));
@@ -4868,7 +4870,7 @@ close_edit(void *edit_baton,
               SVN_ERR(svn_wc__db_base_remove(eb->db, eb->target_abspath,
                                              FALSE /* keep_as_working */,
                                              FALSE /* queue_deletes */,
-                                             FALSE /* remove_locks */,
+                                             FALSE, FALSE,
                                              SVN_INVALID_REVNUM,
                                              NULL, NULL, scratch_pool));
             }

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Feb 22 23:33:16 2015
@@ -2108,7 +2108,8 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
                svn_wc__db_t *db, /* For checking conflicts */
                svn_boolean_t keep_as_working,
                svn_boolean_t queue_deletes,
-               svn_boolean_t remove_locks,
+               svn_boolean_t mark_not_present,
+               svn_boolean_t mark_excluded,
                svn_revnum_t not_present_revision,
                svn_skel_t *conflict,
                svn_skel_t *work_items,
@@ -2119,26 +2120,17 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
   svn_wc__db_status_t status;
   apr_int64_t repos_id;
   const char *repos_relpath;
+  svn_revnum_t revision;
   svn_node_kind_t kind;
   svn_boolean_t keep_working;
 
-  SVN_ERR(svn_wc__db_base_get_info_internal(&status, &kind, NULL,
+  SVN_ERR(svn_wc__db_base_get_info_internal(&status, &kind, &revision,
                                             &repos_relpath, &repos_id,
                                             NULL, NULL, NULL, NULL, NULL,
                                             NULL, NULL, NULL, NULL, NULL,
                                             wcroot, local_relpath,
                                             scratch_pool, scratch_pool));
 
-  if (remove_locks)
-    {
-      svn_sqlite__stmt_t *lock_stmt;
-
-      SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb,
-                                        STMT_DELETE_LOCK_RECURSIVELY));
-      SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath));
-      SVN_ERR(svn_sqlite__step_done(lock_stmt));
-    }
-
   if (status == svn_wc__db_status_normal
       && keep_as_working)
     {
@@ -2335,13 +2327,14 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
-  if (SVN_IS_VALID_REVNUM(not_present_revision))
+  if (mark_not_present || mark_excluded)
     {
       struct insert_base_baton_t ibb;
       blank_ibb(&ibb);
 
       ibb.repos_id = repos_id;
-      ibb.status = svn_wc__db_status_not_present;
+      ibb.status = mark_excluded ? svn_wc__db_status_excluded
+                                 : svn_wc__db_status_not_present;
       ibb.kind = kind;
       ibb.repos_relpath = repos_relpath;
       ibb.revision = not_present_revision;
@@ -2369,7 +2362,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t keep_as_working,
                        svn_boolean_t queue_deletes,
-                       svn_boolean_t remove_locks,
+                       svn_boolean_t mark_not_present,
+                       svn_boolean_t mark_excluded,
                        svn_revnum_t not_present_revision,
                        svn_skel_t *conflict,
                        svn_skel_t *work_items,
@@ -2386,7 +2380,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
 
   SVN_WC__DB_WITH_TXN(db_base_remove(wcroot, local_relpath,
                                      db, keep_as_working, queue_deletes,
-                                     remove_locks, not_present_revision,
+                                     mark_not_present, mark_excluded,
+                                     not_present_revision,
                                      conflict, work_items, scratch_pool),
                       wcroot);
 
@@ -12109,11 +12104,11 @@ bump_node_revision(svn_wc__db_wcroot_t *
           || (child_info->status == svn_wc__db_status_server_excluded &&
               child_info->revnum != new_rev))
         {
-          SVN_ERR(db_base_remove(wcroot,
-                                 child_local_relpath,
-                                 db, FALSE, FALSE, FALSE,
-                                 SVN_INVALID_REVNUM,
-                                 NULL, NULL, scratch_pool));
+          svn_sqlite__stmt_t *stmt;
+          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_DELETE_BASE_NODE));
+          SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+          SVN_ERR(svn_sqlite__step_done(stmt));
           continue;
         }
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Sun Feb 22 23:33:16 2015
@@ -702,12 +702,11 @@ svn_wc__db_base_add_not_present_node(svn
    (With KEEP_AS_WORKING TRUE, this is a no-op, as everything is
     automatically shadowed by the created copy)
 
-   If REMOVE_LOCKS is TRUE, all locks of this node and any subnodes
-   are also removed. This is to be done during commit of deleted nodes.
 
-   If NOT_PRESENT_REVISION specifies a valid revision a not-present
-   node is installed in BASE node with kind NOT_PRESENT_KIND after
-   deleting.
+   If MARK_NOT_PRESENT or MARK_EXCLUDED is TRUE, install a marker
+   of the specified type at the root of the now removed tree, with
+   either the specified revision (or in case of SVN_INVALID_REVNUM)
+   the original revision.
 
    If CONFLICT and/or WORK_ITEMS are passed they are installed as part
    of the operation, after the work items inserted by the operation
@@ -718,7 +717,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t keep_as_working,
                        svn_boolean_t queue_deletes,
-                       svn_boolean_t remove_locks,
+                       svn_boolean_t mark_not_present,
+                       svn_boolean_t mark_excluded,
                        svn_revnum_t not_present_revision,
                        svn_skel_t *conflict,
                        svn_skel_t *work_items,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Sun Feb 22 23:33:16 2015
@@ -144,7 +144,7 @@ run_base_remove(work_item_baton_t *wqb,
   SVN_ERR(svn_wc__db_base_remove(db, local_abspath,
                                  FALSE /* keep_as_working */,
                                  TRUE /* queue_deletes */,
-                                 FALSE /* remove_locks */,
+                                 SVN_IS_VALID_REVNUM(not_present_rev), FALSE,
                                  not_present_rev,
                                  NULL, NULL, scratch_pool));
 

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=1661580&r1=1661579&r2=1661580&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Sun Feb 22 23:33:16 2015
@@ -1319,7 +1319,7 @@ base_dir_insert_remove(svn_test__sandbox
   SVN_ERR(svn_wc__db_base_remove(b->wc_ctx->db, dir_abspath,
                                  FALSE /* keep_as_Working */,
                                  FALSE /* queue_deletes */,
-                                 FALSE /* remove_locks */,
+                                 FALSE, FALSE,
                                  SVN_INVALID_REVNUM,
                                  NULL, NULL, b->pool));
   SVN_ERR(svn_wc__wq_run(b->wc_ctx->db, dir_abspath,
@@ -11508,7 +11508,7 @@ make_copy_and_delete_mixed(const svn_tes
   }
 
   SVN_ERR(svn_wc__db_base_remove(b.wc_ctx->db, sbox_wc_path(&b, "A"),
-                                 TRUE, FALSE, FALSE, 99,
+                                 TRUE, FALSE, TRUE, FALSE, 99,
                                  NULL, NULL, pool));
 
   {



Mime
View raw message