You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/12/16 19:43:16 UTC

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

Author: julianfoad
Date: Thu Dec 16 18:43:16 2010
New Revision: 1050091

URL: http://svn.apache.org/viewvc?rev=1050091&view=rev
Log:
Remove code that has been redundant since update's "copy from" functionality
was removed in r998193.

* subversion/libsvn_wc/update_editor.c
  (file_baton): Remove all the 'copied_*' fields: they are never set.
  (apply_textdelta, merge_file, close_file): Remove code that used them.

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=1050091&r1=1050090&r2=1050091&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Dec 16 18:43:16 2010
@@ -925,24 +925,6 @@ struct file_baton
   svn_checksum_t *new_text_base_md5_checksum;
   svn_checksum_t *new_text_base_sha1_checksum;
 
-  /* If this file was added with history, these are the checksums of the
-     copy-from text base, which is in the pristine store, else NULL. */
-  svn_checksum_t *copied_text_base_md5_checksum;
-  svn_checksum_t *copied_text_base_sha1_checksum;
-
-  /* If this file was added with history, and the copyfrom had local
-     mods, this is the path to a copy of the user's version with local
-     mods (in the temporary area). */
-  const char *copied_working_text;
-
-  /* If this file was added with history, this hash contains the base
-     properties of the copied file. */
-  apr_hash_t *copied_base_props;
-
-  /* If this file was added with history, this hash contains the working
-     properties of the copied file. */
-  apr_hash_t *copied_working_props;
-
   /* Set if we've received an apply_textdelta for this file. */
   svn_boolean_t received_textdelta;
 
@@ -3493,13 +3475,7 @@ apply_textdelta(void *file_baton,
     }
   else
     {
-      if (fb->copied_text_base_sha1_checksum)
-        SVN_ERR(svn_wc__db_pristine_read(&source, fb->edit_baton->db,
-                                         fb->local_abspath,
-                                         fb->copied_text_base_sha1_checksum,
-                                         handler_pool, handler_pool));
-      else
-        source = svn_stream_empty(handler_pool);
+      source = svn_stream_empty(handler_pool);
     }
 
   /* If we don't have a recorded checksum, use the ra provided checksum */
@@ -3701,8 +3677,7 @@ merge_file(svn_skel_t **work_items,
      Note that this compares to the current pristine file, which is
      different from fb->old_text_base_path if we have a replaced-with-history
      file.  However, in the case we had an obstruction, we check against the
-     new text base. (And if we're doing an add-with-history and we've already
-     saved a copy of a locally-modified file, then there certainly are mods.)
+     new text base.
 
      Special case: The working file is referring to a file external? If so
                    then we must mark it as unmodified in order to avoid bogus
@@ -3710,17 +3685,7 @@ merge_file(svn_skel_t **work_items,
                    merge externals item from the repository.
 
      ### Newly added file externals have a svn_wc_schedule_add here. */
-  if (fb->copied_working_text)
-    {
-      /* The file was copied here, and it came with both a (new) pristine
-         and a working file. Presumably, the working file is modified
-         relative to the new pristine.
-
-         The new pristine is in NEW_TEXT_BASE_TMP_ABSPATH, which should also
-         be FB->COPIED_TEXT_BASE_ABSPATH.  */
-      is_locally_modified = TRUE;
-    }
-  else if (file_external &&
+  if (file_external &&
            status ==svn_wc__db_status_added)
     {
       is_locally_modified = FALSE; /* ### Or a conflict will be raised */
@@ -3914,11 +3879,6 @@ merge_file(svn_skel_t **work_items,
                                              pool, pool));
                   delete_left = TRUE;
                 }
-              else if (fb->copied_text_base_sha1_checksum)
-                SVN_ERR(svn_wc__db_pristine_get_path(&merge_left, eb->db,
-                                                     fb->local_abspath,
-                                                     fb->copied_text_base_sha1_checksum,
-                                                     pool, pool));
               else
                 SVN_ERR(svn_wc__ultimate_base_text_path_to_read(
                   &merge_left, eb->db, fb->local_abspath, pool, pool));
@@ -3939,7 +3899,7 @@ merge_file(svn_skel_t **work_items,
                         merge_left, NULL,
                         new_text_base_tmp_abspath, NULL,
                         fb->local_abspath,
-                        fb->copied_working_text,
+                        NULL /* copyfrom_abspath */,
                         oldrev_str, newrev_str, mine_str,
                         FALSE /* dry_run */,
                         eb->diff3_cmd, NULL, fb->propchanges,
@@ -3956,16 +3916,6 @@ merge_file(svn_skel_t **work_items,
                                                        pool, pool));
                   *work_items = svn_wc__wq_merge(*work_items, work_item, pool);
                 }
-
-              /* And clean up add-with-history-related temp file too. */
-              if (fb->copied_working_text)
-                {
-                  SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
-                                                       eb->db,
-                                                       fb->copied_working_text,
-                                                       pool, pool));
-                  *work_items = svn_wc__wq_merge(*work_items, work_item, pool);
-                }
             } /* end: working file exists and has mods */
         } /* end: working file has mods */
     } /* end: "textual" merging process */
@@ -4195,15 +4145,7 @@ close_file(void *file_baton,
     local_actual_props = apr_hash_make(pool);
 
 
-  if (fb->copied_base_props)
-    {
-      /* The BASE props are given by the source of the copy. We may also
-         have some ACTUAL props if the server directed us to copy a path
-         located in our WC which had some ACTUAL changes.  */
-      current_base_props = fb->copied_base_props;
-      current_actual_props = fb->copied_working_props;
-    }
-  else if (kind != svn_node_none)
+  if (kind != svn_node_none)
     {
       /* This node already exists. Grab its properties. */
       SVN_ERR(svn_wc__get_pristine_props(&current_base_props,
@@ -4237,30 +4179,20 @@ close_file(void *file_baton,
                                 SVN_PROP_SPECIAL,
                                 APR_HASH_KEY_STRING) != NULL;
 
-      /* Jump through hoops to get the proper props in case of
-       * a copy. (see the fb->copied_base_props condition above) */
-      if (fb->copied_base_props)
-        {
-          incoming_is_link = fb->copied_working_props
-                             && apr_hash_get(fb->copied_working_props,
-                                             SVN_PROP_SPECIAL,
-                                             APR_HASH_KEY_STRING) != NULL;
-        }
-      else
-        {
-          int i;
+      {
+        int i;
 
-          for (i = 0; i < regular_props->nelts; ++i)
-            {
-              const svn_prop_t *prop = &APR_ARRAY_IDX(regular_props, i,
-                                                      svn_prop_t);
+        for (i = 0; i < regular_props->nelts; ++i)
+          {
+            const svn_prop_t *prop = &APR_ARRAY_IDX(regular_props, i,
+                                                    svn_prop_t);
 
-              if (strcmp(prop->name, SVN_PROP_SPECIAL) == 0)
-                {
-                  incoming_is_link = TRUE;
-                }
-            }
-        }
+            if (strcmp(prop->name, SVN_PROP_SPECIAL) == 0)
+              {
+                incoming_is_link = TRUE;
+              }
+          }
+      }
 
 
       if (local_is_link != incoming_is_link)
@@ -4346,15 +4278,9 @@ close_file(void *file_baton,
       /* Adding a BASE node under a locally added node.
        * The incoming add becomes the revert-base! */
       svn_wc_notify_state_t no_prop_state;
-      apr_hash_t *copied_base_props;
       apr_hash_t *no_new_actual_props = NULL;
       apr_hash_t *no_working_props = apr_hash_make(pool);
 
-      copied_base_props = fb->copied_base_props;
-      if (! copied_base_props)
-        copied_base_props = apr_hash_make(pool);
-
-
       /* Store the incoming props (sent as propchanges) in new_base_props.
        * Keep the actual props unchanged. */
       SVN_ERR(svn_wc__merge_props(&no_prop_state,
@@ -4366,7 +4292,7 @@ close_file(void *file_baton,
                                   NULL /* left_version */,
                                   NULL /* right_version */,
                                   NULL /* server_baseprops (update, not merge)  */,
-                                  copied_base_props,
+                                  apr_hash_make(pool),
                                   no_working_props,
                                   regular_props, /* propchanges */
                                   TRUE /* base_merge */,
@@ -4408,18 +4334,6 @@ close_file(void *file_baton,
       all_work_items = svn_wc__wq_merge(all_work_items, work_item, pool);
     }
 
-  /* Remove the copied text base file if we're no longer using it. */
-  if (fb->copied_text_base_sha1_checksum)
-    {
-      /* ### TODO: Add a WQ item to remove this pristine if unreferenced:
-         svn_wc__wq_build_pristine_remove(&work_item,
-                                          eb->db, fb->local_abspath,
-                                          fb->copied_text_base_sha1_checksum,
-                                          pool);
-         all_work_items = svn_wc__wq_merge(all_work_items, work_item, pool);
-      */
-    }
-
   /* ### NOTE: from this point onwards, we make several changes to the
      ### database in a non-transactional way. we also queue additional
      ### work after these changes. some revamps need to be performed to