subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1696086 - /subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/logic.c
Date Sat, 15 Aug 2015 18:36:29 GMT
Author: stefan2
Date: Sat Aug 15 18:36:29 2015
New Revision: 1696086

URL: http://svn.apache.org/r1696086
Log:
Our handling of mergeinfo produces some odd entries when mergeing back
and forth between branches while adding sub-tree m/i on new nodes.

For instance, m/i on ^/subversion/trunk/subversion/tests/libsvn_fs_x
contains an entry for ^/subversion/trunk/subversion/tests/libsvn_fs_x,
i.e. itself.

This patch makes svn-mergeinfo-normalizer able to elide these if they are
actually redundant.

* tools/client-side/svn-mergeinfo-normalizer/logic.c
  (remove_lines): Even if there is no matching parent m/i, a branch entry
                  may be completely redundant or non-operative.

Modified:
    subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/logic.c

Modified: subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/logic.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/logic.c?rev=1696086&r1=1696085&r2=1696086&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/logic.c (original)
+++ subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/logic.c Sat Aug 15 18:36:29
2015
@@ -881,11 +881,41 @@ remove_lines(svn_min__log_t *log,
                                        opt_state, NULL, FALSE, FALSE,
                                        iterpool));
 
-          /* If still relevant, we need to keep the whole m/i on this node.
-             Therefore, report the problem. */
-          if (state != ds_deleted)
-            SVN_ERR(show_missing_parent(subtree_path, !*parent_path,
-                                        opt_state, scratch_pool));
+          if (state == ds_deleted)
+            continue;
+
+          /* Find revs that are missing in the sub-tree- m/i but affect
+             paths in the sub-tree. */
+          subtree_only = subtree_ranges;
+          operative_in_subtree
+            = svn_min__operative(log, subtree_path, subtree_only, iterpool);
+          SVN_ERR(remove_overlapping_history(&implied_in_subtree,
+                                             &operative_in_subtree, log,
+                                             subtree_path, fs_path,
+                                             iterpool, iterpool));
+
+          if (operative_in_subtree->nelts)
+            {
+              /* If still relevant, we need to keep the whole m/i on this
+                 node.  Therefore, report the problem. */
+              SVN_ERR(show_missing_parent(subtree_path, !*parent_path,
+                                          opt_state, scratch_pool));
+            }
+          else
+            {
+              /* This branch entry is some sort of artefact that doesn't
+                 refer to any actual changes and can therefore be removed.
+                 Report why that is. */
+              apr_array_header_t *empty = operative_in_subtree;
+              SVN_ERR(svn_rangelist_remove(&subtree_only, implied_in_subtree,
+                                           subtree_only, TRUE, iterpool));
+              SVN_ERR(show_branch_elision(subtree_path, empty,
+                                          subtree_only, empty, empty, empty,
+                                          implied_in_subtree, opt_state,
+                                          iterpool));
+
+              svn_hash_sets(subtree_mergeinfo, subtree_path, NULL);
+            }
 
           continue;
         }



Mime
View raw message