aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_diff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2015-08-09 04:37:39 +0000
committerPeter Wemm <peter@FreeBSD.org>2015-08-09 04:37:39 +0000
commit58218291fa73a17020ef0447398e9e8a78f9e8c7 (patch)
tree78a13bd0acf7405df6eb6ca94a4e354d124065a6 /subversion/libsvn_diff
parent6f0665939667af9f780762878fc35982e8b7d745 (diff)
downloadsrc-58218291fa73a17020ef0447398e9e8a78f9e8c7.tar.gz
src-58218291fa73a17020ef0447398e9e8a78f9e8c7.zip
Vendor import subversion-1.8.14vendor/subversion/subversion-1.8.14
Notes
Notes: svn path=/vendor/subversion/dist/; revision=286501 svn path=/vendor/subversion/subversion-1.8.14/; revision=286502; tag=vendor/subversion/subversion-1.8.14
Diffstat (limited to 'subversion/libsvn_diff')
-rw-r--r--subversion/libsvn_diff/parse-diff.c1
-rw-r--r--subversion/libsvn_diff/util.c21
2 files changed, 19 insertions, 3 deletions
diff --git a/subversion/libsvn_diff/parse-diff.c b/subversion/libsvn_diff/parse-diff.c
index a01b4d52743b..e269ef925b38 100644
--- a/subversion/libsvn_diff/parse-diff.c
+++ b/subversion/libsvn_diff/parse-diff.c
@@ -1313,6 +1313,7 @@ svn_diff_parse_next_patch(svn_patch_t **patch,
line_after_tree_header_read = TRUE;
}
else if (! valid_header_line && state != state_start
+ && state != state_git_diff_seen
&& !starts_with(line->data, "index "))
{
/* We've encountered an invalid diff header.
diff --git a/subversion/libsvn_diff/util.c b/subversion/libsvn_diff/util.c
index 9e1f41176e54..412b20be1f95 100644
--- a/subversion/libsvn_diff/util.c
+++ b/subversion/libsvn_diff/util.c
@@ -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_mergeinfo_val,
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);