subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1199868 - in /subversion/trunk/subversion/libsvn_wc: update_editor.c wc_db.c wc_db.h
Date Wed, 09 Nov 2011 17:09:23 GMT
Author: philip
Date: Wed Nov  9 17:09:22 2011
New Revision: 1199868

URL: http://svn.apache.org/viewvc?rev=1199868&view=rev
Log:
Revert r1197281, the fix for issue 4048, compatability with 1.0.x
servers.  We can be more conservative and only mark the working
copy root complete.

Modified:
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1199868&r1=1199867&r2=1199868&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Nov  9 17:09:22 2011
@@ -4614,6 +4614,17 @@ close_edit(void *edit_baton,
   struct edit_baton *eb = edit_baton;
   apr_pool_t *scratch_pool = eb->pool;
 
+  /* The editor didn't even open the root; we have to take care of
+     some cleanup stuffs. */
+  if (! eb->root_opened
+      && *eb->target_basename == '\0')
+    {
+      /* We need to "un-incomplete" the root directory. */
+      SVN_ERR(svn_wc__db_temp_op_end_directory_update(eb->db,
+                                                      eb->anchor_abspath,
+                                                      scratch_pool));
+    }
+
   /* By definition, anybody "driving" this editor for update or switch
      purposes at a *minimum* must have called set_target_revision() at
      the outset, and close_edit() at the end -- even if it turned out

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1199868&r1=1199867&r2=1199868&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Nov  9 17:09:22 2011
@@ -9194,17 +9194,6 @@ bump_node_revision(svn_wc__db_wcroot_t *
                                             new_repos_id,
                                             scratch_pool));
 
-  if (db_kind == svn_kind_dir && status == svn_wc__db_status_incomplete)
-    {
-      svn_sqlite__stmt_t *stmt;
-
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_UPDATE_NODE_BASE_PRESENCE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, local_relpath,
-                                presence_map, svn_wc__db_status_normal));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
-
   /* Early out */
   if (depth <= svn_depth_empty
       || db_kind != svn_kind_dir
@@ -11785,6 +11774,55 @@ svn_wc__db_wclock_owns_lock(svn_boolean_
   return SVN_NO_ERROR;
 }
 
+/* Lock helper for svn_wc__db_temp_op_end_directory_update */
+static svn_error_t *
+end_directory_update(void *baton,
+                     svn_wc__db_wcroot_t *wcroot,
+                     const char *local_relpath,
+                     apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt;
+  svn_wc__db_status_t base_status;
+
+  SVN_ERR(base_get_info(&base_status, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                        NULL, NULL, NULL, NULL, NULL, NULL,
+                        wcroot, local_relpath, scratch_pool, scratch_pool));
+
+  SVN_ERR_ASSERT(base_status == svn_wc__db_status_incomplete);
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_UPDATE_NODE_BASE_PRESENCE));
+  SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, local_relpath,
+                            presence_map, svn_wc__db_status_normal));
+  SVN_ERR(svn_sqlite__step_done(stmt));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__db_temp_op_end_directory_update(svn_wc__db_t *db,
+                                        const char *local_dir_abspath,
+                                        apr_pool_t *scratch_pool)
+{
+  svn_wc__db_wcroot_t *wcroot;
+  const char *local_relpath;
+
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
+
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
+                              local_dir_abspath, scratch_pool, scratch_pool));
+  VERIFY_USABLE_WCROOT(wcroot);
+
+  SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, end_directory_update,
+                              NULL, scratch_pool));
+
+  SVN_ERR(flush_entries(wcroot, local_dir_abspath, svn_depth_empty,
+                        scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
 struct start_directory_update_baton_t
 {
   svn_revnum_t new_rev;

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1199868&r1=1199867&r2=1199868&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed Nov  9 17:09:22 2011
@@ -2343,11 +2343,6 @@ svn_wc__db_global_update(svn_wc__db_t *d
    The modifications are mutually exclusive.  If NEW_REPOS_ROOT is non-NULL,
    set the repository root of the entry to NEW_REPOS_ROOT.
 
-   If LOCAL_ABSPATH is an incomplete directory then mark it complete
-   by setting the status to normal. (Removing incomplete is usually
-   done by the editor during close_directory, but if the editor driver
-   simply called close_edit it gets done here.)
-
    If LOCAL_ABSPATH is a directory, then, walk entries below LOCAL_ABSPATH
    according to DEPTH thusly:
 
@@ -2906,6 +2901,15 @@ svn_wc__db_temp_op_start_directory_updat
                                           svn_revnum_t new_rev,
                                           apr_pool_t *scratch_pool);
 
+/* Marks a directory update started with
+   svn_wc__db_temp_op_start_directory_update as completed, by removing
+   the incomplete status */
+svn_error_t *
+svn_wc__db_temp_op_end_directory_update(svn_wc__db_t *db,
+                                        const char *local_dir_abspath,
+                                        apr_pool_t *scratch_pool);
+
+
 /* Copy the base tree at LOCAL_ABSPATH into the working tree as copy,
    leaving any subtree additions and copies as-is.  This allows the
    base node tree to be removed. */



Mime
View raw message