You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2013/02/27 17:07:36 UTC

svn commit: r1450826 - /subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c

Author: philip
Date: Wed Feb 27 16:07:36 2013
New Revision: 1450826

URL: http://svn.apache.org/r1450826
Log:
During move-update only merge text and notify text update if the text
is changing.

* subversion/libsvn_wc/wc_db_update_move.c
  (update_working_file): Only merge text if checksums differ.

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

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1450826&r1=1450825&r2=1450826&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Wed Feb 27 16:07:36 2013
@@ -893,36 +893,59 @@ update_working_file(svn_skel_t **work_it
                                old_version, new_version,
                                result_pool, scratch_pool));
 
-  /*
-   * Run a 3-way merge to update the file, using the pre-update
-   * pristine text as the merge base, the post-update pristine
-   * text as the merge-left version, and the current content of the
-   * moved-here working file as the merge-right version.
-   */
-  SVN_ERR(svn_wc__db_pristine_get_path(&old_pristine_abspath,
-                                       db, wcroot->abspath,
-                                       old_version->checksum,
-                                       scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__db_pristine_get_path(&new_pristine_abspath,
-                                       db, wcroot->abspath,
-                                       new_version->checksum,
-                                       scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__internal_merge(&work_item, &conflict_skel,
-                                 &merge_outcome, db,
-                                 old_pristine_abspath,
-                                 new_pristine_abspath,
-                                 local_abspath,
-                                 local_abspath,
-                                 NULL, NULL, NULL, /* diff labels */
-                                 actual_props,
-                                 FALSE, /* dry-run */
-                                 NULL, /* diff3-cmd */
-                                 NULL, /* merge options */
-                                 propchanges,
-                                 NULL, NULL, /* cancel_func + baton */
-                                 result_pool, scratch_pool));
+  if (!svn_checksum_match(new_version->checksum, old_version->checksum))
+    {
+      /*
+       * Run a 3-way merge to update the file, using the pre-update
+       * pristine text as the merge base, the post-update pristine
+       * text as the merge-left version, and the current content of the
+       * moved-here working file as the merge-right version.
+       */
+      SVN_ERR(svn_wc__db_pristine_get_path(&old_pristine_abspath,
+                                           db, wcroot->abspath,
+                                           old_version->checksum,
+                                           scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__db_pristine_get_path(&new_pristine_abspath,
+                                           db, wcroot->abspath,
+                                           new_version->checksum,
+                                           scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__internal_merge(&work_item, &conflict_skel,
+                                     &merge_outcome, db,
+                                     old_pristine_abspath,
+                                     new_pristine_abspath,
+                                     local_abspath,
+                                     local_abspath,
+                                     NULL, NULL, NULL, /* diff labels */
+                                     actual_props,
+                                     FALSE, /* dry-run */
+                                     NULL, /* diff3-cmd */
+                                     NULL, /* merge options */
+                                     propchanges,
+                                     NULL, NULL, /* cancel_func + baton */
+                                     result_pool, scratch_pool));
 
-  *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+      *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+
+      if (merge_outcome == svn_wc_merge_conflict)
+        {
+          content_state = svn_wc_notify_state_conflicted;
+        }
+      else
+        {
+          svn_boolean_t is_locally_modified;
+          
+          SVN_ERR(svn_wc__internal_file_modified_p(&is_locally_modified,
+                                                   db, local_abspath,
+                                                   FALSE /* exact_comparison */,
+                                                   scratch_pool));
+          if (is_locally_modified)
+            content_state = svn_wc_notify_state_merged;
+          else
+            content_state = svn_wc_notify_state_changed;
+        }
+    }
+  else
+    content_state = svn_wc_notify_state_unchanged;
 
   /* If there are any conflicts to be stored, convert them into work items
    * too. */
@@ -938,24 +961,6 @@ update_working_file(svn_skel_t **work_it
                                                 scratch_pool));
     }
 
-  if (merge_outcome == svn_wc_merge_conflict)
-    {
-      content_state = svn_wc_notify_state_conflicted;
-    }
-  else
-    {
-      svn_boolean_t is_locally_modified;
-
-      SVN_ERR(svn_wc__internal_file_modified_p(&is_locally_modified,
-                                               db, local_abspath,
-                                               FALSE /* exact_comparison */,
-                                               scratch_pool));
-      if (is_locally_modified)
-        content_state = svn_wc_notify_state_merged;
-      else
-        content_state = svn_wc_notify_state_changed;
-    }
-
   SVN_ERR(update_move_list_add(wcroot, local_relpath,
                                svn_wc_notify_update_update,
                                svn_node_file,