You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/02/18 13:17:42 UTC

svn commit: r911361 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c props.c props.h workqueue.c workqueue.h

Author: hwright
Date: Thu Feb 18 12:17:42 2010
New Revision: 911361

URL: http://svn.apache.org/viewvc?rev=911361&view=rev
Log:
Move the "remove revert files" process into a workqueue item, and remove
associated cruft.  This will probably get folded into the eventual
"post commit" workqueue item.

* subversion/libsvn_wc/props.c
  (svn_wc__loggy_props_delete): Remove.

* subversion/libsvn_wc/props.h
  (svn_wc__loggy_props_delete): Remove.

* subversion/libsvn_wc/adm_ops.c
  (remove_revert_files): Remove.
  (process_committed_leaf): Insert a workqueue item directly.

* subversion/libsvn_wc/workqueue.c
  (OP_REMOVE_REVERT_FILES, run_remove_revert_files,
   svn_wc__wq_remove_revert_files): New.
  (dispatch_table): Add the new action.

* subversion/libsvn_wc/workqueue.h
  (svn_wc__wq_remove_revert_files): New.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.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=911361&r1=911360&r2=911361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu Feb 18 12:17:42 2010
@@ -237,34 +237,6 @@
   return SVN_NO_ERROR;
 }
 
-
-static svn_error_t *
-remove_revert_files(svn_wc__db_t *db,
-                    const char *adm_abspath,
-                    const char *local_abspath,
-                    apr_pool_t *pool)
-{
-  svn_stringbuf_t *log_accum = svn_stringbuf_create("", pool);
-  const char *revert_file;
-  svn_node_kind_t kind;
-
-  SVN_ERR(svn_wc__text_revert_path(&revert_file, db, local_abspath, pool));
-
-  SVN_ERR(svn_io_check_path(revert_file, &kind, pool));
-  if (kind == svn_node_file)
-    SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_abspath,
-                                 revert_file, pool, pool));
-  SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, pool);
-
-  SVN_ERR(svn_wc__loggy_props_delete(&log_accum, db, local_abspath,
-                                     adm_abspath,
-                                     svn_wc__props_revert, pool));
-
-  SVN_ERR(svn_wc__wq_add_loggy(db, adm_abspath, log_accum, pool));
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_wc__do_update_cleanup(svn_wc__db_t *db,
                           const char *local_abspath,
@@ -409,8 +381,7 @@
       /* If the props or text revert file exists it needs to be deleted when
        * the file is committed. */
       /* ### don't directories have revert props? */
-      SVN_ERR(remove_revert_files(db, adm_abspath, local_abspath,
-                                  scratch_pool));
+      SVN_ERR(svn_wc__wq_remove_revert_files(db, local_abspath, scratch_pool));
 
       if (checksum == NULL)
         {

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=911361&r1=911360&r2=911361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Thu Feb 18 12:17:42 2010
@@ -88,7 +88,6 @@
        sync'ing to disk and clearing appropriate caches.
      install_props_file(): Used with loggy.
      svn_wc__install_props(): Used with loggy.
-     svn_wc__loggy_props_delete(): Used with loggy.
      svn_wc__loggy_revert_props_create(): Used with loggy.
      svn_wc__loggy_revert_props_restore(): Used with loggy.
  */
@@ -572,25 +571,6 @@
 
 
 svn_error_t *
-svn_wc__loggy_props_delete(svn_stringbuf_t **log_accum,
-                           svn_wc__db_t *db,
-                           const char *local_abspath,
-                           const char *adm_abspath,
-                           svn_wc__props_kind_t props_kind,
-                           apr_pool_t *pool)
-{
-  svn_wc__db_kind_t kind;
-  const char *props_file;
-
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, pool));
-  SVN_ERR(svn_wc__prop_path(&props_file, local_abspath, kind, props_kind,
-                            pool));
-  return svn_error_return(
-    svn_wc__loggy_remove(log_accum, adm_abspath, props_file, pool, pool));
-}
-
-
-svn_error_t *
 svn_wc__props_delete(svn_wc__db_t *db,
                      const char *local_abspath,
                      svn_wc__props_kind_t props_kind,

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=911361&r1=911360&r2=911361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Thu Feb 18 12:17:42 2010
@@ -187,15 +187,6 @@
                                    const char *adm_abspath,
                                    apr_pool_t *pool);
 
-/* Extends LOG_ACCUM to delete PROPS_KIND props installed for PATH. */
-svn_error_t *
-svn_wc__loggy_props_delete(svn_stringbuf_t **log_accum,
-                           svn_wc__db_t *db,
-                           const char *local_abspath,
-                           const char *adm_abspath,
-                           svn_wc__props_kind_t props_kind,
-                           apr_pool_t *pool);
-
 /* Delete PROPS_KIND props for LOCAL_ABSPATH */
 svn_error_t *
 svn_wc__props_delete(svn_wc__db_t *db,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=911361&r1=911360&r2=911361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Thu Feb 18 12:17:42 2010
@@ -50,6 +50,7 @@
 /* Workqueue operation names.  */
 #define OP_REVERT "revert"
 #define OP_PREPARE_REVERT_FILES "prep-rev-files"
+#define OP_REMOVE_REVERT_FILES "remove-rev-files"
 #define OP_KILLME "killme"
 #define OP_LOGGY "loggy"
 #define OP_DELETION_POSTCOMMIT "deletion-postcommit"
@@ -700,6 +701,57 @@
 
 /* ------------------------------------------------------------------------ */
 
+/* OP_REMOVE_REVERT_FILES  */
+
+
+static svn_error_t *
+run_remove_revert_files(svn_wc__db_t *db,
+                        const svn_skel_t *work_item,
+                        svn_cancel_func_t cancel_func,
+                        void *cancel_baton,
+                        apr_pool_t *scratch_pool)
+{
+  const svn_skel_t *arg1 = work_item->children->next;
+  const char *local_abspath;
+  const char *revert_file;
+  svn_node_kind_t kind;
+  
+  /* We need a NUL-terminated path, so copy it out of the skel.  */
+  local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+
+  SVN_ERR(svn_wc__text_revert_path(&revert_file, db, local_abspath,
+                                   scratch_pool));
+
+  SVN_ERR(svn_io_check_path(revert_file, &kind, scratch_pool));
+  if (kind == svn_node_file)
+    SVN_ERR(svn_io_remove_file2(revert_file, FALSE, scratch_pool));
+
+  SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_revert,
+                               scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__wq_remove_revert_files(svn_wc__db_t *db,
+                               const char *local_abspath,
+                               apr_pool_t *scratch_pool)
+{
+  svn_skel_t *work_item = svn_skel__make_empty_list(scratch_pool);
+
+  /* These skel atoms hold references to very transitory state, but
+     we only need the work_item to survive for the duration of wq_add.  */
+  svn_skel__prepend_str(local_abspath, work_item, scratch_pool);
+  svn_skel__prepend_str(OP_REMOVE_REVERT_FILES, work_item, scratch_pool);
+
+  SVN_ERR(svn_wc__db_wq_add(db, local_abspath, work_item, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
 /* OP_KILLME  */
 
 static svn_error_t *
@@ -1777,6 +1829,7 @@
 static const struct work_item_dispatch dispatch_table[] = {
   { OP_REVERT, run_revert },
   { OP_PREPARE_REVERT_FILES, run_prepare_revert_files },
+  { OP_REMOVE_REVERT_FILES, run_remove_revert_files },
   { OP_KILLME, run_killme },
   { OP_LOGGY, run_loggy },
   { OP_DELETION_POSTCOMMIT, run_deletion_postcommit },

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.h?rev=911361&r1=911360&r2=911361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.h Thu Feb 18 12:17:42 2010
@@ -62,6 +62,13 @@
                                 const char *local_abspath,
                                 apr_pool_t *scratch_pool);
 
+/* Record a work item to remove the "revert props" and "revert text base"
+   for LOCAL_ABSPATH.  */
+svn_error_t *
+svn_wc__wq_remove_revert_files(svn_wc__db_t *db,
+                               const char *local_abspath,
+                               apr_pool_t *scratch_pool);
+
 
 /* Handle the old "KILLME" concept -- perform the actual deletion of a
    subdir (or just its admin area) during post-commit processing of a