You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/06/01 13:43:50 UTC

svn commit: r950025 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db.h workqueue.c

Author: rhuijben
Date: Tue Jun  1 11:43:49 2010
New Revision: 950025

URL: http://svn.apache.org/viewvc?rev=950025&view=rev
Log:
When reverting a node back to its committed state, just remove the
working node record from the parent stub, instead of performing some
entry operations.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_temp_op_remove_working_stub): New function.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_temp_op_remove_working_stub): New function.

* subversion/libsvn_wc/workqueue.c
  (run_revert): Use svn_wc__db_temp_op_remove_working_stub instead of
    svn_wc__entry_modify_stub.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/libsvn_wc/workqueue.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=950025&r1=950024&r2=950025&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Jun  1 11:43:49 2010
@@ -7634,3 +7634,35 @@ svn_wc__db_temp_op_set_file_external(svn
 
   return svn_error_return(svn_sqlite__step_done(stmt));
 }
+
+svn_error_t *
+svn_wc__db_temp_op_remove_working_stub(svn_wc__db_t* db,
+                                       const char *local_abspath,
+                                       apr_pool_t *scratch_pool)
+{
+  svn_wc__db_pdh_t *pdh;
+  const char *local_relpath;
+  svn_sqlite__stmt_t *stmt;
+
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+
+  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+                                             local_abspath,
+                                             svn_sqlite__mode_readwrite,
+                                             scratch_pool, scratch_pool));
+  VERIFY_USABLE_PDH(pdh);
+
+  if (*local_relpath != '\0')
+    return SVN_NO_ERROR; /* No stub to change */
+
+  SVN_ERR(navigate_to_parent(&pdh, db, pdh, svn_sqlite__mode_readwrite,
+                             scratch_pool));
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+                                    STMT_DELETE_WORKING_NODE));
+
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id,
+                            svn_dirent_basename(local_abspath, NULL)));
+
+  return svn_error_return(svn_sqlite__step_done(stmt));
+}

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=950025&r1=950024&r2=950025&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Tue Jun  1 11:43:49 2010
@@ -2379,6 +2379,12 @@ svn_wc__db_temp_op_set_file_external(svn
                                      const svn_opt_revision_t *rev,
                                      apr_pool_t *scratch_pool);
 
+/* Remove the WORKING_NODE information from LOCAL_ABSPATH's parent stub */
+svn_error_t *
+svn_wc__db_temp_op_remove_working_stub(svn_wc__db_t* db,
+                                       const char *local_abspath,
+                                       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=950025&r1=950024&r2=950025&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue Jun  1 11:43:49 2010
@@ -458,20 +458,8 @@ run_revert(svn_wc__db_t *db,
       SVN_ERR(svn_wc__check_wc_root(&is_wc_root, NULL, &is_switched,
                                     db, local_abspath, scratch_pool));
       if (!is_wc_root && !is_switched)
-        {
-          tmp_entry.copied = FALSE;
-          tmp_entry.copyfrom_url = NULL;
-          tmp_entry.copyfrom_rev = SVN_INVALID_REVNUM;
-          tmp_entry.schedule = svn_wc_schedule_normal;
-          SVN_ERR(svn_wc__entry_modify_stub(
-                    db, local_abspath,
-                    &tmp_entry,
-                    SVN_WC__ENTRY_MODIFY_COPIED
-                      | SVN_WC__ENTRY_MODIFY_COPYFROM_URL
-                      | SVN_WC__ENTRY_MODIFY_COPYFROM_REV
-                      | SVN_WC__ENTRY_MODIFY_SCHEDULE,
-                    scratch_pool));
-        }
+        SVN_ERR(svn_wc__db_temp_op_remove_working_stub(db, local_abspath,
+                                                       scratch_pool));
     }
 
   return SVN_NO_ERROR;