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 2016/03/08 11:09:07 UTC

svn commit: r1734043 - /subversion/trunk/subversion/libsvn_client/conflicts.c

Author: stsp
Date: Tue Mar  8 10:09:07 2016
New Revision: 1734043

URL: http://svn.apache.org/viewvc?rev=1734043&view=rev
Log:
Tweak a baton data structure in the conflict resolver.

* subversion/libsvn_client/conflicts.c
  (find_added_rev_baton): Don't store all conflict details in here, only
   what's actually needed.
  (find_added_rev): Adjust accordingly. 
  (conflict_tree_get_details_incoming_delete): Adjust as well, fixing a
   bug where the wrong repos_relpath was copied into conflict details.

Modified:
    subversion/trunk/subversion/libsvn_client/conflicts.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1734043&r1=1734042&r2=1734043&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Mar  8 10:09:07 2016
@@ -856,7 +856,8 @@ conflict_tree_get_description_incoming_d
 /* Baton for find_added_rev(). */
 struct find_added_rev_baton
 {
-  struct conflict_tree_incoming_delete_details *details;
+  svn_revnum_t added_rev;
+  const char *repos_relpath;
   apr_pool_t *pool;
 };
 
@@ -872,8 +873,8 @@ find_added_rev(svn_location_segment_t *s
 
   if (segment->path) /* not interested in gaps */
     {
-      b->details->added_rev = segment->range_start;
-      b->details->repos_relpath = apr_pstrdup(b->pool, segment->path);
+      b->added_rev = segment->range_start;
+      b->repos_relpath = apr_pstrdup(b->pool, segment->path);
     }
 
   return SVN_NO_ERROR;
@@ -1060,19 +1061,20 @@ conflict_tree_get_details_incoming_delet
                                                        scratch_pool));
 
           details = apr_pcalloc(conflict->pool, sizeof(*details));
-          b.details = details;
+          b.added_rev = SVN_INVALID_REVNUM;
+          b.repos_relpath = NULL;
           b.pool = scratch_pool;
           /* Figure out when this node was added. */
           SVN_ERR(svn_ra_get_location_segments(ra_session, "", old_rev,
                                                old_rev, new_rev,
                                                find_added_rev, &b,
                                                scratch_pool));
-          SVN_ERR(svn_ra_rev_prop(ra_session, details->added_rev,
+          SVN_ERR(svn_ra_rev_prop(ra_session, b.added_rev,
                                   SVN_PROP_REVISION_AUTHOR,
                                   &author_revprop, scratch_pool));
           details->deleted_rev = SVN_INVALID_REVNUM;
-          details->repos_relpath = apr_pstrdup(conflict->pool,
-                                               new_repos_relpath);
+          details->added_rev = b.added_rev;
+          details->repos_relpath = apr_pstrdup(conflict->pool, b.repos_relpath);
           details->rev_author = apr_pstrdup(conflict->pool,
                                             author_revprop->data);
           /* Check for replacement. */
@@ -1188,7 +1190,8 @@ conflict_tree_get_details_incoming_delet
                                                        scratch_pool));
 
           details = apr_pcalloc(conflict->pool, sizeof(*details));
-          b.details = details;
+          b.added_rev = SVN_INVALID_REVNUM;
+          b.repos_relpath = NULL;
           b.pool = scratch_pool;
           /* Figure out when the node we switched away from, or merged
            * from another branch, was added. */
@@ -1196,12 +1199,12 @@ conflict_tree_get_details_incoming_delet
                                                old_rev, new_rev,
                                                find_added_rev, &b,
                                                scratch_pool));
-          SVN_ERR(svn_ra_rev_prop(ra_session, details->added_rev,
+          SVN_ERR(svn_ra_rev_prop(ra_session, b.added_rev,
                                   SVN_PROP_REVISION_AUTHOR,
                                   &author_revprop, scratch_pool));
           details->deleted_rev = SVN_INVALID_REVNUM;
-          details->repos_relpath = apr_pstrdup(conflict->pool,
-                                               new_repos_relpath);
+          details->added_rev = b.added_rev;
+          details->repos_relpath = apr_pstrdup(conflict->pool, b.repos_relpath);
           details->rev_author = apr_pstrdup(conflict->pool,
                                             author_revprop->data);
           /* Check for replacement. */