You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/10/30 14:07:21 UTC

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

Author: stsp
Date: Tue Oct 30 13:07:21 2012
New Revision: 1403684

URL: http://svn.apache.org/viewvc?rev=1403684&view=rev
Log:
In the move-update editor, obtain info about the tree-conflict earlier,
before we start using wcroot and relpath pairs.

This backpedals a bit from my goal to make all of this file use wcroot
and relpath pairs. But there are too many APIs that would need to be
converted to wcroot+relpath, and doing so wouldn't gain us much.
Reading tree-conflict info outside the wc_db transaction should be safe
since this code assumes that a write-lock is held on the working copy.

* subversion/libsvn_wc/wc_db_update_move.c
  (get_tc_info): Drop unused dst_abspath parameter.
  (update_moved_away_conflict_victim_baton): New members operation,
   local_change, incoming_change, old_version, and new_version.
  (update_moved_away_conflict_victim): Don't call get_tc_info() here.
   Pull tree-conflict info from the caller-provided baton instead.
  (svn_wc__db_update_moved_away_conflict_victim): Read tree-conflict info
   into update_moved_away_conflict_victim()'s baton, before starting the
   wc_db transaction.

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=1403684&r1=1403683&r2=1403684&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Tue Oct 30 13:07:21 2012
@@ -349,7 +349,6 @@ get_tc_info(svn_wc_operation_t *operatio
             svn_wc_conflict_version_t **old_version,
             svn_wc_conflict_version_t **new_version,
             const char *src_abspath,
-            const char *dst_abspath,
             svn_wc__db_t *db,
             apr_pool_t *result_pool,
             apr_pool_t *scratch_pool)
@@ -622,6 +621,11 @@ drive_tree_conflict_editor(svn_editor_t 
 struct update_moved_away_conflict_victim_baton {
   svn_skel_t **work_items;
   const char *victim_relpath;
+  svn_wc_operation_t operation;
+  svn_wc_conflict_reason_t local_change;
+  svn_wc_conflict_action_t incoming_change;
+  svn_wc_conflict_version_t *old_version;
+  svn_wc_conflict_version_t *new_version;
   svn_wc__db_t *db;
   svn_wc_notify_func2_t notify_func;
   void *notify_baton;
@@ -640,9 +644,6 @@ update_moved_away_conflict_victim(void *
   struct update_moved_away_conflict_victim_baton *b = baton;
   svn_editor_t *tc_editor;
   struct tc_editor_baton *tc_editor_baton;
-  svn_wc_operation_t operation;
-  svn_wc_conflict_reason_t local_change;
-  svn_wc_conflict_action_t incoming_change;
   const char *dst_relpath;
 
   /* ### assumes wc write lock already held */
@@ -666,13 +667,8 @@ update_moved_away_conflict_victim(void *
                                scratch_pool));
   tc_editor_baton->dst_abspath = svn_dirent_join(wcroot->abspath,
                                                  dst_relpath, scratch_pool);
-
-  SVN_ERR(get_tc_info(&operation, &local_change, &incoming_change,
-                      &tc_editor_baton->old_version,
-                      &tc_editor_baton->new_version,
-                      tc_editor_baton->src_abspath,
-                      tc_editor_baton->dst_abspath,
-                      b->db, scratch_pool, scratch_pool));
+  tc_editor_baton->old_version= b->old_version;
+  tc_editor_baton->new_version= b->new_version;
   tc_editor_baton->db = b->db;
   tc_editor_baton->wcroot = wcroot;
   tc_editor_baton->work_items = b->work_items;
@@ -690,8 +686,8 @@ update_moved_away_conflict_victim(void *
   SVN_ERR(drive_tree_conflict_editor(tc_editor,
                                      tc_editor_baton->src_abspath,
                                      tc_editor_baton->dst_abspath,
-                                     operation,
-                                     local_change, incoming_change,
+                                     b->operation,
+                                     b->local_change, b->incoming_change,
                                      tc_editor_baton->old_version,
                                      tc_editor_baton->new_version,
                                      b->db, wcroot,
@@ -716,6 +712,15 @@ svn_wc__db_update_moved_away_conflict_vi
   struct update_moved_away_conflict_victim_baton b;
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
+  svn_wc_operation_t operation;
+  svn_wc_conflict_reason_t local_change;
+  svn_wc_conflict_action_t incoming_change;
+  svn_wc_conflict_version_t *old_version;
+  svn_wc_conflict_version_t *new_version;
+
+  SVN_ERR(get_tc_info(&operation, &local_change, &incoming_change,
+                      &old_version, &new_version,
+                      victim_abspath, db, scratch_pool, scratch_pool));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, victim_abspath,
@@ -724,6 +729,11 @@ svn_wc__db_update_moved_away_conflict_vi
 
   b.work_items = work_items;
   b.victim_relpath = local_relpath;
+  b.operation = operation;
+  b.local_change = local_change;
+  b.incoming_change = incoming_change;
+  b.old_version = old_version;
+  b.new_version = new_version;
   b.db = db;
   b.notify_func = notify_func;
   b.notify_baton = notify_baton;