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/08 06:10:34 UTC

svn commit: r931777 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Author: gstein
Date: Thu Apr  8 04:10:34 2010
New Revision: 931777

URL: http://svn.apache.org/viewvc?rev=931777&view=rev
Log:
Begin some new work on how working files will be installed. Rather than
mixing it in with the other state-changing operations, wait until that has
been settled, then perform the install.

* subversion/libsvn_wc/update_editor.c:
  (merge_file): accept a new parameter, INSTALL_PRISTINE, to indicate the
    caller should install the (new) pristine to a new working file. use
    the flag for one of the scenarios, but temporarily disable it for
    another which breaks externals. avoid the timestamp and readonly stuff
    if a pristine will be installed (which does all that work).
  (close_file): adjust params to merge_file. add a block to install the
    working file based on the new INSTALL_PRISTINE localvar.

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

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=931777&r1=931776&r2=931777&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Apr  8 04:10:34 2010
@@ -4228,6 +4228,9 @@ install_text_base(svn_stringbuf_t **log_
  * prepared (see below) to join version control, fully install a
  * new revision of the file.
  *
+ * ### transitional: installation of the working file will be handled
+ * ### by the *INSTALL_PRISTINE flag.
+ *
  * By "install", we mean: create a new text-base and prop-base, merge
  * any textual and property changes into the working file, and finally
  * update all metadata so that the working copy believes it has a new
@@ -4241,8 +4244,7 @@ install_text_base(svn_stringbuf_t **log_
  * this file, and removed after a successful run of the generated log
  * commands.
  *
- * Set *CONTENT_STATE, *PROP_STATE and *LOCK_STATE to the state of the
- * contents, properties and repository lock, respectively, after the
+ * Set *CONTENT_STATE to the state of the contents after the
  * installation.  If an error is returned, the value of these three
  * variables is undefined.
  *
@@ -4254,6 +4256,7 @@ install_text_base(svn_stringbuf_t **log_
  */
 static svn_error_t *
 merge_file(svn_stringbuf_t **log_accum,
+           svn_boolean_t *install_pristine,
            svn_wc_notify_state_t *content_state,
            const svn_wc_entry_t *entry,
            struct file_baton *fb,
@@ -4293,6 +4296,8 @@ merge_file(svn_stringbuf_t **log_accum,
   SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum, pool);
 #endif
 
+  *install_pristine = FALSE;
+
   /* Start by splitting the file path, getting an access baton for the parent,
      and an entry for the file if any. */
 
@@ -4416,12 +4421,19 @@ merge_file(svn_stringbuf_t **log_accum,
                  For replaced files, though, we want to merge in the changes
                  even if the file is not modified compared to the (non-revert)
                  text-base. */
+
+              /* ### don't do the new-style install just yet. it appears
+                 ### to break most of the externals_tests.  */
+#if 0
+              *install_pristine = TRUE;
+#else
               SVN_ERR(svn_wc__loggy_copy(log_accum,
                                          pb->local_abspath,
                                          new_text_base_abspath,
                                          fb->local_abspath, pool, pool));
               SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum,
                                       pool);
+#endif
             }
         }
       else   /* working file or obstruction is locally modified... */
@@ -4433,12 +4445,7 @@ merge_file(svn_stringbuf_t **log_accum,
             {
               /* working file is missing?!
                  Just copy the new text-base to the file. */
-              SVN_ERR(svn_wc__loggy_copy(log_accum,
-                                         pb->local_abspath,
-                                         new_text_base_abspath,
-                                         fb->local_abspath, pool, pool));
-              SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum,
-                                      pool);
+              *install_pristine = TRUE;
             }
           else if (! fb->obstruction_found)
             /* Working file exists and has local mods
@@ -4627,8 +4634,9 @@ merge_file(svn_stringbuf_t **log_accum,
 
   /* Log commands to handle text-timestamp and working-size,
      if the file is - or will be - unmodified and schedule-normal */
-  if (!is_locally_modified &&
-      (fb->adding_file || entry->schedule == svn_wc_schedule_normal))
+  if (!*install_pristine
+      && !is_locally_modified
+      && (fb->adding_file || entry->schedule == svn_wc_schedule_normal))
     {
       /* Adjust working copy file unless this file is an allowed
          obstruction. */
@@ -4768,6 +4776,7 @@ close_file(void *file_baton,
   apr_array_header_t *wc_props;
   apr_array_header_t *regular_props;
   const svn_wc_entry_t *entry;
+  svn_boolean_t install_pristine;
 
   if (fb->skip_this)
     {
@@ -4941,7 +4950,7 @@ close_file(void *file_baton,
                                         pool));
 
   /* Do the hard work. This will queue some additional work.  */
-  SVN_ERR(merge_file(&delayed_log_accum,
+  SVN_ERR(merge_file(&delayed_log_accum, &install_pristine,
                      &content_state, entry,
                      fb, new_base_abspath, md5_actual_checksum,
                      pool));
@@ -4963,6 +4972,21 @@ close_file(void *file_baton,
                                                fb->local_abspath, pool));
     }
 
+  if (install_pristine)
+    {
+      const svn_skel_t *work_item;
+
+      SVN_ERR(svn_wc__wq_build_file_install(&work_item,
+                                            eb->db,
+                                            fb->local_abspath,
+                                            NULL,
+                                            eb->use_commit_times,
+                                            TRUE /* record_fileinfo */,
+                                            pool, pool));
+      SVN_ERR(svn_wc__db_wq_add(eb->db, fb->dir_baton->local_abspath,
+                                work_item, pool));
+    }
+
   /* Clean up any temporary files.  */
   if (fb->copied_text_base_abspath)
     {