You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/03/27 20:33:37 UTC

svn commit: r1461820 - /subversion/trunk/subversion/libsvn_client/resolved.c

Author: julianfoad
Date: Wed Mar 27 19:33:37 2013
New Revision: 1461820

URL: http://svn.apache.org/r1461820
Log:
* subversion/libsvn_client/resolved.c
  (svn_client__resolve_conflicts): Iterate over the paths in sorted order,
    so as to be friendly to human user especially for interactive resolution.

Modified:
    subversion/trunk/subversion/libsvn_client/resolved.c

Modified: subversion/trunk/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolved.c?rev=1461820&r1=1461819&r2=1461820&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/resolved.c (original)
+++ subversion/trunk/subversion/libsvn_client/resolved.c Wed Mar 27 19:33:37 2013
@@ -27,6 +27,8 @@
 
 /*** Includes. ***/
 
+#include <stdlib.h>
+
 #include "svn_types.h"
 #include "svn_wc.h"
 #include "svn_client.h"
@@ -34,6 +36,8 @@
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
 #include "svn_pools.h"
+#include "svn_hash.h"
+#include "svn_sorts.h"
 #include "client.h"
 #include "private/svn_wc_private.h"
 
@@ -48,16 +52,19 @@ svn_client__resolve_conflicts(svn_boolea
                               apr_pool_t *scratch_pool)
 {
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-  apr_hash_index_t *hi;
+  apr_array_header_t *array;
+  int i;
 
   if (conflicts_remain)
     *conflicts_remain = FALSE;
 
-  for (hi = (conflicted_paths
-             ? apr_hash_first(scratch_pool, conflicted_paths) : NULL);
-       hi; hi = apr_hash_next(hi))
+  SVN_ERR(svn_hash_keys(&array, conflicted_paths, scratch_pool));
+  qsort(array->elts, array->nelts, array->elt_size,
+        svn_sort_compare_paths);
+
+  for (i = 0; i < array->nelts; i++)
     {
-      const char *local_abspath = svn__apr_hash_index_key(hi);
+      const char *local_abspath = APR_ARRAY_IDX(array, i, const char *);
 
       svn_pool_clear(iterpool);
       SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,