subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1689076 - in /subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer: analyze-cmd.c logic.c mergeinfo-normalizer.h wc_mergeinfo.c
Date Fri, 03 Jul 2015 19:57:56 GMT
Author: stefan2
Date: Fri Jul  3 19:57:56 2015
New Revision: 1689076

URL: http://svn.apache.org/r1689076
Log:
On the svn-mergeinfo-normalizer branch:
Minor refactoring removing redundant access to mergeinfo.

* tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
  (svn_min__get_mergeinfo_pair): Rename to ...
  (svn_min__get_parent_mergeinfo): ... this and don't return the sub-tree
                                   mergeinfo anymore.

* tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
  (svn_min__get_mergeinfo_pair,
   svn_min__get_parent_mergeinfo): Update implementation.

* tools/client-side/svn-mergeinfo-normalizer/analyze-cmd.c
  (analyze): Update caller. Assign the sub-tree mergeinfo only once.

* tools/client-side/svn-mergeinfo-normalizer/logic.c
  (normalize): Update caller.

Modified:
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/analyze-cmd.c
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
    subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/analyze-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/analyze-cmd.c?rev=1689076&r1=1689075&r2=1689076&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/analyze-cmd.c
(original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/analyze-cmd.c
Fri Jul  3 19:57:56 2015
@@ -295,9 +295,9 @@ analyze(svn_ra_session_t *session,
       svn_mergeinfo_t subtree_mergeinfo;
       svn_mergeinfo_t obsolete;
 
-      if (svn_min__get_mergeinfo_pair(&parent_path, &relpath,
-                                      &parent_mergeinfo, &subtree_mergeinfo,
-                                      wc_mergeinfo, i))
+      subtree_mergeinfo = svn_min__get_mergeinfo(wc_mergeinfo, i);
+      if (svn_min__get_parent_mergeinfo(&parent_path, &relpath,
+                                        &parent_mergeinfo, wc_mergeinfo, i))
         {
           SVN_ERR(svn_cmdline_printf(iterpool,
                                      _("Trying to elide mergeinfo from path\n"

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c?rev=1689076&r1=1689075&r2=1689076&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c
(original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c
Fri Jul  3 19:57:56 2015
@@ -314,15 +314,14 @@ normalize(apr_array_header_t *wc_mergein
       progress.nodes_todo = i;
 
       /* Quickly eliminate entries for known deleted branches. */
-      SVN_ERR(remove_obsolete_lines(lookup,
-                                    svn_min__get_mergeinfo(wc_mergeinfo, i),
-                                    opt_state, &progress, TRUE, iterpool));
+      subtree_mergeinfo = svn_min__get_mergeinfo(wc_mergeinfo, i);
+      SVN_ERR(remove_obsolete_lines(lookup, subtree_mergeinfo, opt_state,
+                                    &progress, TRUE, iterpool));
 
       /* Eliminate redundant sub-node mergeinfo. */
       if (opt_state->remove_redundants &&
-          svn_min__get_mergeinfo_pair(&parent_path, &relpath,
-                                      &parent_mergeinfo, &subtree_mergeinfo,
-                                      wc_mergeinfo, i))
+          svn_min__get_parent_mergeinfo(&parent_path, &relpath,
+                                        &parent_mergeinfo, wc_mergeinfo, i))
         {
           svn_mergeinfo_t parent_mergeinfo_copy;
           svn_mergeinfo_t subtree_mergeinfo_copy;
@@ -333,6 +332,7 @@ normalize(apr_array_header_t *wc_mergein
                                         opt_state, &progress, TRUE,
                                         iterpool));
 
+          /* Try to elide the mergeinfo for all branches. */
           parent_mergeinfo_copy = svn_mergeinfo_dup(parent_mergeinfo,
                                                     iterpool);
           subtree_mergeinfo_copy = svn_mergeinfo_dup(subtree_mergeinfo,
@@ -365,13 +365,12 @@ normalize(apr_array_header_t *wc_mergein
          Even then, we almost certainly already cached the necessary info
          in LOOKUP.  Still, because this is the final reduction for this
          node, we allow repository lookups if need be. */
-      SVN_ERR(remove_obsolete_lines(lookup,
-                                    svn_min__get_mergeinfo(wc_mergeinfo, i),
-                                    opt_state, &progress, FALSE, iterpool));
+      SVN_ERR(remove_obsolete_lines(lookup, subtree_mergeinfo, opt_state,
+                                    &progress, FALSE, iterpool));
 
       /* Reduce the number of remaining ranges. */
-      SVN_ERR(shorten_lines(svn_min__get_mergeinfo(wc_mergeinfo, i), log,
-                            opt_state, &progress, iterpool));
+      SVN_ERR(shorten_lines(subtree_mergeinfo, log, opt_state, &progress,
+                            iterpool));
 
       /* Print progress info. */
       if (!opt_state->quiet && i % 100 == 0)

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h?rev=1689076&r1=1689075&r2=1689076&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
(original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
Fri Jul  3 19:57:56 2015
@@ -137,12 +137,11 @@ svn_min__get_mergeinfo_path(apr_array_he
                             int idx);
 
 svn_boolean_t
-svn_min__get_mergeinfo_pair(const char **parent_path,
-                            const char **subtree_relpath,
-                            svn_mergeinfo_t *parent_mergeinfo,
-                            svn_mergeinfo_t *subtree_mergeinfo,
-                            apr_array_header_t *mergeinfo,
-                            int idx);
+svn_min__get_parent_mergeinfo(const char **parent_path,
+                              const char **subtree_relpath,
+                              svn_mergeinfo_t *parent_mergeinfo,
+                              apr_array_header_t *mergeinfo,
+                              int idx);
 
 svn_error_t *
 svn_min__write_mergeinfo(svn_min__cmd_baton_t *baton,

Modified: subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c?rev=1689076&r1=1689075&r2=1689076&view=diff
==============================================================================
--- subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
(original)
+++ subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
Fri Jul  3 19:57:56 2015
@@ -235,12 +235,11 @@ svn_min__common_parent(apr_array_header_
 }
 
 svn_boolean_t
-svn_min__get_mergeinfo_pair(const char **parent_path,
-                            const char **subtree_relpath,
-                            svn_mergeinfo_t *parent_mergeinfo,
-                            svn_mergeinfo_t *subtree_mergeinfo,
-                            apr_array_header_t *mergeinfo,
-                            int idx)
+svn_min__get_parent_mergeinfo(const char **parent_path,
+                              const char **subtree_relpath,
+                              svn_mergeinfo_t *parent_mergeinfo,
+                              apr_array_header_t *mergeinfo,
+                              int idx)
 {
   mergeinfo_t *entry;
   if (idx < 0 || mergeinfo->nelts <= idx)
@@ -254,7 +253,6 @@ svn_min__get_mergeinfo_pair(const char *
   *subtree_relpath = svn_dirent_skip_ancestor(entry->parent->local_path,
                                               entry->local_path);
   *parent_mergeinfo = entry->parent->mergeinfo;
-  *subtree_mergeinfo = entry->mergeinfo;
 
   return TRUE;
 }



Mime
View raw message