subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1127990 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c wc-queries.sql wc_db.c wc_db.h
Date Thu, 26 May 2011 16:55:47 GMT
Author: philip
Date: Thu May 26 16:55:46 2011
New Revision: 1127990

URL: http://svn.apache.org/viewvc?rev=1127990&view=rev
Log:
Fix issue 3894, clean up revert list SQL table.

* subversion/libsvn_wc/adm_ops.c
  (revert_restore): Remove comments.
  (new_revert_internal): Call svn_wc__db_revert_list_done.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_DROP_REVERT_LIST): New.

* subversion/libsvn_wc/wc_db.c
* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_revert_list_done): New.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.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=1127990&r1=1127989&r2=1127990&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu May 26 16:55:46 2011
@@ -1292,8 +1292,6 @@ revert_restore(svn_wc__db_t *db,
         SVN_ERR(svn_wc__db_revert_list_notify(notify_func, notify_baton,
                                               db, local_abspath,
                                               scratch_pool));
-      /* ### else: Delete the list */
-
       return SVN_NO_ERROR;
     }
   else if (err)
@@ -1524,8 +1522,6 @@ revert_restore(svn_wc__db_t *db,
   if (notify_func)
     SVN_ERR(svn_wc__db_revert_list_notify(notify_func, notify_baton,
                                           db, local_abspath, scratch_pool));
-  /* ### else: Delete the list */
-
   return SVN_NO_ERROR;
 }
 
@@ -1543,6 +1539,8 @@ new_revert_internal(svn_wc__db_t *db,
                     void *notify_baton,
                     apr_pool_t *scratch_pool)
 {
+  svn_error_t *err;
+
   SVN_ERR_ASSERT(depth == svn_depth_empty || depth == svn_depth_infinity);
 
   /* We should have a write lock on the parent of local_abspath, except
@@ -1559,16 +1557,22 @@ new_revert_internal(svn_wc__db_t *db,
     SVN_ERR(svn_wc__write_check(db, dir_abspath, scratch_pool));
   }
 
-  SVN_ERR(svn_wc__db_op_revert(db, local_abspath, depth,
-                               scratch_pool, scratch_pool));
+  err = svn_wc__db_op_revert(db, local_abspath, depth,
+                             scratch_pool, scratch_pool);
 
-  SVN_ERR(revert_restore(db, local_abspath, depth,
+  if (!err)
+    err = revert_restore(db, local_abspath, depth,
                          use_commit_times,
                          cancel_func, cancel_baton,
                          notify_func, notify_baton,
-                         scratch_pool));
+                         scratch_pool);
 
-  return SVN_NO_ERROR;
+  err = svn_error_compose_create(err,
+                                 svn_wc__db_revert_list_done(db,
+                                                             local_abspath,
+                                                             scratch_pool));
+
+  return err;
 }
 
 

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1127990&r1=1127989&r2=1127990&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu May 26 16:55:46 2011
@@ -1134,6 +1134,9 @@ ORDER BY local_relpath
 DELETE FROM revert_list
 WHERE local_relpath = ?1 OR local_relpath LIKE ?2 ESCAPE '#'
 
+-- STMT_DROP_REVERT_LIST
+DROP TABLE IF EXISTS revert_list
+
 -- STMT_CREATE_DELETE_LIST
 DROP TABLE IF EXISTS delete_list;
 CREATE TEMPORARY TABLE delete_list (

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1127990&r1=1127989&r2=1127990&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu May 26 16:55:46 2011
@@ -5595,6 +5595,22 @@ svn_wc__db_revert_list_notify(svn_wc_not
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc__db_revert_list_done(svn_wc__db_t *db,
+                            const char *local_abspath,
+                            apr_pool_t *scratch_pool)
+{
+  svn_wc__db_wcroot_t *wcroot;
+  const char *local_relpath;
+
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
+                              db, local_abspath, scratch_pool, scratch_pool));
+  VERIFY_USABLE_WCROOT(wcroot);
+
+  SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb, STMT_DROP_REVERT_LIST));
+
+  return SVN_NO_ERROR;
+}
 
 /* Like svn_wc__db_op_read_all_tree_conflicts(), but with WCROOT+LOCAL_RELPATH
    instead of DB+LOCAL_ABSPATH.  */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1127990&r1=1127989&r2=1127990&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu May 26 16:55:46 2011
@@ -1508,6 +1508,13 @@ svn_wc__db_revert_list_notify(svn_wc_not
                               const char *local_abspath,
                               apr_pool_t *scratch_pool);
 
+/* Clean up after svn_wc__db_op_revert by removing the revert list.
+ */
+svn_error_t *
+svn_wc__db_revert_list_done(svn_wc__db_t *db,
+                            const char *local_abspath,
+                            apr_pool_t *scratch_pool);
+
 
 /* Return a hash @a *tree_conflicts of all the children of @a
  * local_abspath that are in tree conflicts.  The hash maps local



Mime
View raw message