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/12/21 12:36:27 UTC

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

Author: stsp
Date: Wed Dec 21 12:36:27 2016
New Revision: 1775407

URL: http://svn.apache.org/viewvc?rev=1775407&view=rev
Log:
* subversion/libsvn_client/conflicts.c
  (find_nested_moves): Add all ambiguous nested moves to the list of moves in
   a revision, instead of adding just the first ambiguous nested move found.
   Resolves a TODO comment.

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=1775407&r1=1775406&r2=1775407&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Wed Dec 21 12:36:27 2016
@@ -654,7 +654,7 @@ find_nested_moves(apr_array_header_t *mo
       const char *moved_along_repos_relpath;
       struct repos_move_info *move;
       apr_array_header_t *copies_with_same_source_path;
-      struct copy_info *copy;
+      int j;
       svn_boolean_t related;
 
       svn_pool_clear(iterpool);
@@ -680,34 +680,37 @@ find_nested_moves(apr_array_header_t *mo
       copies_with_same_source_path = svn_hash_gets(copies,
                                                    moved_along_repos_relpath);
       if (copies_with_same_source_path == NULL)
-        continue;
-
-      if (copies_with_same_source_path->nelts > 1)
-        continue; /* ### handle ambiguity! */
+        continue; /* not a nested move */
 
-      copy = APR_ARRAY_IDX(copies_with_same_source_path, 0, struct copy_info *);
-      SVN_ERR(check_move_ancestry(&related, ra_session, repos_root_url,
-                                  moved_along_repos_relpath,
-                                  revision,
-                                  copy->copyfrom_path,
-                                  copy->copyfrom_rev,
-                                  TRUE, iterpool));
-      if (related)
+      for (j = 0; j < copies_with_same_source_path->nelts; j++)
         {
-          struct repos_move_info *nested_move;
+          struct copy_info *copy;
 
-          /* Remember details of this move. */
-          SVN_ERR(add_new_move(&nested_move, moved_along_repos_relpath,
-                               copy->copyto_path, copy->copyfrom_rev,
-                               revision, author->data, moved_paths,
-                               ra_session, repos_root_url,
-                               result_pool, iterpool));
-
-          /* Add this move to the list of nested moves in this revision. */
-          APR_ARRAY_PUSH(nested_moves, struct repos_move_info *) = nested_move;
+          copy = APR_ARRAY_IDX(copies_with_same_source_path, j,
+                               struct copy_info *);
+          SVN_ERR(check_move_ancestry(&related, ra_session, repos_root_url,
+                                      moved_along_repos_relpath,
+                                      revision,
+                                      copy->copyfrom_path,
+                                      copy->copyfrom_rev,
+                                      TRUE, iterpool));
+          if (related)
+            {
+              struct repos_move_info *nested_move;
+
+              /* Remember details of this move. */
+              SVN_ERR(add_new_move(&nested_move, moved_along_repos_relpath,
+                                   copy->copyto_path, copy->copyfrom_rev,
+                                   revision, author->data, moved_paths,
+                                   ra_session, repos_root_url,
+                                   result_pool, iterpool));
+
+              /* Add this move to the list of nested moves in this revision. */
+              APR_ARRAY_PUSH(nested_moves, struct repos_move_info *) =
+                nested_move;
+            }
         }
     }
-
   svn_pool_destroy(iterpool);
 
   /* Add all nested moves found to the list of all moves in this revision. */