Author: svn-role
Date: Thu Nov 20 04:00:42 2014
New Revision: 1640659
URL: http://svn.apache.org/r1640659
Log:
Merge the 1.8.x-r1589360 branch:
* r1589360
Make property output in 'svn diff' stable
Justification:
Local change that makes it easier to compare patch files.
Branch:
^/subversion/branches/1.8.x-r1589360
Votes:
+1: ivan, rhuijben, stefan2
Modified:
subversion/branches/1.8.x/ (props changed)
subversion/branches/1.8.x/STATUS
subversion/branches/1.8.x/subversion/include/private/svn_diff_private.h
subversion/branches/1.8.x/subversion/libsvn_diff/util.c
Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1589360
Merged /subversion/branches/1.8.x-r1589360:r1604732-1640658
Modified: subversion/branches/1.8.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1640659&r1=1640658&r2=1640659&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu Nov 20 04:00:42 2014
@@ -147,15 +147,6 @@ Veto-blocked changes:
Approved changes:
=================
- * r1589360
- Make property output in 'svn diff' stable
- Justification:
- Local change that makes it easier to compare patch files.
- Branch:
- ^/subversion/branches/1.8.x-r1589360
- Votes:
- +1: ivan, rhuijben, stefan2
-
* r1620332
Remove broken conflict resolver menu options.
Justification:
@@ -205,5 +196,3 @@ Approved changes:
^/subversion/branches/1.8.x-r1611379
Votes:
+1: julianfoad, rhuijben, stefan2
-
-
Modified:
subversion/branches/1.8.x/subversion/include/private/svn_diff_private.h
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/include/private/svn_diff_private.h?rev=1640659&r1=1640658&r2=1640659&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/include/private/svn_diff_private.h
(original)
+++ subversion/branches/1.8.x/subversion/include/private/svn_diff_private.h Thu
Nov 20 04:00:42 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/subversion/libsvn_diff/util.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_diff/util.c?rev=1640659&r1=1640658&r2=1640659&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_diff/util.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_diff/util.c Thu Nov 20 04:00:42
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;
}
+/* qsort 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++)
+ qsort(changes->elts, changes->nelts, changes->elt_size, 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);