You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/28 03:05:00 UTC

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

Author: gstein
Date: Wed Apr 28 01:05:00 2010
New Revision: 938742

URL: http://svn.apache.org/viewvc?rev=938742&view=rev
Log:
Get rid of OP_REMOVE_REVERT_FILES and just queue the file removals
manually using a pair of OP_FILE_REMOVE operations.

This now removes revert props for directories, which did no seem to be
happening before.

* subversion/libsvn_wc/adm_ops.c:
  (process_committed_leaf): queue two work items for removing revert
    properties and (possibly) a revert text base. no longer call
    svn_wc__wq_remove_revert_files.

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

* subversion/libsvn_wc/workqueue.c:
  (OP_REMOVE_REVERT_FILES, run_remove_revert_files,
      svn_wc__wq_remove_revert_files): removed
  (dispatch_table): removed entry for OP_REMOVE_REVERT_FILES

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    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=938742&r1=938741&r2=938742&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed Apr 28 01:05:00 2010
@@ -377,13 +377,44 @@ process_committed_leaf(svn_wc__db_t *db,
                                 scratch_pool));
     }
 
+  /* Queue a removal of any "revert" properties now. These correspond to
+     the BASE properties, but hidden by new pristine props in WORKING.
+     Regardless, the commit will be installing new BASE props.  */
+  /* ### this goes away once props are fully in the database  */
+  {
+    const char *revert_props_abspath;
+    const svn_skel_t *work_item;
+
+    /* ### this breaks the abstraction of svn_wc__props_delete, but
+       ### screw it. this is transitional code.  */
+    /* ### what happens if the node changes its KIND? should be okay
+       ### since we disallow that today, and props should be in the DB
+       ### by the time that we DO allow that.  */
+    SVN_ERR(svn_wc__prop_path(&revert_props_abspath, local_abspath, kind,
+                              svn_wc__props_revert, scratch_pool));
+
+    SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+                                         db, revert_props_abspath,
+                                         scratch_pool, scratch_pool));
+    SVN_ERR(svn_wc__db_wq_add(db, adm_abspath, work_item, scratch_pool));
+  }
+
   /* ### this picks up file and symlink  */
   if (kind != svn_wc__db_kind_dir)
     {
-      /* 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(svn_wc__wq_remove_revert_files(db, local_abspath, scratch_pool));
+      /* Queue a removal any "revert" text base now.  */
+      {
+        const char *revert_abspath;
+        const svn_skel_t *work_item;
+
+        SVN_ERR(svn_wc__text_revert_path(&revert_abspath, db, local_abspath,
+                                         scratch_pool));
+
+        SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+                                             db, revert_abspath,
+                                             scratch_pool, scratch_pool));
+        SVN_ERR(svn_wc__db_wq_add(db, adm_abspath, work_item, scratch_pool));
+      }
 
       /* If we sent a delta (meaning: post-copy modification),
          then this file will appear in the queue and so we should have

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=938742&r1=938741&r2=938742&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Wed Apr 28 01:05:00 2010
@@ -50,7 +50,6 @@
 /* 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"
@@ -762,60 +761,6 @@ svn_wc__wq_prepare_revert_files(svn_wc__
 
 /* ------------------------------------------------------------------------ */
 
-/* OP_REMOVE_REVERT_FILES  */
-
-
-/* Process the OP_REMOVE_REVERT_FILES work item WORK_ITEM.
- * See svn_wc__wq_remove_revert_files() which generates this work item.
- * Implements (struct work_item_dispatch).func. */
-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  */
 
 /* Process the OP_KILLME work item WORK_ITEM.
@@ -2309,7 +2254,6 @@ svn_wc__wq_build_prej_install(const svn_
 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=938742&r1=938741&r2=938742&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.h Wed Apr 28 01:05:00 2010
@@ -135,13 +135,6 @@ svn_wc__wq_prepare_revert_files(svn_wc__
                                 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