You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/06/23 12:29:46 UTC

svn commit: r1604733 - in /subversion/branches/1.8.x-r1589360: ./ subversion/include/private/svn_diff_private.h subversion/libsvn_diff/util.c

Author: rhuijben
Date: Mon Jun 23 10:29:46 2014
New Revision: 1604733

URL: http://svn.apache.org/r1604733
Log:
Merge r1589360 from trunk, fixing include for 1.8.x

Modified:
    subversion/branches/1.8.x-r1589360/   (props changed)
    subversion/branches/1.8.x-r1589360/subversion/include/private/svn_diff_private.h
    subversion/branches/1.8.x-r1589360/subversion/libsvn_diff/util.c

Propchange: subversion/branches/1.8.x-r1589360/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1589360

Modified: subversion/branches/1.8.x-r1589360/subversion/include/private/svn_diff_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1589360/subversion/include/private/svn_diff_private.h?rev=1604733&r1=1604732&r2=1604733&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1589360/subversion/include/private/svn_diff_private.h (original)
+++ subversion/branches/1.8.x-r1589360/subversion/include/private/svn_diff_private.h Mon Jun 23 10:29:46 2014
@@ -97,7 +97,7 @@ svn_diff__unidiff_write_header(svn_strea
  * merged or reverse merged; otherwise (or if the mergeinfo property values
  * don't parse correctly) display them just like any other property.
  *
- * Use @a pool for temporary allocations.
+ * Use @a scratch_pool for temporary allocations.
  */
 svn_error_t *
 svn_diff__display_prop_diffs(svn_stream_t *outstream,
@@ -105,7 +105,7 @@ svn_diff__display_prop_diffs(svn_stream_
                              const apr_array_header_t *propchanges,
                              apr_hash_t *original_props,
                              svn_boolean_t pretty_print_mergeinfo,
-                             apr_pool_t *pool);
+                             apr_pool_t *scratch_pool);
 
 
 #ifdef __cplusplus

Modified: subversion/branches/1.8.x-r1589360/subversion/libsvn_diff/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1589360/subversion/libsvn_diff/util.c?rev=1604733&r1=1604732&r2=1604733&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1589360/subversion/libsvn_diff/util.c (original)
+++ subversion/branches/1.8.x-r1589360/subversion/libsvn_diff/util.c Mon Jun 23 10:29:46 2014
@@ -34,6 +34,7 @@
 #include "svn_diff.h"
 #include "svn_types.h"
 #include "svn_ctype.h"
+#include "svn_sorts.h"
 #include "svn_utf.h"
 #include "svn_version.h"
 
@@ -486,23 +487,37 @@ display_mergeinfo_diff(const char *old_m
   return SVN_NO_ERROR;
 }
 
+/* svn_sort__array callback handling svn_prop_t by name */
+static int
+propchange_sort(const void *k1, const void *k2)
+{
+  const svn_prop_t *propchange1 = k1;
+  const svn_prop_t *propchange2 = k2;
+
+  return strcmp(propchange1->name, propchange2->name);
+}
+
 svn_error_t *
 svn_diff__display_prop_diffs(svn_stream_t *outstream,
                              const char *encoding,
                              const apr_array_header_t *propchanges,
                              apr_hash_t *original_props,
                              svn_boolean_t pretty_print_mergeinfo,
-                             apr_pool_t *pool)
+                             apr_pool_t *scratch_pool)
 {
+  apr_pool_t *pool = scratch_pool;
   apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_array_header_t *changes = apr_array_copy(scratch_pool, propchanges);
   int i;
 
-  for (i = 0; i < propchanges->nelts; i++)
+  svn_sort__array(changes, propchange_sort);
+
+  for (i = 0; i < changes->nelts; i++)
     {
       const char *action;
       const svn_string_t *original_value;
       const svn_prop_t *propchange
-        = &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
+        = &APR_ARRAY_IDX(changes, i, svn_prop_t);
 
       if (original_props)
         original_value = svn_hash_gets(original_props, propchange->name);