subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1689550 - in /subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer: logic.c mergeinfo-normalizer.h wc_mergeinfo.c
Date Tue, 07 Jul 2015 01:21:20 GMT
Author: stefan2
Date: Tue Jul  7 01:21:19 2015
New Revision: 1689550

URL: http://svn.apache.org/r1689550
Log:
On the svn-mergeinfo-normalizer branch:
Show the correct results in "dry-run" mode as well.

* tools/client-side/svn-mergeinfo-normalizer/mergeinfo-normalizer.h
  (svn_min__remove_empty_mergeinfo): Declare new utility.

* tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
  (svn_min__write_mergeinfo): Don't modify the mergeinfo here.
  (svn_min__remove_empty_mergeinfo): Do it here instead.

* tools/client-side/svn-mergeinfo-normalizer/logic.c
  (svn_min__run_normalize): Even if we don't write to w/c, update the
                            mergeinfo count.

Modified:
    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/logic.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-mergeinfo-normalizer/tools/client-side/svn-mergeinfo-normalizer/logic.c?rev=1689550&r1=1689549&r2=1689550&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
Tue Jul  7 01:21:19 2015
@@ -834,7 +834,9 @@ svn_min__run_normalize(apr_getopt_t *os,
 
       /* write results to disk */
       svn_pool_clear(subpool);
-      if (!cmd_baton->opt_state->dry_run)
+      if (cmd_baton->opt_state->dry_run)
+        SVN_ERR(svn_min__remove_empty_mergeinfo(wc_mergeinfo));
+      else
         SVN_ERR(svn_min__write_mergeinfo(cmd_baton, wc_mergeinfo, subpool));
 
       /* show results */

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=1689550&r1=1689549&r2=1689550&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
Tue Jul  7 01:21:19 2015
@@ -152,6 +152,9 @@ svn_min__write_mergeinfo(svn_min__cmd_ba
                          apr_pool_t *scratch_pool);
 
 svn_error_t *
+svn_min__remove_empty_mergeinfo(apr_array_header_t *mergeinfo);
+
+svn_error_t *
 svn_min__print_mergeinfo_stats(apr_array_header_t *wc_mergeinfo,
                                apr_pool_t *scratch_pool);
 

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=1689550&r1=1689549&r2=1689550&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
Tue Jul  7 01:21:19 2015
@@ -294,7 +294,6 @@ svn_min__write_mergeinfo(svn_min__cmd_ba
 
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   int i;
-  int dest;
 
   for (i = 0, dest = 0; i < mergeinfo->nelts; ++i)
     {
@@ -314,7 +313,22 @@ svn_min__write_mergeinfo(svn_min__cmd_ba
       SVN_ERR(svn_client_propset_local(SVN_PROP_MERGEINFO, propval, targets,
                                        svn_depth_empty, FALSE, NULL, ctx,
                                        iterpool));
+    }
+
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
 
+svn_error_t *
+svn_min__remove_empty_mergeinfo(apr_array_header_t *mergeinfo)
+{
+  int i;
+  int dest;
+
+  for (i = 0, dest = 0; i < mergeinfo->nelts; ++i)
+    {
+      mergeinfo_t *entry = APR_ARRAY_IDX(mergeinfo, i, mergeinfo_t *);
       if (apr_hash_count(entry->mergeinfo))
         {
           APR_ARRAY_IDX(mergeinfo, dest, mergeinfo_t *) = entry;
@@ -323,7 +337,6 @@ svn_min__write_mergeinfo(svn_min__cmd_ba
     }
 
   mergeinfo->nelts = dest;
-  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }



Mime
View raw message