subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r959374 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c log.c log.h wc_db.c wc_db.h workqueue.c workqueue.h
Date Wed, 30 Jun 2010 16:52:47 GMT
Author: rhuijben
Date: Wed Jun 30 16:52:47 2010
New Revision: 959374

URL: http://svn.apache.org/viewvc?rev=959374&view=rev
Log:
Handle lock removing from the post commit processing db transaction instead of
from a separate loggy wq operation.

* subversion/libsvn_wc/adm_ops.c
  (process_committed_leaf): Pass no_unlock to svn_wc__wq_add_postcommit
    instead of installing a loggy operation.

* subversion/libsvn_wc/log.c
  (SVN_WC__LOG_DELETE_LOCK): Remove define.
  (log_do_delete_lock): Remove function.
  (start_handler): Remove dispatch of delete lock.
  (svn_wc__loggy_delete_lock): Remove function.

* subversion/libsvn_wc/log.h
  (svn_wc__loggy_delete_lock): Remove function.

* subversion/libsvn_wc/wc_db.c
  (commit_baton): Add no_unlock.
  (commit_node): Remove lock if !no_unlock.
  (svn_wc__db_global_commit): Set no_unlock in baton.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_global_commit): Add no_unlock argument.

* subversion/libsvn_wc/workqueue.c
  (log_do_committed): Pass no_unlock down to commit handling.
  (run_postcommit): Parse no_unlock from skel.
  (svn_wc__wq_add_postcommit): Add no_unlock as optional argument
    to the skel.

* subversion/libsvn_wc/workqueue.h
  (svn_wc__wq_add_postcommit): Add no_unlock argument

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/log.c
    subversion/trunk/subversion/libsvn_wc/log.h
    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/libsvn_wc/workqueue.h

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed Jun 30 16:52:47 2010
@@ -229,15 +229,6 @@ process_committed_leaf(svn_wc__db_t *db,
         }
     }
 
-  if (!no_unlock)
-    {
-      svn_skel_t *work_item;
-
-      SVN_ERR(svn_wc__loggy_delete_lock(&work_item, db, adm_abspath,
-                                        local_abspath, scratch_pool));
-      SVN_ERR(svn_wc__db_wq_add(db, adm_abspath, work_item, scratch_pool));
-    }
-
 #ifdef SVN_EXPERIMENTAL_PRISTINE
   /* Set TMP_TEXT_BASE_ABSPATH to NULL.  The new text base will be found in
      the pristine store by its checksum. */
@@ -262,7 +253,7 @@ process_committed_leaf(svn_wc__db_t *db,
   SVN_ERR(svn_wc__wq_add_postcommit(db, local_abspath, tmp_text_base_abspath,
                                     new_revnum,
                                     new_date, rev_author, checksum,
-                                    new_dav_cache, keep_changelist,
+                                    new_dav_cache, keep_changelist, no_unlock,
                                     scratch_pool));
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_wc/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.c?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.c (original)
+++ subversion/trunk/subversion/libsvn_wc/log.c Wed Jun 30 16:52:47 2010
@@ -69,9 +69,6 @@
 
 /** Log actions. **/
 
-/* Delete lock related fields from the entry SVN_WC__LOG_ATTR_NAME. */
-#define SVN_WC__LOG_DELETE_LOCK         "delete-lock"
-
 /* Delete the entry SVN_WC__LOG_ATTR_NAME. */
 #define SVN_WC__LOG_DELETE_ENTRY        "delete-entry"
 #define SVN_WC__LOG_ATTR_REVISION       "revision"
@@ -241,25 +238,6 @@ log_do_file_timestamp(struct log_runner 
   return SVN_NO_ERROR;
 }
 
-/* */
-static svn_error_t *
-log_do_delete_lock(struct log_runner *loggy,
-                   const char *name)
-{
-  const char *local_abspath;
-  svn_error_t *err;
-
-  local_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
-
-  err = svn_wc__db_lock_remove(loggy->db, local_abspath, loggy->pool);
-  if (err)
-    return svn_error_createf(SVN_ERR_WC_BAD_ADM_LOG, err,
-                             _("Error removing lock from entry for '%s'"),
-                             name);
-
-  return SVN_NO_ERROR;
-}
-
 
 /* Ben sez:  this log command is (at the moment) only executed by the
    update editor.  It attempts to forcefully remove working data. */
@@ -435,10 +413,7 @@ start_handler(void *userData, const char
 #endif
 
   /* Dispatch. */
-  if (strcmp(eltname, SVN_WC__LOG_DELETE_LOCK) == 0) {
-    err = log_do_delete_lock(loggy, name);
-  }
-  else if (strcmp(eltname, SVN_WC__LOG_DELETE_ENTRY) == 0) {
+  if (strcmp(eltname, SVN_WC__LOG_DELETE_ENTRY) == 0) {
     const char *attr;
     svn_revnum_t revision;
     svn_node_kind_t kind;
@@ -637,30 +612,6 @@ svn_wc__loggy_delete_entry(svn_skel_t **
 }
 
 svn_error_t *
-svn_wc__loggy_delete_lock(svn_skel_t **work_item,
-                          svn_wc__db_t *db,
-                          const char *adm_abspath,
-                          const char *local_abspath,
-                          apr_pool_t *result_pool)
-{
-  const char *loggy_path1;
-  svn_stringbuf_t *log_accum = NULL;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  SVN_ERR(loggy_path(&loggy_path1, local_abspath, adm_abspath, result_pool));
-  svn_xml_make_open_tag(&log_accum, result_pool, svn_xml_self_closing,
-                        SVN_WC__LOG_DELETE_LOCK,
-                        SVN_WC__LOG_ATTR_NAME, loggy_path1,
-                        NULL);
-
-  return svn_error_return(svn_wc__wq_build_loggy(work_item,
-                                                 db, adm_abspath, log_accum,
-                                                 result_pool));
-}
-
-
-svn_error_t *
 svn_wc__loggy_move(svn_skel_t **work_item,
                    svn_wc__db_t *db,
                    const char *adm_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/log.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.h?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.h (original)
+++ subversion/trunk/subversion/libsvn_wc/log.h Wed Jun 30 16:52:47 2010
@@ -81,19 +81,6 @@ svn_wc__loggy_delete_entry(svn_skel_t **
                            svn_wc__db_kind_t kind,
                            apr_pool_t *result_pool);
 
-
-/* Set *WORK_ITEM to a work queue instruction to delete lock related
-   fields from the entry belonging to LOCAL_ABSPATH.
-
-   ADM_ABSPATH is described above.
-*/
-svn_error_t *
-svn_wc__loggy_delete_lock(svn_skel_t **work_item,
-                          svn_wc__db_t *db,
-                          const char *adm_abspath,
-                          const char *local_abspath,
-                          apr_pool_t *result_pool);
-
 /* Set *WORK_ITEM to a work queue instruction to move the file SRC_ABSPATH
    to DST_ABSPATH.
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jun 30 16:52:47 2010
@@ -5267,6 +5267,7 @@ struct commit_baton {
   const apr_array_header_t *new_children;
   apr_hash_t *new_dav_cache;
   svn_boolean_t keep_changelist;
+  svn_boolean_t no_unlock;
 
   apr_int64_t repos_id;
   const char *repos_relpath;
@@ -5470,6 +5471,16 @@ commit_node(void *baton, svn_sqlite__db_
       /* ### process the children  */
     }
 
+  if (!cb->no_unlock)
+    {
+      svn_sqlite__stmt_t *lock_stmt;
+
+      SVN_ERR(svn_sqlite__get_statement(&lock_stmt, sdb, STMT_DELETE_LOCK));
+      SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", cb->repos_id,
+                                cb->repos_relpath));
+      SVN_ERR(svn_sqlite__step_done(lock_stmt));
+    }
+
   /* Install any work items into the queue, as part of this transaction.  */
   SVN_ERR(add_work_items(sdb, cb->work_items, scratch_pool));
 
@@ -5556,6 +5567,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
                          const apr_array_header_t *new_children,
                          apr_hash_t *new_dav_cache,
                          svn_boolean_t keep_changelist,
+                         svn_boolean_t no_unlock,
                          const svn_skel_t *work_items,
                          apr_pool_t *scratch_pool)
 {
@@ -5582,6 +5594,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
   cb.new_children = new_children;
   cb.new_dav_cache = new_dav_cache;
   cb.keep_changelist = keep_changelist;
+  cb.no_unlock = no_unlock;
   cb.work_items = work_items;
 
   /* If we are adding a directory (no BASE_NODE), then we need to get

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed Jun 30 16:52:47 2010
@@ -1731,6 +1731,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
                          const apr_array_header_t *new_children,
                          apr_hash_t *new_dav_cache,
                          svn_boolean_t keep_changelist,
+                         svn_boolean_t no_unlock,
                          const svn_skel_t *work_items,
                          apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Wed Jun 30 16:52:47 2010
@@ -1197,6 +1197,7 @@ log_do_committed(svn_wc__db_t *db,
                  const svn_checksum_t *new_checksum,
                  apr_hash_t *new_dav_cache,
                  svn_boolean_t keep_changelist,
+                 svn_boolean_t no_unlock,
                  svn_cancel_func_t cancel_func,
                  void *cancel_baton,
                  apr_pool_t *scratch_pool)
@@ -1355,6 +1356,7 @@ log_do_committed(svn_wc__db_t *db,
                                        NULL /* new_children */,
                                        new_dav_cache,
                                        keep_changelist,
+                                       no_unlock,
                                        NULL /* work_items */,
                                        pool));
 
@@ -1438,6 +1440,7 @@ log_do_committed(svn_wc__db_t *db,
                                    NULL /* new_children */,
                                    new_dav_cache,
                                    keep_changelist,
+                                   no_unlock,
                                    NULL /* work_items */,
                                    pool));
 
@@ -1481,7 +1484,7 @@ run_postcommit(svn_wc__db_t *db,
   const char *new_author;
   const svn_checksum_t *new_checksum;
   apr_hash_t *new_dav_cache;
-  svn_boolean_t keep_changelist;
+  svn_boolean_t keep_changelist, no_unlock;
   const char *tmp_text_base_abspath;
   svn_error_t *err;
 
@@ -1521,10 +1524,16 @@ run_postcommit(svn_wc__db_t *db,
                                            arg5->next->next->next->data,
                                            arg5->next->next->next->len);
 
+  if (arg5->next->next->next->next)
+    no_unlock = svn_skel__parse_int(arg5->next->next->next->next,
+                                     scratch_pool) != 0;
+  else
+    no_unlock = TRUE;
+
   err = log_do_committed(db, local_abspath, tmp_text_base_abspath,
                          new_revision, new_date,
                          new_author, new_checksum, new_dav_cache,
-                         keep_changelist,
+                         keep_changelist, no_unlock,
                          cancel_func, cancel_baton,
                          scratch_pool);
   if (err)
@@ -1547,10 +1556,12 @@ svn_wc__wq_add_postcommit(svn_wc__db_t *
                           const svn_checksum_t *new_checksum,
                           apr_hash_t *new_dav_cache,
                           svn_boolean_t keep_changelist,
+                          svn_boolean_t no_unlock,
                           apr_pool_t *scratch_pool)
 {
   svn_skel_t *work_item = svn_skel__make_empty_list(scratch_pool);
 
+  svn_skel__prepend_int(no_unlock, work_item, scratch_pool);
   svn_skel__prepend_str(tmp_text_base_abspath ? tmp_text_base_abspath : "",
                         work_item, scratch_pool);
   svn_skel__prepend_int(keep_changelist, work_item, scratch_pool);

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.h?rev=959374&r1=959373&r2=959374&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.h Wed Jun 30 16:52:47 2010
@@ -286,6 +286,7 @@ svn_wc__wq_add_postcommit(svn_wc__db_t *
                           const svn_checksum_t *new_checksum,
                           apr_hash_t *new_dav_cache,
                           svn_boolean_t keep_changelist,
+                          svn_boolean_t no_unlock,
                           apr_pool_t *scratch_pool);
 
 



Mime
View raw message