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 2018/06/19 13:33:58 UTC

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

Author: stsp
Date: Tue Jun 19 13:33:58 2018
New Revision: 1833842

URL: http://svn.apache.org/viewvc?rev=1833842&view=rev
Log:
Follow-up to r1833836:

* subversion/libsvn_client/conflicts.c
  (conflict_tree_get_details_local_missing): Ensure start_rev > end_rev
   when calling find_revision_for_suspected_deletion(). The code I moved
   up in r1833836 was bounds-checking end_rev against related_peg_rev,
   but the start_rev is parent_pegrev in this case.

   Restore a bounds check against related_peg_rev which was present
   before r1833836 and is needed for find_moves_in_natural_history().

   Problem caught by merge_tree_conflict_tests.py 2: "merge should
   not die if a target file is absent"

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=1833842&r1=1833841&r2=1833842&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Jun 19 13:33:58 2018
@@ -2684,10 +2684,10 @@ conflict_tree_get_details_local_missing(
    {
      end_rev = yca_loc->rev;
 
-    /* END_REV must be smaller than RELATED_PEG_REV, else the call
-       to find_moves_in_natural_history() below will error out. */
-    if (end_rev >= related_peg_rev)
-      end_rev = related_peg_rev > 0 ? related_peg_rev - 1 : 0;
+    /* END_REV must be smaller than PARENT_PEG_REV, else the call to
+     * find_revision_for_suspected_deletion() below will abort. */
+    if (end_rev >= parent_peg_rev)
+      end_rev = parent_peg_rev > 0 ? parent_peg_rev - 1 : 0;
    }
   else
     end_rev = 0; /* ### We might walk through all of history... */
@@ -2709,6 +2709,18 @@ conflict_tree_get_details_local_missing(
 
       victim_abspath = svn_client_conflict_get_local_abspath(conflict);
 
+      if (yca_loc)
+       {
+          end_rev = yca_loc->rev;
+
+          /* END_REV must be smaller than RELATED_PEG_REV, else the call
+             to find_moves_in_natural_history() below will error out. */
+          if (end_rev >= related_peg_rev)
+            end_rev = related_peg_rev > 0 ? related_peg_rev - 1 : 0;
+       }
+      else
+        end_rev = 0; /* ### We might walk through all of history... */
+
       SVN_ERR(svn_ra_check_path(ra_session, "", related_peg_rev,
                                 &related_node_kind, scratch_pool));
       SVN_ERR(find_moves_in_natural_history(&sibling_moves,