svn commit: r1764271 - /subversion/trunk/subversion/libsvn_client/conflicts.c

2016-10-11 Thread kotkov
Author: kotkov
Date: Tue Oct 11 15:38:36 2016
New Revision: 1764271

URL: http://svn.apache.org/viewvc?rev=1764271=rev
Log:
* subversion/libsvn_client/conflicts.c
  (check_move_ancestry): Explicitly initialize the output argument in
   all cases, to make the code a bit clearer.

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

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1764271=1764270=1764271=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Oct 11 15:38:36 
2016
@@ -295,8 +295,6 @@ check_move_ancestry(svn_boolean_t *relat
   apr_array_header_t *location_revisions;
   svn_dirent_t *dirent;
 
-  *related = FALSE;
-
   location_revisions = apr_array_make(scratch_pool, 1, sizeof(svn_revnum_t));
   APR_ARRAY_PUSH(location_revisions, svn_revnum_t) = copyfrom_rev;
   deleted_url = svn_uri_canonicalize(apr_pstrcat(scratch_pool,
@@ -320,18 +318,26 @@ check_move_ancestry(svn_boolean_t *relat
   if (deleted_location[0] == '/')
 deleted_location++;
   if (strcmp(deleted_location, copyfrom_path) != 0)
-return SVN_NO_ERROR;
+{
+  *related = FALSE;
+  return SVN_NO_ERROR;
+}
 }
   else
-return SVN_NO_ERROR;
+{
+  *related = FALSE;
+  return SVN_NO_ERROR;
+}
 
   /* Verify that copyfrom_rev >= last-changed revision of the deleted node. */
   SVN_ERR(svn_ra_stat(ra_session, "", deleted_rev - 1, , scratch_pool));
   if (dirent == NULL || copyfrom_rev < dirent->created_rev)
-return SVN_NO_ERROR;
+{
+  *related = FALSE;
+  return SVN_NO_ERROR;
+}
 
   *related = TRUE;
-
   return SVN_NO_ERROR;
 }
 




svn commit: r1764272 - /subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 15:43:14 2016
New Revision: 1764272

URL: http://svn.apache.org/viewvc?rev=1764272=rev
Log:
On the resolve-incoming-add branch:

* subversion/libsvn_client/conflicts-test.c
  (test_merge_incoming_added_dir_merge2): Sync docstring with reality.

Modified:

subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c?rev=1764272=1764271=1764272=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 (original)
+++ 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 Tue Oct 11 15:43:14 2016
@@ -1216,8 +1216,7 @@ test_merge_incoming_added_dir_merge(cons
   return SVN_NO_ERROR;
 }
 
-/* Same test as above, but with an additional file change on the trunk
- * which makes resolution work as expected. */
+/* Same test as above, but with an additional file change on the trunk. */
 static svn_error_t *
 test_merge_incoming_added_dir_merge2(const svn_test_opts_t *opts,
  apr_pool_t *pool)




svn commit: r1764275 - /subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 15:51:26 2016
New Revision: 1764275

URL: http://svn.apache.org/viewvc?rev=1764275=rev
Log:
On the 'resolve-incoming-add' branch: Make an XFAIL test PASS.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_merge_incoming_added_dir_merge3): Fix this test to account for the
   nested 'add vs add' conflict on the file which was added on both the
   trunk and the branch. And stop testing for subtree-mergeinfo, since
   it's not clear yet whether and how this should be handled by the resolver.
  (test_func): Mark the above test as PASS.

Modified:

subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c?rev=1764275=1764274=1764275=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 (original)
+++ 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 Tue Oct 11 15:51:26 2016
@@ -1375,7 +1375,50 @@ test_merge_incoming_added_dir_merge3(con
   props_conflicted->nelts == 0 &&
   !tree_conflicted);
 
-  /* We should have a text conflict in the file. */
+  /* There should now be an 'add vs add' conflict on the new file. */
+  new_file_path = svn_relpath_join(branch_path,
+   svn_relpath_join(new_dir_name,
+new_file_name, b->pool),
+   b->pool);
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, new_file_path),
+  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_get_conflicted(_conflicted,
+ _conflicted,
+ _conflicted,
+ conflict, b->pool, b->pool));
+  SVN_TEST_ASSERT(!text_conflicted &&
+  props_conflicted->nelts == 0 &&
+  tree_conflicted);
+
+  /* Resolve the tree conflict. */
+  SVN_ERR(svn_test__create_client_ctx(, b, b->pool));
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, new_file_path),
+  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+conflict,
+svn_client_conflict_option_incoming_added_file_text_merge, ctx,
+b->pool));
+
+  /* Ensure that the file has the expected status. */
+  SVN_ERR(svn_client_status6(NULL, ctx, sbox_wc_path(b, new_file_path),
+ _rev, svn_depth_unknown, TRUE, TRUE,
+ TRUE, TRUE, FALSE, TRUE, NULL,
+ status_func, , b->pool));
+  status = sb.status;
+  SVN_TEST_ASSERT(status->kind == svn_node_file);
+  SVN_TEST_ASSERT(status->versioned);
+  SVN_TEST_ASSERT(status->conflicted);
+  SVN_TEST_ASSERT(status->node_status == svn_wc_status_conflicted);
+  SVN_TEST_ASSERT(status->text_status == svn_wc_status_conflicted);
+  SVN_TEST_ASSERT(status->prop_status == svn_wc_status_modified);
+  SVN_TEST_ASSERT(!status->copied);
+  SVN_TEST_ASSERT(!status->switched);
+  SVN_TEST_ASSERT(!status->file_external);
+  SVN_TEST_ASSERT(status->moved_from_abspath == NULL);
+  SVN_TEST_ASSERT(status->moved_to_abspath == NULL);
+
+  /* We should now have a text conflict in the file. */
   new_file_path = svn_relpath_join(branch_path,
svn_relpath_join(new_dir_name,
 new_file_name, b->pool),
@@ -1391,34 +1434,12 @@ test_merge_incoming_added_dir_merge3(con
   !tree_conflicted);
 
   /* Verify the file's merged property value. */
-  /* ### Shouldn't there be a property conflict? The branch wins. */
+  /* ### Shouldn't there be a property conflict? The trunk wins. */
   SVN_ERR(svn_wc_prop_get2(, ctx->wc_ctx,
sbox_wc_path(b, new_file_path),
"prop", b->pool, b->pool));
-  SVN_TEST_STRING_ASSERT(propval->data, propval_branch);
+  SVN_TEST_STRING_ASSERT(propval->data, propval_trunk);
 
-  /* XFAIL: Currently, no subtree mergeinfo is created.
-   *
-   * Verify the directory's subtree mergeinfo. It should mention both
-   * location segments of ^/A/newdir's history, shouldn't it? Like this:
-   *
-   *   /A/newdir:2-6
-   *   /newdir.orig:4
-   *
-   * ### /newdir.orig was created in r3 and moved to /A/newdir in r5.
-   * ### Should the second line say "/newdir.orig:3-4" instead? */
-  SVN_ERR(svn_wc_prop_get2(, ctx->wc_ctx,
-   sbox_wc_path(b, new_dir_path),
-

svn commit: r1764276 - /subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 15:58:13 2016
New Revision: 1764276

URL: http://svn.apache.org/viewvc?rev=1764276=rev
Log:
On the 'resolve-incoming-add' branch: Make an XFAIL test PASS.

* subversion/libsvn_client/conflicts.c
  (diff_dir_changed, diff_dir_deleted, diff_file_changed,
   diff_file_deleted): Remove SVN_DBG calls.
  

Modified:

subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c?rev=1764276=1764275=1764276=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
(original)
+++ 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
Tue Oct 11 15:58:13 2016
@@ -5752,8 +5752,6 @@ diff_dir_changed(const char *relpath,
   SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
 FALSE, FALSE, scratch_pool));
   SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-  SVN_DBG(("%s: %s (db: %s / disk: %s)\n", __func__, relpath,
-  svn_node_kind_to_word(db_kind), svn_node_kind_to_word(on_disk_kind)));
 
   if (db_kind != svn_node_dir)
 {
@@ -5794,11 +5792,6 @@ diff_dir_changed(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-  SVN_DBG(("%s: left source: %s@%lu\n", __func__,
-left_source->repos_relpath, left_source->revision));
-  SVN_DBG(("%s: right source: %s@%lu\n", __func__,
-right_source->repos_relpath, right_source->revision));
-
   return SVN_NO_ERROR;
 }
 
@@ -5821,8 +5814,6 @@ diff_dir_deleted(const char *relpath,
   SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
 FALSE, FALSE, scratch_pool));
   SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-  SVN_DBG(("%s: %s (db: %s / disk: %s)\n", __func__, relpath,
-  svn_node_kind_to_word(db_kind), svn_node_kind_to_word(on_disk_kind)));
 
   if (db_kind != svn_node_dir)
 {
@@ -5871,9 +5862,6 @@ diff_dir_deleted(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-  SVN_DBG(("%s: left source: %s@%lu\n", __func__,
-left_source->repos_relpath, left_source->revision));
-
   return SVN_NO_ERROR;
 }
 
@@ -5967,8 +5955,6 @@ diff_file_changed(const char *relpath,
 
   SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
 FALSE, FALSE, scratch_pool));
-  SVN_DBG(("%s: %s (db: %s / disk: %s)\n", __func__, relpath,
-  svn_node_kind_to_word(db_kind), svn_node_kind_to_word(on_disk_kind)));
   SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
 
   if (db_kind != svn_node_file)
@@ -6010,12 +5996,6 @@ diff_file_changed(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-  SVN_DBG(("%s: left source: %s@%lu\n", __func__,
-left_source->repos_relpath, left_source->revision));
-  SVN_DBG(("%s: right source: %s@%lu\n", __func__,
-right_source->repos_relpath, right_source->revision));
-  SVN_DBG(("%s: right file: %s\n", __func__, right_file));
-
   return SVN_NO_ERROR;
 }
 
@@ -6039,8 +6019,6 @@ diff_file_deleted(const char *relpath,
   SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
 FALSE, FALSE, scratch_pool));
   SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-  SVN_DBG(("%s: %s (db: %s / disk: %s)\n", __func__, relpath,
-  svn_node_kind_to_word(db_kind), svn_node_kind_to_word(on_disk_kind)));
 
   if (db_kind != svn_node_file)
 {
@@ -6089,9 +6067,6 @@ diff_file_deleted(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-  SVN_DBG(("%s: left source: %s@%lu\n", __func__,
-left_source->repos_relpath, left_source->revision));
-
   return SVN_NO_ERROR;
 }
 




svn commit: r1764279 - /subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 16:01:59 2016
New Revision: 1764279

URL: http://svn.apache.org/viewvc?rev=1764279=rev
Log:
On the 'resolve-incoming-add' branch: Make a FAILing test PASS again.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_merge_incoming_added_dir_merge2): Account for the nested
   'add vs add' tree conflict on the new file, and for the change
   in property conflict behaviour (to be investigated later).

Modified:

subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c?rev=1764279=1764278=1764279=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 (original)
+++ 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 Tue Oct 11 16:01:59 2016
@@ -1283,7 +1283,50 @@ test_merge_incoming_added_dir_merge2(con
   props_conflicted->nelts == 0 &&
   !tree_conflicted);
 
-  /* We should have a text conflict in the file. */
+  /* There should now be an 'add vs add' conflict on the new file. */
+  new_file_path = svn_relpath_join(branch_path,
+   svn_relpath_join(new_dir_name,
+new_file_name, b->pool),
+   b->pool);
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, new_file_path),
+  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_get_conflicted(_conflicted,
+ _conflicted,
+ _conflicted,
+ conflict, b->pool, b->pool));
+  SVN_TEST_ASSERT(!text_conflicted &&
+  props_conflicted->nelts == 0 &&
+  tree_conflicted);
+
+  /* Resolve the tree conflict. */
+  SVN_ERR(svn_test__create_client_ctx(, b, b->pool));
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, new_file_path),
+  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+conflict,
+svn_client_conflict_option_incoming_added_file_text_merge, ctx,
+b->pool));
+
+  /* Ensure that the file has the expected status. */
+  SVN_ERR(svn_client_status6(NULL, ctx, sbox_wc_path(b, new_file_path),
+ _rev, svn_depth_unknown, TRUE, TRUE,
+ TRUE, TRUE, FALSE, TRUE, NULL,
+ status_func, , b->pool));
+  status = sb.status;
+  SVN_TEST_ASSERT(status->kind == svn_node_file);
+  SVN_TEST_ASSERT(status->versioned);
+  SVN_TEST_ASSERT(status->conflicted);
+  SVN_TEST_ASSERT(status->node_status == svn_wc_status_conflicted);
+  SVN_TEST_ASSERT(status->text_status == svn_wc_status_conflicted);
+  SVN_TEST_ASSERT(status->prop_status == svn_wc_status_modified);
+  SVN_TEST_ASSERT(!status->copied);
+  SVN_TEST_ASSERT(!status->switched);
+  SVN_TEST_ASSERT(!status->file_external);
+  SVN_TEST_ASSERT(status->moved_from_abspath == NULL);
+  SVN_TEST_ASSERT(status->moved_to_abspath == NULL);
+
+  /* The file should now have a text conflict. */
   new_file_path = svn_relpath_join(branch_path,
svn_relpath_join(new_dir_name,
 new_file_name, b->pool),
@@ -1299,11 +1342,11 @@ test_merge_incoming_added_dir_merge2(con
   !tree_conflicted);
 
   /* Verify the file's merged property value. */
-  /* ### Shouldn't there be a property conflict? The branch wins. */
+  /* ### Shouldn't there be a property conflict? The trunk wins. */
   SVN_ERR(svn_wc_prop_get2(, ctx->wc_ctx,
sbox_wc_path(b, new_file_path),
"prop", b->pool, b->pool));
-  SVN_TEST_STRING_ASSERT(propval->data, propval_branch);
+  SVN_TEST_STRING_ASSERT(propval->data, propval_trunk);
 
   return SVN_NO_ERROR;
 }




svn commit: r1764284 - /subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 16:08:25 2016
New Revision: 1764284

URL: http://svn.apache.org/viewvc?rev=1764284=rev
Log:
On the 'resolve-incoming-add' branch: Remove unnecessary code.

* subversion/libsvn_client/conflicts.c
  (diff_dir_changed, diff_dir_deleted, diff_file_changed,
   diff_file_deleted): Remove. Since we're diffing an empty tree against
an added tree, these should never be invoked.
  (merge_newly_added_dir): Only set the diff processor callbacks we need.
   The diff processor already provides stubs for the rest.

Modified:

subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c?rev=1764284=1764283=1764284=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
(original)
+++ 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
Tue Oct 11 16:08:25 2016
@@ -5732,141 +5732,6 @@ diff_dir_added(const char *relpath,
 
 /* An svn_diff_tree_processor_t callback. */
 static svn_error_t *
-diff_dir_changed(const char *relpath,
- const svn_diff_source_t *left_source,
- const svn_diff_source_t *right_source,
- apr_hash_t *left_props,
- apr_hash_t *right_props,
- const apr_array_header_t *prop_changes,
- void *dir_baton,
- const struct svn_diff_tree_processor_t *processor,
- apr_pool_t *scratch_pool)
-{
-  struct merge_newly_added_dir_baton *b = processor->baton;
-  const char *local_abspath;
-  svn_node_kind_t db_kind;
-  svn_node_kind_t on_disk_kind;
-
-  local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
-
-  SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
-FALSE, FALSE, scratch_pool));
-  SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-
-  if (db_kind != svn_node_dir)
-{
-  SVN_ERR(raise_tree_conflict(
-local_abspath, svn_wc_conflict_action_edit,
-svn_wc_conflict_reason_obstructed,
-db_kind, svn_node_dir, svn_node_dir,
-b->repos_root_url, b->repos_uuid,
-svn_relpath_join(b->added_repos_relpath, relpath, 
scratch_pool),
-b->merge_left_rev, b->merge_right_rev,
-b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-  if (on_disk_kind == svn_node_none)
-{
-  SVN_ERR(raise_tree_conflict(
-local_abspath, svn_wc_conflict_action_edit,
-svn_wc_conflict_reason_missing, on_disk_kind,
-svn_node_dir, svn_node_dir, b->repos_root_url, b->repos_uuid,
-svn_relpath_join(b->added_repos_relpath, relpath, 
scratch_pool),
-b->merge_left_rev, b->merge_right_rev,
-b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-scratch_pool));
-  return SVN_NO_ERROR;
-}
-  else if (on_disk_kind != svn_node_dir)
-{
-  SVN_ERR(raise_tree_conflict(
-local_abspath, svn_wc_conflict_action_edit,
-svn_wc_conflict_reason_obstructed, on_disk_kind,
-svn_node_dir, svn_node_dir, b->repos_root_url, b->repos_uuid,
-svn_relpath_join(b->added_repos_relpath, relpath, 
scratch_pool),
-b->merge_left_rev, b->merge_right_rev,
-b->ctx->wc_ctx, b->ctx->notify_func2, b->ctx->notify_baton2,
-scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-  return SVN_NO_ERROR;
-}
-
-/* An svn_diff_tree_processor_t callback. */
-static svn_error_t *
-diff_dir_deleted(const char *relpath,
- const svn_diff_source_t *left_source,
- apr_hash_t *left_props,
- void *dir_baton,
- const struct svn_diff_tree_processor_t *processor,
- apr_pool_t *scratch_pool)
-{
-  struct merge_newly_added_dir_baton *b = processor->baton;
-  const char *local_abspath;
-  svn_node_kind_t db_kind;
-  svn_node_kind_t on_disk_kind;
-
-  local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
-
-  SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
-FALSE, FALSE, scratch_pool));
-  SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-
-  if (db_kind != svn_node_dir)
-{
-  svn_wc_conflict_reason_t local_change;
-
-  if (db_kind != svn_node_none && db_kind != svn_node_unknown)
-local_change = svn_wc_conflict_reason_obstructed;
-  else
-local_change = svn_wc_conflict_reason_missing;
-
-  

svn commit: r1764283 - in /subversion/trunk/subversion: libsvn_client/conflicts.c libsvn_wc/entries.c

2016-10-11 Thread luke1410
Author: luke1410
Date: Tue Oct 11 16:08:21 2016
New Revision: 1764283

URL: http://svn.apache.org/viewvc?rev=1764283=rev
Log:
Correct typos in comments.

* subversion/libsvn_wc/entries.c (write_entry): correct typo
* subversion/libsvn_client/conflicts.c (): correct typo

Obvious fix.

Modified:
subversion/trunk/subversion/libsvn_client/conflicts.c
subversion/trunk/subversion/libsvn_wc/entries.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1764283=1764282=1764283=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Oct 11 16:08:21 
2016
@@ -70,7 +70,7 @@ struct svn_client_conflict_t
   apr_hash_t *prop_conflicts;
 
   /* Indicate which options were chosen to resolve a text or tree conflict
-   * on the conflited node. */
+   * on the conflicted node. */
   svn_client_conflict_option_id_t resolution_text;
   svn_client_conflict_option_id_t resolution_tree;
 

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1764283=1764282=1764283=diff
==
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Oct 11 16:08:21 2016
@@ -2004,7 +2004,7 @@ write_entry(struct write_baton **entry_n
   if (entry_node && entry->tree_conflict_data)
 {
   /* Issues #3840/#3916: 1.6 stores multiple tree conflicts on the
- parent node, 1.7 stores them directly on the conflited nodes.
+ parent node, 1.7 stores them directly on the conflicted nodes.
  So "((skel1) (skel2))" becomes "(skel1)" and "(skel2)" */
   svn_skel_t *skel;
 




svn commit: r1764254 - /subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 14:27:25 2016
New Revision: 1764254

URL: http://svn.apache.org/viewvc?rev=1764254=rev
Log:
On the resolve-incoming-add branch:

* subversion/libsvn_client/conflicts.c
  (diff_dir_added): Remove SVN_DBG calls.

Modified:

subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c?rev=1764254=1764253=1764254=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
(original)
+++ 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
Tue Oct 11 14:27:25 2016
@@ -5675,8 +5675,6 @@ diff_dir_added(const char *relpath,
   SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
 FALSE, FALSE, scratch_pool));
   SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-  SVN_DBG(("%s: %s (db: %s / disk: %s)\n", __func__, relpath,
-  svn_node_kind_to_word(db_kind), svn_node_kind_to_word(on_disk_kind)));
 
   if (db_kind != svn_node_none && db_kind != svn_node_unknown)
 {
@@ -5705,12 +5703,6 @@ diff_dir_added(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-  if (copyfrom_source)
-SVN_DBG(("%s: copyfrom source: %s@%lu\n", __func__,
-  copyfrom_source->repos_relpath, copyfrom_source->revision));
-  SVN_DBG(("%s: right source: %s@%lu\n", __func__,
-right_source->repos_relpath, right_source->revision));
-
   SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
   copyfrom_url = apr_pstrcat(scratch_pool, b->repos_root_url, "/",
  right_source->repos_relpath, SVN_VA_NULL);




svn commit: r1764277 - /subversion/trunk/subversion/libsvn_client/conflicts.c

2016-10-11 Thread kotkov
Author: kotkov
Date: Tue Oct 11 15:59:10 2016
New Revision: 1764277

URL: http://svn.apache.org/viewvc?rev=1764277=rev
Log:
Following up on r1764273, fix indentation in the check_move_ancestry()
function.

* subversion/libsvn_client/conflicts.c
  (check_move_ancestry): As above.

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

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1764277=1764276=1764277=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Oct 11 15:59:10 
2016
@@ -331,19 +331,19 @@ check_move_ancestry(svn_boolean_t *relat
 }
 
   if (check_last_changed_rev)
-  {
-svn_dirent_t *dirent;
+{
+  svn_dirent_t *dirent;
 
-/* Verify that copyfrom_rev >= last-changed revision of the
- * deleted node. */
-SVN_ERR(svn_ra_stat(ra_session, "", deleted_rev - 1, ,
-scratch_pool));
-if (dirent == NULL || copyfrom_rev < dirent->created_rev)
-  {
-*related = FALSE;
-return SVN_NO_ERROR;
-  }
-  }
+  /* Verify that copyfrom_rev >= last-changed revision of the
+   * deleted node. */
+  SVN_ERR(svn_ra_stat(ra_session, "", deleted_rev - 1, ,
+  scratch_pool));
+  if (dirent == NULL || copyfrom_rev < dirent->created_rev)
+{
+  *related = FALSE;
+  return SVN_NO_ERROR;
+}
+}
 
   *related = TRUE;
   return SVN_NO_ERROR;




svn commit: r1764269 - /subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 15:28:38 2016
New Revision: 1764269

URL: http://svn.apache.org/viewvc?rev=1764269=rev
Log:
On the 'resolve-incoming-add' branch: Make an XFAIL test PASS.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_merge_incoming_added_dir_merge): Fix this test to account for the
   nested 'add vs add' conflict on the file which was added on both the
   trunk and the branch.
  (test_func): Mark the above test as PASS.

Modified:

subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c?rev=1764269=1764268=1764269=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 (original)
+++ 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 Tue Oct 11 15:28:38 2016
@@ -1086,9 +1086,6 @@ test_merge_incoming_added_dir_ignore(con
   return SVN_NO_ERROR;
 }
 
-/* This test currently fails to meet expectations. Our merge code doesn't
- * support a merge of files which were added in the same revision as their
- * parent directory and were not modified since. */
 static svn_error_t *
 test_merge_incoming_added_dir_merge(const svn_test_opts_t *opts,
 apr_pool_t *pool)
@@ -1155,8 +1152,8 @@ test_merge_incoming_added_dir_merge(cons
   props_conflicted->nelts == 0 &&
   !tree_conflicted);
 
-  /* XFAIL: Currently, no text conflict is raised since the file is not merged.
-   * We should have a text conflict in the file. */
+
+  /* There should now be an 'add vs add' conflict on the new file. */
   new_file_path = svn_relpath_join(branch_path,
svn_relpath_join(new_dir_name,
 new_file_name, b->pool),
@@ -1167,6 +1164,45 @@ test_merge_incoming_added_dir_merge(cons
  _conflicted,
  _conflicted,
  conflict, b->pool, b->pool));
+  SVN_TEST_ASSERT(!text_conflicted &&
+  props_conflicted->nelts == 0 &&
+  tree_conflicted);
+
+  /* Resolve the tree conflict. */
+  SVN_ERR(svn_test__create_client_ctx(, b, b->pool));
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, new_file_path),
+  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+  SVN_ERR(svn_client_conflict_tree_resolve_by_id(
+conflict,
+svn_client_conflict_option_incoming_added_file_text_merge, ctx,
+b->pool));
+
+  /* Ensure that the file has the expected status. */
+  SVN_ERR(svn_client_status6(NULL, ctx, sbox_wc_path(b, new_file_path),
+ _rev, svn_depth_unknown, TRUE, TRUE,
+ TRUE, TRUE, FALSE, TRUE, NULL,
+ status_func, , b->pool));
+  status = sb.status;
+  SVN_TEST_ASSERT(status->kind == svn_node_file);
+  SVN_TEST_ASSERT(status->versioned);
+  SVN_TEST_ASSERT(status->conflicted);
+  SVN_TEST_ASSERT(status->node_status == svn_wc_status_conflicted);
+  SVN_TEST_ASSERT(status->text_status == svn_wc_status_conflicted);
+  SVN_TEST_ASSERT(status->prop_status == svn_wc_status_modified);
+  SVN_TEST_ASSERT(!status->copied);
+  SVN_TEST_ASSERT(!status->switched);
+  SVN_TEST_ASSERT(!status->file_external);
+  SVN_TEST_ASSERT(status->moved_from_abspath == NULL);
+  SVN_TEST_ASSERT(status->moved_to_abspath == NULL);
+
+  /* The file should now have a text conflict. */
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, new_file_path),
+  ctx, b->pool, b->pool));
+  SVN_ERR(svn_client_conflict_get_conflicted(_conflicted,
+ _conflicted,
+ _conflicted,
+ conflict, b->pool, b->pool));
   SVN_TEST_ASSERT(text_conflicted &&
   props_conflicted->nelts == 0 &&
   !tree_conflicted);
@@ -3568,7 +3604,7 @@ static struct svn_test_descriptor_t test
"switch incoming add file ignore"),
 SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_ignore,
"merge incoming add dir ignore"),
-SVN_TEST_OPTS_XFAIL(test_merge_incoming_added_dir_merge,
+SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_merge,
"merge incoming add dir merge"),
 SVN_TEST_OPTS_PASS(test_merge_incoming_added_dir_merge2,
"merge incoming add dir merge with file change"),




svn commit: r1764273 - in /subversion/trunk/subversion: libsvn_client/conflicts.c tests/libsvn_client/conflicts-test.c

2016-10-11 Thread kotkov
Author: kotkov
Date: Tue Oct 11 15:47:07 2016
New Revision: 1764273

URL: http://svn.apache.org/viewvc?rev=1764273=rev
Log:
Fix tracing of the chained incoming moves in the tree conflict resolver.

We only need to take the last-changed revision of the deleted node into
account while mapping a delete+copy pair to a move, instead of also doing
this when chaining moves.

* subversion/libsvn_client/conflicts.c
  (check_move_ancestry): Accept new argument that makes the last-changed
   revision check conditional.
  (find_moves_in_revision): Update the calling sites of check_move_ancestry().
   Check the last-changed revision when resolving moves within a single
   revision, and don't do that when gluing moves that happened in different
   revisions.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_funcs): The test_merge_incoming_chained_move_local_edit() test now
   passes.

Modified:
subversion/trunk/subversion/libsvn_client/conflicts.c
subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1764273=1764272=1764273=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Oct 11 15:47:07 
2016
@@ -274,9 +274,10 @@ struct repos_move_info {
 };
 
 /* Set *RELATED to true if the deleted node DELETED_REPOS_RELPATH@DELETED_REV
- * is an ancestor of the copied node COPYFROM_PATH@COPYFROM_REV, and if the
- * copied node is a copy of the deleted node's last-changed revision's content,
- * rather than a copy of some older content. */
+ * is an ancestor of the copied node COPYFROM_PATH@COPYFROM_REV.
+ * If CHECK_LAST_CHANGED_REV is non-zero, also ensure that the copied node
+ * is a copy of the deleted node's last-changed revision's content, rather
+ * than a copy of some older content. If it's not, set *RELATED to false. */
 static svn_error_t *
 check_move_ancestry(svn_boolean_t *related,
 const char *repos_root_url,
@@ -284,6 +285,7 @@ check_move_ancestry(svn_boolean_t *relat
 svn_revnum_t deleted_rev,
 const char *copyfrom_path,
 svn_revnum_t copyfrom_rev,
+svn_boolean_t check_last_changed_rev,
 svn_client_ctx_t *ctx,
 apr_pool_t *scratch_pool)
 {
@@ -293,7 +295,6 @@ check_move_ancestry(svn_boolean_t *relat
   svn_ra_session_t *ra_session;
   const char *corrected_url;
   apr_array_header_t *location_revisions;
-  svn_dirent_t *dirent;
 
   location_revisions = apr_array_make(scratch_pool, 1, sizeof(svn_revnum_t));
   APR_ARRAY_PUSH(location_revisions, svn_revnum_t) = copyfrom_rev;
@@ -329,13 +330,20 @@ check_move_ancestry(svn_boolean_t *relat
   return SVN_NO_ERROR;
 }
 
-  /* Verify that copyfrom_rev >= last-changed revision of the deleted node. */
-  SVN_ERR(svn_ra_stat(ra_session, "", deleted_rev - 1, , scratch_pool));
-  if (dirent == NULL || copyfrom_rev < dirent->created_rev)
-{
-  *related = FALSE;
-  return SVN_NO_ERROR;
-}
+  if (check_last_changed_rev)
+  {
+svn_dirent_t *dirent;
+
+/* Verify that copyfrom_rev >= last-changed revision of the
+ * deleted node. */
+SVN_ERR(svn_ra_stat(ra_session, "", deleted_rev - 1, ,
+scratch_pool));
+if (dirent == NULL || copyfrom_rev < dirent->created_rev)
+  {
+*related = FALSE;
+return SVN_NO_ERROR;
+  }
+  }
 
   *related = TRUE;
   return SVN_NO_ERROR;
@@ -403,7 +411,7 @@ find_moves_in_revision(apr_hash_t *moves
   log_entry->revision,
   copy->copyfrom_path,
   copy->copyfrom_rev,
-  ctx, iterpool));
+  TRUE, ctx, iterpool));
   if (!related)
 continue;
 
@@ -432,7 +440,7 @@ find_moves_in_revision(apr_hash_t *moves
   next_move->rev,
   move->moved_from_repos_relpath,
   move->copyfrom_rev,
-  ctx, iterpool));
+  FALSE, ctx, iterpool));
   if (related)
 {
   SVN_ERR_ASSERT(move->rev < next_move->rev);

Modified: subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c?rev=1764273=1764272=1764273=diff
==
--- subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ 

svn commit: r1764266 - /subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 15:10:46 2016
New Revision: 1764266

URL: http://svn.apache.org/viewvc?rev=1764266=rev
Log:
On the resolve-incoming-add branch:

* subversion/libsvn_client/conflicts.c
  (diff_file_added): Add a file to the working copy. Remove SVN_DBG calls.

Modified:

subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c?rev=1764266=1764265=1764266=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
(original)
+++ 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
Tue Oct 11 15:10:46 2016
@@ -5894,14 +5894,14 @@ diff_file_added(const char *relpath,
   const char *local_abspath;
   svn_node_kind_t db_kind;
   svn_node_kind_t on_disk_kind;
+  apr_array_header_t *propsarray;
+  apr_array_header_t *regular_props;
 
   local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
 
   SVN_ERR(svn_wc_read_kind2(_kind, b->ctx->wc_ctx, local_abspath,
 FALSE, FALSE, scratch_pool));
   SVN_ERR(svn_io_check_path(local_abspath, _disk_kind, scratch_pool));
-  SVN_DBG(("%s: %s (db: %s / disk: %s)\n", __func__, relpath,
-  svn_node_kind_to_word(db_kind), svn_node_kind_to_word(on_disk_kind)));
 
   if (db_kind != svn_node_none && db_kind != svn_node_unknown)
 {
@@ -5930,12 +5930,15 @@ diff_file_added(const char *relpath,
   return SVN_NO_ERROR;
 }
 
-  if (copyfrom_source)
-SVN_DBG(("%s: copyfrom source: %s@%lu\n", __func__,
-  copyfrom_source->repos_relpath, copyfrom_source->revision));
-  SVN_DBG(("%s: right source: %s@%lu\n", __func__,
-right_source->repos_relpath, right_source->revision));
-  SVN_DBG(("%s: right file: %s\n", __func__, right_file));
+  propsarray = svn_prop_hash_to_array(right_props, scratch_pool);
+  SVN_ERR(svn_categorize_props(propsarray, NULL, NULL, _props,
+   scratch_pool));
+  SVN_ERR(svn_io_copy_file(right_file, local_abspath, FALSE, scratch_pool));
+  SVN_ERR(svn_wc_add_from_disk3(b->ctx->wc_ctx, local_abspath,
+svn_prop_array_to_hash(regular_props,
+   scratch_pool),
+FALSE, b->ctx->notify_func2,
+b->ctx->notify_baton2, scratch_pool));
 
   return SVN_NO_ERROR;
 }




svn commit: r1764270 - /subversion/trunk/subversion/libsvn_client/conflicts.c

2016-10-11 Thread kotkov
Author: kotkov
Date: Tue Oct 11 15:35:07 2016
New Revision: 1764270

URL: http://svn.apache.org/viewvc?rev=1764270=rev
Log:
Lay some groundwork for fixing the chained incoming moves conflict
resolution by fixing a minor bug in the check_move_ancestry() function.

* subversion/libsvn_client/conflicts.c
  (check_move_ancestry): If there is no location for the deleted node
   @COPYFROM_REV, the deleted and the copied nodes are not related.

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

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1764270=1764269=1764270=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Oct 11 15:35:07 
2016
@@ -322,6 +322,8 @@ check_move_ancestry(svn_boolean_t *relat
   if (strcmp(deleted_location, copyfrom_path) != 0)
 return SVN_NO_ERROR;
 }
+  else
+return SVN_NO_ERROR;
 
   /* Verify that copyfrom_rev >= last-changed revision of the deleted node. */
   SVN_ERR(svn_ra_stat(ra_session, "", deleted_rev - 1, , scratch_pool));




svn commit: r1764235 - in /subversion/branches/ra-git/subversion/libsvn_fs_git: git-revroot.c svn_git.c

2016-10-11 Thread rhuijben
Author: rhuijben
Date: Tue Oct 11 13:30:48 2016
New Revision: 1764235

URL: http://svn.apache.org/viewvc?rev=1764235=rev
Log:
On the ra-git branch: Fix compilation of libsvn_fs_git by fixing one
minor libsvn_fs change and a libgit2 error handling change.

* subversion/libsvn_fs_git/git-revroot.c
  (root_vtable): Pass NULL as the new in 1.10 change iterator to fall
back to the default implementation.

* subversion/libsvn_fs_git/svn_git.c
  (svn_git__wrap_git_error): Update for changed error handling in libgit2.

Modified:
subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c
subversion/branches/ra-git/subversion/libsvn_fs_git/svn_git.c

Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c?rev=1764235=1764234=1764235=diff
==
--- subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/git-revroot.c Tue Oct 
11 13:30:48 2016
@@ -1374,6 +1374,7 @@ fs_git_get_mergeinfo(svn_mergeinfo_catal
 static const root_vtable_t root_vtable =
 {
   fs_git_paths_changed,
+  NULL,
   fs_git_check_path,
   fs_git_node_history,
   fs_git_node_id,

Modified: subversion/branches/ra-git/subversion/libsvn_fs_git/svn_git.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_git/svn_git.c?rev=1764235=1764234=1764235=diff
==
--- subversion/branches/ra-git/subversion/libsvn_fs_git/svn_git.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_git/svn_git.c Tue Oct 11 
13:30:48 2016
@@ -309,12 +309,14 @@ svn_git__treebuilder_new(git_treebuilder
 svn_error_t *
 svn_git__wrap_git_error(void)
 {
-  git_error git_err;
+  svn_error_t *err = SVN_NO_ERROR;
+  const git_error *git_err = giterr_last();
 
-  if (giterr_detach(_err) == -1)
-SVN_ERR_MALFUNCTION();
+  if (!git_err)
+   SVN_ERR_MALFUNCTION();
 
-  /* ### TODO: map error code */
-  return svn_error_createf(SVN_ERR_FS_GIT_LIBGIT2_ERROR, NULL,
-   _("git: %s"), git_err.message);
+  err = svn_error_createf(SVN_ERR_FS_GIT_LIBGIT2_ERROR, NULL,
+   _("git: %s"), git_err->message);
+  giterr_clear();
+  return svn_error_trace(err);
 }




svn commit: r1764239 - /subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 13:40:10 2016
New Revision: 1764239

URL: http://svn.apache.org/viewvc?rev=1764239=rev
Log:
On the 'resolve-incoming-add' branch:

When merging added directory trees, merge the properties at the root folder.

* subversion/libsvn_client/conflicts.c
  (merge_added_dir_props): New helper function.
  (diff_dir_added): Merge props on the root of the added tree.

Modified:

subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c

Modified: 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c?rev=1764239=1764238=1764239=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
(original)
+++ 
subversion/branches/resolve-incoming-add/subversion/libsvn_client/conflicts.c 
Tue Oct 11 13:40:10 2016
@@ -5572,6 +5572,71 @@ struct merge_newly_added_dir_baton {
   svn_revnum_t merge_right_rev;
 };
 
+static svn_error_t *
+merge_added_dir_props(const char *target_abspath,
+  const char *added_repos_relpath,
+  apr_hash_t *added_props,
+  const char *repos_root_url,
+  const char *repos_uuid,
+  svn_revnum_t merge_left_rev,
+  svn_revnum_t merge_right_rev,
+  svn_client_ctx_t *ctx,
+  apr_pool_t *scratch_pool)
+{
+  svn_wc_notify_state_t property_state;
+  apr_array_header_t *propchanges;
+  const svn_wc_conflict_version_t *left_version;
+  const svn_wc_conflict_version_t *right_version;
+  apr_hash_index_t *hi;
+
+  left_version = svn_wc_conflict_version_create2(
+   repos_root_url, repos_uuid, added_repos_relpath,
+   merge_left_rev, svn_node_none, scratch_pool);
+
+  right_version = svn_wc_conflict_version_create2(
+repos_root_url, repos_uuid, added_repos_relpath,
+merge_right_rev, svn_node_dir, scratch_pool);
+
+  propchanges = apr_array_make(scratch_pool, apr_hash_count(added_props),
+   sizeof(svn_prop_t));
+  for (hi = apr_hash_first(scratch_pool, added_props);
+   hi;
+   hi = apr_hash_next(hi))
+{
+  svn_prop_t prop;
+
+  prop.name = apr_hash_this_key(hi);
+  prop.value = apr_hash_this_val(hi);
+
+  if (svn_wc_is_normal_prop(prop.name))
+APR_ARRAY_PUSH(propchanges, svn_prop_t) = prop;
+}
+
+  SVN_ERR(svn_wc_merge_props3(_state, ctx->wc_ctx,
+  target_abspath,
+  left_version, right_version,
+  apr_hash_make(scratch_pool),
+  propchanges,
+  FALSE, /* not a dry-run */
+  NULL, NULL, NULL, NULL,
+  scratch_pool));
+
+  if (ctx->notify_func2)
+{
+  svn_wc_notify_t *notify;
+
+  notify = svn_wc_create_notify(target_abspath,
+svn_wc_notify_update_update,
+scratch_pool);
+  notify->kind = svn_node_dir;
+  notify->content_state = svn_wc_notify_state_unchanged;;
+  notify->prop_state = property_state;
+  ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
+}
+
+  return SVN_NO_ERROR;
+}
+
 /* An svn_diff_tree_processor_t callback. */
 static svn_error_t *
 diff_dir_added(const char *relpath,
@@ -5590,9 +5655,20 @@ diff_dir_added(const char *relpath,
   svn_node_kind_t on_disk_kind;
   apr_hash_index_t *hi;
 
-  /* Skip adding the root of the added directory tree itself. */
+  /* Handle the root of the added directory tree. */
   if (relpath[0] == '\0')
-return SVN_NO_ERROR;
+{
+  /* ### svn_wc_merge_props3() requires this... */
+  SVN_ERR(svn_wc__del_tree_conflict(b->ctx->wc_ctx, b->target_abspath,
+scratch_pool));
+  SVN_ERR(merge_added_dir_props(b->target_abspath,
+b->added_repos_relpath, right_props,
+b->repos_root_url, b->repos_uuid,
+b->merge_left_rev, b->merge_right_rev,
+b->ctx, scratch_pool));
+  return SVN_NO_ERROR;
+
+}
 
   local_abspath = svn_dirent_join(b->target_abspath, relpath, scratch_pool);
 




svn commit: r1764240 - in /subversion/branches/resolve-incoming-add: ./ notes/meetings/berlin-16-minutes subversion/svn/conflict-callbacks.c subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 13:40:59 2016
New Revision: 1764240

URL: http://svn.apache.org/viewvc?rev=1764240=rev
Log:
On the resolve-incoming-add branch: Merge with trunk.

Added:
subversion/branches/resolve-incoming-add/notes/meetings/berlin-16-minutes
  - copied unchanged from r1764239, 
subversion/trunk/notes/meetings/berlin-16-minutes
Modified:
subversion/branches/resolve-incoming-add/   (props changed)
subversion/branches/resolve-incoming-add/subversion/svn/conflict-callbacks.c

subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c

Propchange: subversion/branches/resolve-incoming-add/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 11 13:40:59 2016
@@ -96,4 +96,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1762797-1764035
+/subversion/trunk:1762797-1764239

Modified: 
subversion/branches/resolve-incoming-add/subversion/svn/conflict-callbacks.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/svn/conflict-callbacks.c?rev=1764240=1764239=1764240=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/svn/conflict-callbacks.c 
(original)
+++ 
subversion/branches/resolve-incoming-add/subversion/svn/conflict-callbacks.c 
Tue Oct 11 13:40:59 2016
@@ -229,8 +229,8 @@ merge_prop_conflict(svn_stream_t *output
 base_propval = svn_string_create_empty(pool);
   if (my_propval == NULL)
 my_propval = svn_string_create_empty(pool);
-  if (my_propval == NULL)
-my_propval = svn_string_create_empty(pool);
+  if (their_propval == NULL)
+their_propval = svn_string_create_empty(pool);
 
   options->ignore_eol_style = TRUE;
   SVN_ERR(svn_diff_mem_string_diff3(, base_propval,

Modified: 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c?rev=1764240=1764239=1764240=diff
==
--- 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 (original)
+++ 
subversion/branches/resolve-incoming-add/subversion/tests/libsvn_client/conflicts-test.c
 Tue Oct 11 13:40:59 2016
@@ -2356,6 +2356,9 @@ test_merge_incoming_move_dir(const svn_t
   struct svn_client_status_t *status;
   svn_stringbuf_t *buf;
   svn_opt_revision_t opt_rev;
+  apr_array_header_t *options;
+  svn_client_conflict_option_t *option;
+  apr_array_header_t *possible_moved_to_abspaths;
 
   SVN_ERR(svn_test__sandbox_create(b, "merge_incoming_move_dir", opts, pool));
 
@@ -2365,11 +2368,36 @@ test_merge_incoming_move_dir(const svn_t
   deleted_path = svn_relpath_join(branch_path, deleted_dir_name, b->pool);
   moved_to_path = svn_relpath_join(branch_path, new_dir_name, b->pool);
 
-  /* Resolve the tree conflict. */
   SVN_ERR(svn_test__create_client_ctx(, b, b->pool));
   SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, deleted_path),
   ctx, b->pool, b->pool));
   SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, b->pool));
+
+  /* Check possible move destinations for the directory. */
+  SVN_ERR(svn_client_conflict_tree_get_resolution_options(, conflict,
+  ctx, b->pool,
+  b->pool));
+  option = svn_client_conflict_option_find_by_id(
+ options, svn_client_conflict_option_incoming_move_dir_merge);
+  SVN_TEST_ASSERT(option != NULL);
+
+  SVN_ERR(svn_client_conflict_option_get_moved_to_abspath_candidates(
+_moved_to_abspaths, option, b->pool, b->pool));
+
+  /* XFAIL: Currently, the resolver finds two possible destinations for
+   * the moved folder:
+   *
+   *   Possible working copy destinations for moved-away 'A_branch/B' are:
+   *(1): 'A_branch/newdir'
+   *(2): 'A/newdir'
+   *   Only one destination can be a move; the others are copies.
+   */
+  SVN_TEST_INT_ASSERT(possible_moved_to_abspaths->nelts, 1);
+  SVN_TEST_STRING_ASSERT(
+APR_ARRAY_IDX(possible_moved_to_abspaths, 0, const char *),
+sbox_wc_path(b, moved_to_path));
+
+  /* Resolve the tree conflict. */
   SVN_ERR(svn_client_conflict_tree_resolve_by_id(
 conflict, svn_client_conflict_option_incoming_move_dir_merge,
 ctx, b->pool));
@@ -3039,6 +3067,483 @@ test_merge_incoming_move_file_text_merge
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_merge_incoming_edit_file_moved_away(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+  

svn commit: r1764234 - /subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread kotkov
Author: kotkov
Date: Tue Oct 11 13:05:56 2016
New Revision: 1764234

URL: http://svn.apache.org/viewvc?rev=1764234=rev
Log:
Add a test for "incoming move vs local edit" tree conflict resolution upon
merge, where the file has been moved twice, and also it was deleted and
recreated between these moves (like, mv a → b, commit, replace b, commit,
mv b → c, commit).

The test works, and we expect that the "(m) move 'a' to 'c' and merge"
option is not available, as the file was actually deleted at some point,
thus the second move is a part of the different line of history.

* subversion/tests/libsvn_client/conflicts-test.c
  (test_merge_incoming_file_move_new_line_of_history): New test.
  (test_funcs): Reference new test.

Modified:
subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

Modified: subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c?rev=1764234=1764233=1764234=diff
==
--- subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c Tue Oct 11 
13:05:56 2016
@@ -3455,6 +3455,95 @@ test_merge_incoming_move_dir_with_moved_
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_merge_incoming_file_move_new_line_of_history(const svn_test_opts_t *opts,
+  apr_pool_t *pool)
+{
+  svn_test__sandbox_t *b = apr_palloc(pool, sizeof(*b));
+  svn_client_ctx_t *ctx;
+  svn_opt_revision_t opt_rev;
+  svn_client_conflict_t *conflict;
+  svn_boolean_t text_conflicted;
+  apr_array_header_t *props_conflicted;
+  svn_boolean_t tree_conflicted;
+
+  SVN_ERR(svn_test__sandbox_create(
+b, "merge_incoming_file_move_new_line_of_history", opts, pool));
+
+  SVN_ERR(sbox_add_and_commit_greek_tree(b));
+  /* Create a copy of node "A". */
+  SVN_ERR(sbox_wc_copy(b, "A", "A1"));
+  SVN_ERR(sbox_wc_commit(b, ""));
+  /* On "trunk", move the file. */
+  SVN_ERR(sbox_wc_move(b, "A/mu", "A/mu-moved"));
+  SVN_ERR(sbox_wc_commit(b, ""));
+  /* On "trunk", change the line of history of the moved file by
+   * replacing it. */
+  SVN_ERR(sbox_wc_delete(b, "A/mu-moved"));
+  SVN_ERR(sbox_file_write(b, "A/mu-moved", "x"));
+  SVN_ERR(sbox_wc_add(b, "A/mu-moved"));
+  SVN_ERR(sbox_wc_commit(b, ""));
+  /* On "trunk", move the replaced file. */
+  SVN_ERR(sbox_wc_move(b, "A/mu-moved", "A/mu-moved-again"));
+  SVN_ERR(sbox_wc_commit(b, ""));
+  /* On "branch", edit the file. */
+  SVN_ERR(sbox_file_write(b, "A1/mu", "New branch content.\n"));
+  SVN_ERR(sbox_wc_commit(b, ""));
+
+  SVN_ERR(svn_test__create_client_ctx(, b, pool));
+
+  /* Merge "trunk" to "branch". */
+  SVN_ERR(sbox_wc_update(b, "", SVN_INVALID_REVNUM));
+  opt_rev.kind = svn_opt_revision_head;
+  opt_rev.value.number = SVN_INVALID_REVNUM;
+  SVN_ERR(svn_client_merge_peg5(svn_path_url_add_component2(b->repos_url, "A",
+pool),
+NULL, _rev, sbox_wc_path(b, "A1"),
+svn_depth_infinity,
+FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
+NULL, ctx, pool));
+
+  /* We should have a tree conflict in the file "mu". */
+  SVN_ERR(svn_client_conflict_get(, sbox_wc_path(b, "A1/mu"), ctx,
+  pool, pool));
+  SVN_ERR(svn_client_conflict_get_conflicted(_conflicted,
+ _conflicted,
+ _conflicted,
+ conflict, pool, pool));
+  SVN_TEST_ASSERT(!text_conflicted);
+  SVN_TEST_INT_ASSERT(props_conflicted->nelts, 0);
+  SVN_TEST_ASSERT(tree_conflicted);
+
+  /* Check available tree conflict resolution options. */
+  {
+svn_client_conflict_option_id_t expected_opts[] = {
+  svn_client_conflict_option_postpone,
+  svn_client_conflict_option_accept_current_wc_state,
+  svn_client_conflict_option_incoming_delete_ignore,
+  svn_client_conflict_option_incoming_delete_accept,
+  -1 /* end of list */
+};
+SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts, pool));
+  }
+
+  SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx, pool));
+
+  /* The svn_client_conflict_option_incoming_move_file_text_merge option
+   * should not be available, as the "mu" file was actually deleted at
+   * some point (and the remaining move is a part of the new line of
+   * history). */
+  {
+svn_client_conflict_option_id_t expected_opts[] = {
+  svn_client_conflict_option_postpone,
+  svn_client_conflict_option_accept_current_wc_state,
+  -1 /* end of list */
+};
+SVN_ERR(assert_tree_conflict_options(conflict, ctx, expected_opts, pool));
+  }
+
+  return 

svn commit: r1764248 - in /subversion/branches/ra-git: build.conf build/generator/gen_win_dependencies.py subversion/libsvn_ra_git/fetch.c

2016-10-11 Thread rhuijben
Author: rhuijben
Date: Tue Oct 11 13:55:30 2016
New Revision: 1764248

URL: http://svn.apache.org/viewvc?rev=1764248=rev
Log:
On the ra-git branch: Fix compilation of libsvn_ra_git.

* build/generator/gen_win_dependencies.py
  Add libssh2 as optional dependency.

* build.conf
  (libssh2): Declare known library and dependency on openssl.
  (libgit2): Depend on libssh2.

* subversion/libsvn_ra_git/fetch.c
  (svn_ra_git__wrap_git_error): Remove unused function.

Modified:
subversion/branches/ra-git/build.conf
subversion/branches/ra-git/build/generator/gen_win_dependencies.py
subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c

Modified: subversion/branches/ra-git/build.conf
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/build.conf?rev=1764248=1764247=1764248=diff
==
--- subversion/branches/ra-git/build.conf (original)
+++ subversion/branches/ra-git/build.conf Tue Oct 11 13:55:30 2016
@@ -1509,10 +1509,17 @@ external-lib = $(SVN_SQLITE_LIBS)
 pkg-config = sqlite3
 pkg-config-private = yes
 
+[libssh2]
+type = lib
+external-lib = $(SVN_LIBSSH2_LIBS)
+libs = openssl
+msvc-libs = libssh2.lib
+
 [libgit2]
 type = lib
 external-lib = $(SVN_LIBGIT2_LIBS)
-msvc-libs = winhttp.lib
+libs = libssh2
+msvc-libs = winhttp.lib libssh2.lib
 
 [xml]
 type = lib

Modified: subversion/branches/ra-git/build/generator/gen_win_dependencies.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/build/generator/gen_win_dependencies.py?rev=1764248=1764247=1764248=diff
==
--- subversion/branches/ra-git/build/generator/gen_win_dependencies.py 
(original)
+++ subversion/branches/ra-git/build/generator/gen_win_dependencies.py Tue Oct 
11 13:55:30 2016
@@ -113,6 +113,7 @@ class GenDependenciesBase(gen_base.Gener
 'intl',
 'serf',
 'libgit2',
+'libssh2',
 'sasl',
 'swig',
 'perl',

Modified: subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c?rev=1764248=1764247=1764248=diff
==
--- subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c Tue Oct 11 
13:55:30 2016
@@ -62,19 +62,6 @@ do_libgit2_init(void *baton, apr_pool_t
 
 /*** Miscellaneous helper functions ***/
 
-svn_error_t *
-svn_ra_git__wrap_git_error(void)
-{
-  git_error git_err;
-
-  if (giterr_detach(_err) == -1)
-SVN_ERR_MALFUNCTION();
-
-  /* ### TODO: map error code */
-  return svn_error_createf(SVN_ERR_FS_GIT_LIBGIT2_ERROR, NULL,
-   _("git: %s"), git_err.message);
-}
-
 static apr_status_t
 cleanup_git_remote(void *baton)
 {
@@ -155,7 +142,8 @@ svn_ra_git__split_url(const char **repos
 apr_pool_cleanup_null);
 
   /* ... and try to connect to it. */
-  git_err = git_remote_connect(remote, GIT_DIRECTION_FETCH, callbacks);
+  git_err = git_remote_connect(remote, GIT_DIRECTION_FETCH, callbacks,
+  NULL /* custom_headers */);
   if (!git_err)
 {
   found_remote = TRUE;




svn commit: r1764221 - /subversion/trunk/subversion/svn/conflict-callbacks.c

2016-10-11 Thread ivan
Author: ivan
Date: Tue Oct 11 10:37:10 2016
New Revision: 1764221

URL: http://svn.apache.org/viewvc?rev=1764221=rev
Log:
Fix minor bug in property conflict interactive resolver.

* subversion/svn/conflict-callbacks.c
  (merge_prop_conflict): Check THEIR_PROPVAL for NULL instead of checking
   MY_PROPVAL twice.

Modified:
subversion/trunk/subversion/svn/conflict-callbacks.c

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1764221=1764220=1764221=diff
==
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Tue Oct 11 10:37:10 
2016
@@ -229,8 +229,8 @@ merge_prop_conflict(svn_stream_t *output
 base_propval = svn_string_create_empty(pool);
   if (my_propval == NULL)
 my_propval = svn_string_create_empty(pool);
-  if (my_propval == NULL)
-my_propval = svn_string_create_empty(pool);
+  if (their_propval == NULL)
+their_propval = svn_string_create_empty(pool);
 
   options->ignore_eol_style = TRUE;
   SVN_ERR(svn_diff_mem_string_diff3(, base_propval,




svn commit: r1764340 - in /subversion/trunk: subversion/include/ subversion/include/private/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subversion/libsvn_subr/ subversion/libsvn_wc/ subversion/s

2016-10-11 Thread luke1410
Author: luke1410
Date: Tue Oct 11 20:16:28 2016
New Revision: 1764340

URL: http://svn.apache.org/viewvc?rev=1764340=rev
Log:
Corrected spelling mistakes in comments.

* subversion/include/private/svn_utf_private.h
  (svn_utf__glob): as above
* subversion/include/svn_fs.h
  (svn_fs_refresh_revision_props): as above
* subversion/libsvn_fs_fs/fs.h
  (): as above
* subversion/libsvn_fs_fs/pack.c
  (tweak_path_for_ordering): as above
* subversion/libsvn_fs_fs/temp_serializer.h
  (): as above
* subversion/libsvn_fs_x/pack.c
  (): as above
* subversion/libsvn_subr/prefix_string.c
  (): as above
* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_wclock_find_root): as above
* subversion/svn/conflict-callbacks.c
  (find_option_by_id): as above
* tools/dev/fsfs-access-map.c
  (): as above

Modified:
subversion/trunk/subversion/include/private/svn_utf_private.h
subversion/trunk/subversion/include/svn_fs.h
subversion/trunk/subversion/libsvn_fs_fs/fs.h
subversion/trunk/subversion/libsvn_fs_fs/pack.c
subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h
subversion/trunk/subversion/libsvn_fs_x/pack.c
subversion/trunk/subversion/libsvn_subr/prefix_string.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/svn/conflict-callbacks.c
subversion/trunk/tools/dev/fsfs-access-map.c

Modified: subversion/trunk/subversion/include/private/svn_utf_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_utf_private.h?rev=1764340=1764339=1764340=diff
==
--- subversion/trunk/subversion/include/private/svn_utf_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_utf_private.h Tue Oct 11 
20:16:28 2016
@@ -198,7 +198,7 @@ svn_utf__encode_ucs4_string(svn_membuf_t
 apr_size_t length,
 apr_size_t *result_length);
 
-/* Pattern matching similar to the the SQLite LIKE and GLOB
+/* Pattern matching similar to the SQLite LIKE and GLOB
  * operators. PATTERN, KEY and ESCAPE must all point to UTF-8
  * strings. Furthermore, ESCAPE, if provided, must be a character from
  * the ASCII subset.

Modified: subversion/trunk/subversion/include/svn_fs.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1764340=1764339=1764340=diff
==
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Tue Oct 11 20:16:28 2016
@@ -2731,7 +2731,7 @@ svn_fs_deltify_revision(svn_fs_t *fs,
  * as old as the last barrier.
  *
  * The intended use of this is implementing efficient queries in upper layers
- * where the result only needs to include all changes up the the start of
+ * where the result only needs to include all changes up to the start of
  * that query but does not need to pick up on changes while the query is
  * running:
  *

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.h?rev=1764340=1764339=1764340=diff
==
--- subversion/trunk/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.h Tue Oct 11 20:16:28 2016
@@ -530,7 +530,7 @@ typedef struct representation_t
   /* Revision where this representation is located. */
   svn_revnum_t revision;
 
-  /* Item index with the the revision. */
+  /* Item index with the revision. */
   apr_uint64_t item_index;
 
   /* The size of the representation in bytes as seen in the revision

Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.c?rev=1764340=1764339=1764340=diff
==
--- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Tue Oct 11 20:16:28 2016
@@ -671,7 +671,7 @@ svn_fs_fs__order_dir_entries(svn_fs_t *f
   return result;
 }
 
-/* Return a duplicate of the the ORIGINAL path and with special sub-strins
+/* Return a duplicate of the ORIGINAL path and with special sub-strings
  * (e.g. "trunk") modified in such a way that have a lower lexicographic
  * value than any other "normal" file name.
  */

Modified: subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h?rev=1764340=1764339=1764340=diff
==
--- subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h Tue Oct 11 
20:16:28 2016
@@ -51,7 +51,7 @@ svn_fs_fs__noderev_deserialize(void *buf
 
 
 /**
- * 

svn commit: r1764285 - in /subversion/trunk: ./ subversion/libsvn_client/conflicts.c subversion/tests/libsvn_client/conflicts-test.c

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 16:12:55 2016
New Revision: 1764285

URL: http://svn.apache.org/viewvc?rev=1764285=rev
Log:
Merge the resolve-incoming-add branch to trunk.

Modified:
subversion/trunk/   (props changed)
subversion/trunk/subversion/libsvn_client/conflicts.c
subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

Propchange: subversion/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 11 16:12:55 2016
@@ -71,6 +71,7 @@
 /subversion/branches/ra_serf-digest-authn:875693-876404
 /subversion/branches/reintegrate-improvements:873853-874164
 /subversion/branches/remote-only-status:1581845-1586090
+/subversion/branches/resolve-incoming-add:1762797-1764284
 /subversion/branches/revprop-cache:1298521-1326293
 /subversion/branches/revprop-caching-ng:1620597,1620599
 
/subversion/branches/revprop-packing:1143907,1143971,1143997,1144017,1144499,1144568,1146145

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1764285=1764284=1764285=diff
==
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Tue Oct 11 16:12:55 
2016
@@ -38,6 +38,9 @@
 #include "svn_hash.h"
 #include "svn_sorts.h"
 #include "client.h"
+
+#include "private/svn_diff_tree.h"
+#include "private/svn_ra_private.h"
 #include "private/svn_sorts_private.h"
 #include "private/svn_token.h"
 #include "private/svn_wc_private.h"
@@ -5518,6 +5521,397 @@ unlock_wc:
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+raise_tree_conflict(const char *local_abspath,
+svn_wc_conflict_action_t incoming_change,
+svn_wc_conflict_reason_t local_change,
+svn_node_kind_t local_node_kind,
+svn_node_kind_t merge_left_kind,
+svn_node_kind_t merge_right_kind,
+const char *repos_root_url,
+const char *repos_uuid,
+const char *repos_relpath,
+svn_revnum_t merge_left_rev,
+svn_revnum_t merge_right_rev,
+svn_wc_context_t *wc_ctx,
+svn_wc_notify_func2_t notify_func2,
+void *notify_baton2,
+apr_pool_t *scratch_pool)
+{
+  svn_wc_conflict_description2_t *conflict;
+  const svn_wc_conflict_version_t *left_version;
+  const svn_wc_conflict_version_t *right_version;
+
+  left_version = svn_wc_conflict_version_create2(repos_root_url,
+ repos_uuid,
+ repos_relpath,
+ merge_left_rev,
+ merge_left_kind,
+ scratch_pool);
+  right_version = svn_wc_conflict_version_create2(repos_root_url,
+  repos_uuid,
+  repos_relpath,
+  merge_right_rev,
+  merge_right_kind,
+  scratch_pool);
+  conflict = svn_wc_conflict_description_create_tree2(local_abspath,
+  local_node_kind,
+  svn_wc_operation_merge,
+  left_version,
+  right_version,
+  scratch_pool);
+  conflict->action = incoming_change;
+  conflict->reason = local_change;
+
+  SVN_ERR(svn_wc__add_tree_conflict(wc_ctx, conflict, scratch_pool));
+
+  if (notify_func2)
+{
+  svn_wc_notify_t *notify;
+
+  notify = svn_wc_create_notify(local_abspath, svn_wc_notify_tree_conflict,
+scratch_pool);
+  notify->kind = local_node_kind;
+  notify_func2(notify_baton2, notify, scratch_pool);
+}
+
+  return SVN_NO_ERROR;
+}
+
+struct merge_newly_added_dir_baton {
+  const char *target_abspath;
+  svn_client_ctx_t *ctx;
+  const char *repos_root_url;
+  const char *repos_uuid;
+  const char *added_repos_relpath;
+  svn_revnum_t merge_left_rev;
+  svn_revnum_t merge_right_rev;
+};
+
+static svn_error_t *
+merge_added_dir_props(const char *target_abspath,
+  const char *added_repos_relpath,
+  apr_hash_t *added_props,
+  const char *repos_root_url,
+  const char *repos_uuid,
+  svn_revnum_t merge_left_rev,
+  

svn commit: r1764286 - /subversion/branches/resolve-incoming-add/

2016-10-11 Thread stsp
Author: stsp
Date: Tue Oct 11 16:13:23 2016
New Revision: 1764286

URL: http://svn.apache.org/viewvc?rev=1764286=rev
Log:
Remove resolve-incoming-add branch. Merged to trunk in r1764285.

Removed:
subversion/branches/resolve-incoming-add/



svn commit: r1764337 - in /subversion/branches/authzperf/subversion: libsvn_repos/authz.c tests/libsvn_repos/repos-test.c

2016-10-11 Thread stefan2
Author: stefan2
Date: Tue Oct 11 20:08:44 2016
New Revision: 1764337

URL: http://svn.apache.org/viewvc?rev=1764337=rev
Log:
On the authzperf branch:
Make handling of "**" (any-var) match user's expectations. See test cases.

This fixes the calculation of recursive access rights.  The pre-calculated
information on the tree nodes must only cover the bottom-up view, i.e. what
range of access rights has been defined anywhere in the sub-tree.  Top-down
application of inheritance must be restricted to the lookup - which already
fully handles it.  Hence, we only need finalize_tree instead of
finalize_up_tree and finalize_down_tree.

The second change in here is that trailing any-var patterns will actually
eclipse (hide / replace) any previous rule for the respective sub-tree.
That is relevant for recursive right checks which don't operate on the
repository node tree but only on the set of *potentially* applicable
rules for that sub-tree.  This implements the only easy-to-handle special
case of a pattern replacing a set of other pattern rules.

* subversion/libsvn_repos/authz.c
  (limited_rights_t): Commentary reflects that these bottom-up only now.
  (trim_subnode_hash,
   trim_subnode_array,
   trim_tree): New functions implementing the any-var eclipses older rule
   principle. 

  (finalize_up_subnode_array,
   finalize_up_tree): Rename to ...
  (finalize_subnode_array,
   finalize_tree): ... this. No longer take the parent rights into account.
  (finalize_subnode_hash): New utility function factored out from
   finalize_tree.
  (finalize_up_subnode_array,
   finalize_up_tree): Remove.

  (create_user_authz): Update caller. Invoke the new trim function, too.

* subversion/tests/libsvn_repos/repos-test.c
  (test_authz_recursive_override,
   test_authz_pattern_tests): New test cases.
  (test_funcs): Register new tests.

Modified:
subversion/branches/authzperf/subversion/libsvn_repos/authz.c
subversion/branches/authzperf/subversion/tests/libsvn_repos/repos-test.c

Modified: subversion/branches/authzperf/subversion/libsvn_repos/authz.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/authz.c?rev=1764337=1764336=1764337=diff
==
--- subversion/branches/authzperf/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/authz.c Tue Oct 11 
20:08:44 2016
@@ -80,11 +80,11 @@ typedef struct limited_rights_t
   access_t access;
 
   /* Minimal access rights that the user has on this or any other node in 
-   * the sub-tree. */
+   * the sub-tree.  This does not take inherited rights into account. */
   authz_access_t min_rights;
 
   /* Maximal access rights that the user has on this or any other node in 
-   * the sub-tree. */
+   * the sub-tree.  This does not take inherited rights into account. */
   authz_access_t max_rights;
 
 } limited_rights_t;
@@ -484,28 +484,207 @@ process_acl(construction_context_t *ctx,
 }
 
 /* Forward declaration ... */
+static svn_boolean_t
+trim_tree(node_t *node,
+  int latest_any_var,
+  apr_pool_t *scratch_pool);
+
+/* Call trim_tree() with LATEST_ANY_VAR on all elements in the *HASH of
+ * node_t * and remove empty nodes from.  *HASH may be NULL.  If all nodes
+ * could be removed, set *HASH to NULL and return TRUE.  Allocate temporary
+ * data in SCRATCH_POOL.
+ */
+static svn_boolean_t
+trim_subnode_hash(apr_hash_t **hash,
+  int latest_any_var,
+  apr_pool_t *scratch_pool)
+{
+  if (*hash)
+{
+  apr_array_header_t *to_remove = apr_array_make(scratch_pool, 0,
+ sizeof(node_t *));
+
+  apr_hash_index_t *hi;
+  for (hi = apr_hash_first(scratch_pool, *hash);
+   hi;
+   hi = apr_hash_next(hi))
+{
+  node_t *node = apr_hash_this_val(hi);
+  if (trim_tree(node, latest_any_var, scratch_pool))
+APR_ARRAY_PUSH(to_remove, node_t *) = node;
+}
+
+  /* Are some nodes left? */
+  if (to_remove->nelts < apr_hash_count(*hash))
+{
+  /* Remove empty nodes (if any). */
+  int i;
+  for (i = 0; i < to_remove->nelts; ++i)
+{
+  node_t *node = APR_ARRAY_IDX(to_remove, i, node_t *);
+  apr_hash_set(*hash, node->segment.data, node->segment.len,
+   NULL);
+}
+
+  return FALSE;
+}
+
+  /* No nodes left.  A NULL hash is more efficient than an empty one. */
+  *hash = NULL;
+}
+
+  return TRUE;
+}
+
+/* Call trim_tree() with LATEST_ANY_VAR on all elements in the *ARRAY of
+ * node_t * and remove empty nodes from.  *ARRAY may be NULL.  If all nodes
+ * could be removed, set *ARRAY to NULL and return TRUE.  Allocate
+ * temporary data in SCRATCH_POOL.
+ */
+static svn_boolean_t

svn propchange: r1764340 - svn:log

2016-10-11 Thread luke1410
Author: luke1410
Revision: 1764340
Modified property: svn:log

Modified: svn:log at Tue Oct 11 20:17:11 2016
--
--- svn:log (original)
+++ svn:log Tue Oct 11 20:17:11 2016
@@ -20,3 +20,5 @@ Corrected spelling mistakes in comments.
   (find_option_by_id): as above
 * tools/dev/fsfs-access-map.c
   (): as above
+
+Obvious fix.



[Subversion Wiki] Update of "ContributorsGroup" by JohanCorveleyn

2016-10-11 Thread Apache subversion Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Subversion Wiki" for 
change notification.

The "ContributorsGroup" page has been changed by JohanCorveleyn:
https://wiki.apache.org/subversion/ContributorsGroup?action=diff=17=18

  #acl AdminGroup:read,write,admin,revert,delete All:read
  '''Contributors''' with permission to edit the Subversion wiki – read, write, 
delete and revert pages or individual changes. To be added to this group, 
please send a brief request to the dev.at.subversion-dot-apache-dot-org mailing 
list including your wiki username. No mailing list subscription required.
  
- Related: [[AdminGroup| Administrators]] with permission to grant privileges 
to Contributors, in addition to being Contributors themselves.
+ Related: [[AdminGroup|Administrators]] with permission to grant privileges to 
Contributors, in addition to being Contributors themselves.
  
   * AdminGroup
   * GregStein
@@ -18, +18 @@

   * MichaelDiers
   * IvanZhakov
   * LievenGovaerts
+  * JohanCorveleyn
  


svn commit: r1764214 [13/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/mod_dav_svn/reports/log.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/mod_dav_svn/reports/log.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/ra-git/subversion/mod_dav_svn/reports/log.c Tue Oct 11 
09:11:50 2016
@@ -50,12 +50,17 @@ struct log_receiver_baton
   apr_bucket_brigade *bb;
 
   /* where to deliver the output */
-  ap_filter_t *output;
+  dav_svn__output *output;
 
   /* Whether we've written the  header.  Allows for lazy
  writes to support mod_dav-based error handling. */
   svn_boolean_t needs_header;
 
+  /* Whether we've written the  header for the current revision.
+ Allows for lazy XML node creation while receiving the data through
+ callbacks. */
+  svn_boolean_t needs_log_item;
+
   /* How deep we are in the log message tree.  We only need to surpress the
  SVN_INVALID_REVNUM message if the stack_depth is 0. */
   int stack_depth;
@@ -88,6 +93,22 @@ maybe_send_header(struct log_receiver_ba
 "xmlns:D=\"DAV:\">" DEBUG_CR));
   lrb->needs_header = FALSE;
 }
+
+  return SVN_NO_ERROR;
+}
+
+/* If LRB->needs_log_item is true, send the "" start
+   element and set LRB->needs_log_item to zero.  Else do nothing. */
+static svn_error_t *
+maybe_start_log_item(struct log_receiver_baton *lrb)
+{
+  if (lrb->needs_log_item)
+{
+  SVN_ERR(dav_svn__brigade_printf(lrb->bb, lrb->output,
+  "" DEBUG_CR));
+  lrb->needs_log_item = FALSE;
+}
+
   return SVN_NO_ERROR;
 }
 
@@ -99,17 +120,22 @@ maybe_send_header(struct log_receiver_ba
 static svn_error_t *
 start_path_with_copy_from(const char **element,
   struct log_receiver_baton *lrb,
-  svn_log_changed_path2_t *log_item,
+  svn_repos_path_change_t *log_item,
   apr_pool_t *pool)
 {
-  switch (log_item->action)
+  switch (log_item->change_kind)
 {
-  case 'A': *element = "S:added-path";
-break;
-  case 'R': *element = "S:replaced-path";
-break;
-  default:  /* Caller, you did wrong! */
-SVN_ERR_MALFUNCTION();
+  case svn_fs_path_change_add: 
+*element = "S:added-path";
+break;
+
+  case svn_fs_path_change_replace:
+*element = "S:replaced-path";
+break;
+
+  default:
+/* Caller, you did wrong! */
+SVN_ERR_MALFUNCTION();
 }
 
   if (log_item->copyfrom_path
@@ -129,15 +155,76 @@ start_path_with_copy_from(const char **e
 }
 
 
-/* This implements `svn_log_entry_receiver_t'.
+/* This implements `svn_repos_path_change_receiver_t'.
BATON is a `struct log_receiver_baton *'.  */
 static svn_error_t *
-log_receiver(void *baton,
- svn_log_entry_t *log_entry,
- apr_pool_t *pool)
+log_change_receiver(void *baton,
+svn_repos_path_change_t *change,
+apr_pool_t *scratch_pool)
+{
+  struct log_receiver_baton *lrb = baton;
+  const char *close_element = NULL;
+
+  /* We must open the XML nodes for the report and log-item before
+ sending the first changed path.
+
+ Note that we can't get here for empty revisions that log() injects
+ to indicate the end of a recursive merged rev sequence.
+   */
+  SVN_ERR(maybe_send_header(lrb));
+  SVN_ERR(maybe_start_log_item(lrb));
+
+  /* ### todo: is there a D: namespace equivalent for
+  `changed-path'?  Should use it if so. */
+  switch (change->change_kind)
+{
+case svn_fs_path_change_add:
+case svn_fs_path_change_replace:
+  SVN_ERR(start_path_with_copy_from(_element, lrb,
+change, scratch_pool));
+  break;
+
+case svn_fs_path_change_delete:
+  SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,
+"bb, lrb->output,
+"bb, lrb->output,
+  " node-kind=\"%s\""
+  " text-mods=\"%s\""
+  " prop-mods=\"%s\">%s" DEBUG_CR,
+  svn_node_kind_to_word(change->node_kind),
+  change->text_mod ? "true" : "false",
+  change->prop_mod ? "true" : "false",
+  apr_xml_quote_string(scratch_pool, 

svn commit: r1764214 [4/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_client/merge.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_client/merge.c Tue Oct 11 
09:11:50 2016
@@ -215,32 +215,6 @@
 
 /*** Repos-Diff Editor Callbacks ***/
 
-/* */
-typedef struct merge_source_t
-{
-  /* "left" side URL and revision (inclusive iff youngest) */
-  const svn_client__pathrev_t *loc1;
-
-  /* "right" side URL and revision (inclusive iff youngest) */
-  const svn_client__pathrev_t *loc2;
-
-  /* True iff LOC1 is an ancestor of LOC2 or vice-versa (history-wise). */
-  svn_boolean_t ancestral;
-} merge_source_t;
-
-/* Description of the merge target root node (a WC working node) */
-typedef struct merge_target_t
-{
-  /* Absolute path to the WC node */
-  const char *abspath;
-
-  /* The repository location of the base node of the target WC.  If the node
-   * is locally added, then URL & REV are NULL & SVN_INVALID_REVNUM.
-   * REPOS_ROOT_URL and REPOS_UUID are always valid. */
-  svn_client__pathrev_t loc;
-
-} merge_target_t;
-
 typedef struct merge_cmd_baton_t {
   svn_boolean_t force_delete; /* Delete a file/dir even if modified */
   svn_boolean_t dry_run;
@@ -1236,7 +1210,7 @@ struct merge_file_baton_t
 
   /* If a tree conflict will be installed once edited, it's reason. If a skip
  should be produced its reason. Some special values are defined. See the
- merge_tree_baton_t for an explanation. */
+ merge_dir_baton_t for an explanation. */
   svn_wc_conflict_reason_t tree_conflict_reason;
   svn_wc_conflict_action_t tree_conflict_action;
   svn_node_kind_t tree_conflict_local_node_kind;
@@ -1295,6 +1269,15 @@ record_skip(merge_cmd_baton_t *merge_b,
   return SVN_NO_ERROR;
 }
 
+/* Forward declaration */
+static svn_client__merge_path_t *
+find_nearest_ancestor_with_intersecting_ranges(
+  svn_revnum_t *start,
+  svn_revnum_t *end,
+  const apr_array_header_t *children_with_mergeinfo,
+  svn_boolean_t path_is_own_ancestor,
+  const char *local_abspath);
+
 /* Record a tree conflict in the WC, unless this is a dry run or a record-
  * only merge, or if a tree conflict is already flagged for the VICTIM_PATH.
  * (The latter can happen if a merge-tracking-aware merge is doing multiple
@@ -1366,11 +1349,45 @@ record_tree_conflict(merge_cmd_baton_t *
 reason = svn_wc_conflict_reason_moved_here;
 }
 
-  SVN_ERR(make_conflict_versions(, , local_abspath,
- merge_left_node_kind,
- merge_right_node_kind,
- _b->merge_source, merge_b->target,
- result_pool, scratch_pool));
+  if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral)
+{
+  struct merge_source_t *source;
+  svn_client__pathrev_t *loc1;
+  svn_client__pathrev_t *loc2;
+  svn_merge_range_t range =
+{SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE};
+
+  /* We are honoring mergeinfo so do not blindly record
+   * a conflict describing the merge of
+   * SOURCE->LOC1->URL@SOURCE->LOC1->REV through
+   * SOURCE->LOC2->URL@SOURCE->LOC2->REV
+   * but figure out the actual revision range merged. */
+  (void)find_nearest_ancestor_with_intersecting_ranges(
+&(range.start), &(range.end),
+merge_b->notify_begin.nodes_with_mergeinfo,
+action != svn_wc_conflict_action_delete,
+local_abspath);
+  loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1,
+ scratch_pool);
+  loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2,
+ scratch_pool);
+  loc1->rev = range.start;
+  loc2->rev = range.end;
+  source = merge_source_create(loc1, loc2,
+   merge_b->merge_source.ancestral,
+   scratch_pool);
+  SVN_ERR(make_conflict_versions(, , local_abspath,
+ merge_left_node_kind,
+ merge_right_node_kind,
+ source, merge_b->target,
+ result_pool, scratch_pool));
+}
+  else
+SVN_ERR(make_conflict_versions(, , local_abspath,
+   merge_left_node_kind,
+   merge_right_node_kind,
+   _b->merge_source, merge_b->target,
+   result_pool, scratch_pool));
 
   /* Fix 

svn commit: r1764214 [5/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_diff/diff3.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_diff/diff3.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_diff/diff3.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_diff/diff3.c Tue Oct 11 
09:11:50 2016
@@ -29,6 +29,7 @@
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "svn_diff.h"
+#include "svn_sorts.h"
 #include "svn_types.h"
 
 #include "diff.h"
@@ -324,6 +325,7 @@ svn_diff_diff3_2(svn_diff_t **diff,
   /* Produce a merged diff */
   {
 svn_diff_t **diff_ref = diff;
+svn_diff_t *diff_last = NULL;
 
 apr_off_t original_start = 1;
 apr_off_t modified_start = 1;
@@ -433,6 +435,7 @@ svn_diff_diff3_2(svn_diff_t **diff,
 
 if (is_modified || is_latest)
   {
+svn_boolean_t add_diff = TRUE;
 modified_length = modified_sync - modified_start;
 latest_length = latest_sync - latest_start;
 
@@ -453,17 +456,41 @@ svn_diff_diff3_2(svn_diff_t **diff,
_list[2],
num_tokens,
pool);
+/* add_diff = TRUE */
   }
-else if (is_modified)
+else if (is_modified
+ && (!diff_last
+ || diff_last->type != svn_diff__type_diff_latest))
   {
 (*diff_ref)->type = svn_diff__type_diff_modified;
+/* add_diff = TRUE */
   }
-else
+else if (is_latest
+ && (!diff_last
+ || diff_last->type != svn_diff__type_diff_modified))
   {
 (*diff_ref)->type = svn_diff__type_diff_latest;
+/* add_diff = TRUE */
   }
+else
+  {
+/* We have a latest and a modified region that touch each 
other,
+   but not directly change the same location. Create a single
+   conflict region to properly mark a conflict, and to ease
+   resolving. */
+diff_last->type = svn_diff__type_conflict;
+diff_last->original_length += (*diff_ref)->original_length;
+diff_last->modified_length += (*diff_ref)->modified_length;
+diff_last->latest_length += (*diff_ref)->latest_length;
 
-diff_ref = &(*diff_ref)->next;
+add_diff = FALSE;
+  }
+
+if (add_diff)
+  {
+diff_last = *diff_ref;
+diff_ref = &(*diff_ref)->next;
+  }
   }
 
 /* Detect EOF */
@@ -474,21 +501,24 @@ svn_diff_diff3_2(svn_diff_t **diff,
   - (original_sync - lcs_om->position[0]->offset);
 latest_length = lcs_ol->length
 - (original_sync - lcs_ol->position[0]->offset);
-common_length = modified_length < latest_length
-? modified_length : latest_length;
+common_length = MIN(modified_length, latest_length);
 
-(*diff_ref) = apr_palloc(pool, sizeof(**diff_ref));
+if (common_length > 0)
+  {
+(*diff_ref) = apr_palloc(pool, sizeof(**diff_ref));
 
-(*diff_ref)->type = svn_diff__type_common;
-(*diff_ref)->original_start = original_sync - 1;
-(*diff_ref)->original_length = common_length;
-(*diff_ref)->modified_start = modified_sync - 1;
-(*diff_ref)->modified_length = common_length;
-(*diff_ref)->latest_start = latest_sync - 1;
-(*diff_ref)->latest_length = common_length;
-(*diff_ref)->resolved_diff = NULL;
+(*diff_ref)->type = svn_diff__type_common;
+(*diff_ref)->original_start = original_sync - 1;
+(*diff_ref)->original_length = common_length;
+(*diff_ref)->modified_start = modified_sync - 1;
+(*diff_ref)->modified_length = common_length;
+(*diff_ref)->latest_start = latest_sync - 1;
+(*diff_ref)->latest_length = common_length;
+(*diff_ref)->resolved_diff = NULL;
 
-diff_ref = &(*diff_ref)->next;
+diff_last = *diff_ref;
+diff_ref = &(*diff_ref)->next;
+  }
 
 /* Set the new offsets */
 original_start = original_sync + common_length;

Modified: subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_diff/parse-diff.c (original)
+++ 

svn commit: r1764214 [17/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: 
subversion/branches/ra-git/subversion/tests/cmdline/mod_dav_svn_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/mod_dav_svn_tests.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/mod_dav_svn_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/mod_dav_svn_tests.py 
Tue Oct 11 09:11:50 2016
@@ -25,7 +25,14 @@
 ##
 
 # General modules
-import logging, httplib, base64
+import os, logging, base64, functools
+
+try:
+  # Python <3.0
+  import httplib
+except ImportError:
+  # Python >=3.0
+  import http.client as httplib
 
 logger = logging.getLogger()
 
@@ -41,6 +48,92 @@ Issue = svntest.testcase.Issue_deco
 Wimp = svntest.testcase.Wimp_deco
 
 ##
+# Helper routines
+
+def compare(lhs, rhs):
+  """Implements cmp() for Python 2 and 3 alike"""
+  if lhs == None:
+if rhs == None:
+  return 0
+else:
+  return -1
+  else:
+if rhs == None:
+  return 1
+else:
+  return (lhs > rhs) - (lhs < rhs)
+
+def compare_dict(lhs, rhs):
+  """Implements dictionary comparison for Python 2 and 3 alike"""
+  lhs_sorted = sorted(lhs, key=lambda x:sorted(x.keys()))
+  rhs_sorted = sorted(rhs, key=lambda x:sorted(x.keys()))
+  return (lhs_sorted > rhs_sorted) - (lhs_sorted < rhs_sorted)
+
+def compare_xml_elem(a, b):
+  """Recursively compare two xml.etree.ElementTree.Element objects.
+  Return a 3-tuple made out of (cmp, elem_a, elem_b), where cmp is
+  the integer result of the comparison (negative, zero or positive),
+  and elem_a and elem_b point to mismatching elements.  Iff cmp is
+  zero, elem_a and elem_b are None. """
+
+  # Compare tags, attributes, inner text, tail attribute and the
+  # number of child elements.
+  res = compare(a.tag, b.tag)
+  if res != 0:
+return res, a, b
+  # Don't care about the order of the attributes.
+  res = compare_dict(a.attrib, b.attrib)
+  if res != 0:
+return res, a, b
+  res = compare(a.text, b.text)
+  if res != 0:
+return res, a, b
+  res = compare(a.tail, b.tail)
+  if res != 0:
+return res, a, b
+  res = compare(len(a), len(b))
+  if res != 0:
+return res, a, b
+
+  # Prior to recursing, order child elements using the same comparator.
+  # Right now we don't care about the order of the elements.  For instance,
+  # 's in PROPFIND *need* to be compared without a particular
+  # order, since the server returns them in an unstable order of the hash
+  # iteration.
+  def sortcmp(x, y):
+return compare_xml_elem(x, y)[0]
+ 
+  a_children = sorted(list(a), key=functools.cmp_to_key(sortcmp))
+  b_children = sorted(list(b), key=functools.cmp_to_key(sortcmp))
+
+  for a_child, b_child in zip(a_children, b_children):
+res = compare_xml_elem(a_child, b_child)
+if res[0] != 0:
+  return res
+
+  # Elements are equal.
+  return 0, None, None
+
+def verify_xml_response(expected_xml, actual_xml):
+  """Parse and compare two XML responses, raise svntest.Failure
+  in case EXPECTED_XML doesn't match ACTUAL_XML. """
+
+  import xml.etree.ElementTree as ET
+
+  expected_root = ET.fromstring(expected_xml)
+  actual_root = ET.fromstring(actual_xml)
+  res, expected_elem, actual_elem = compare_xml_elem(expected_root,
+ actual_root)
+  if res != 0:
+# The actual response doesn't match our expectations; dump it for
+# debugging purposes, and highlight the mismatching xml element.
+logger.warn("Response:\n%s" % actual_xml)
+raise svntest.Failure("Unexpected response part\n"
+  "  Expected: '%s'\nActual: '%s'\n"
+  % (ET.tostring(expected_elem),
+ ET.tostring(actual_elem)))
+
+##
 # Tests
 
 @SkipUnless(svntest.main.is_ra_type_dav)
@@ -50,7 +143,7 @@ def cache_control_header(sbox):
   sbox.build(create_wc=False, read_only=True)
 
   headers = {
-'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+'Authorization': 'Basic ' + 
base64.b64encode(b'jconstant:rayjandom').decode(),
   }
 
   h = svntest.main.create_http_connection(sbox.repo_url)
@@ -142,6 +235,411 @@ def cache_control_header(sbox):
   r.read()
 
 
+@SkipUnless(svntest.main.is_ra_type_dav)
+def simple_propfind(sbox):
+  "verify simple PROPFIND responses"
+
+  sbox.build(create_wc=False, read_only=True)
+  repo_uripath = '/' + svntest.wc.svn_uri_quote(
+svntest.main.pristine_greek_repos_dir.replace(os.path.sep, '/'))
+  h = svntest.main.create_http_connection(sbox.repo_url)
+
+  # PROPFIND /repos/!svn/rvr/1, Depth = 0
+  headers = {
+'Authorization': 'Basic ' + 

svn commit: r1764214 [14/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/svn/conflict-callbacks.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svn/conflict-callbacks.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/ra-git/subversion/svn/conflict-callbacks.c Tue Oct 11 
09:11:50 2016
@@ -40,58 +40,13 @@
 #include "cl-conflicts.h"
 
 #include "private/svn_cmdline_private.h"
-#include "private/svn_wc_private.h"
 
 #include "svn_private_config.h"
 
 #define ARRAY_LEN(ary) ((sizeof (ary)) / (sizeof ((ary)[0])))
-#define MAX_ARRAY_LEN(aryx, aryz)   \
-  (ARRAY_LEN((aryx)) > ARRAY_LEN((aryz))\
-   ? ARRAY_LEN((aryx)) : ARRAY_LEN((aryz)))
 
 
 
-struct svn_cl__interactive_conflict_baton_t {
-  svn_cl__accept_t accept_which;
-  apr_hash_t *config;
-  const char *editor_cmd;
-  svn_boolean_t external_failed;
-  svn_cmdline_prompt_baton_t *pb;
-  const char *path_prefix;
-  svn_boolean_t quit;
-  svn_cl__conflict_stats_t *conflict_stats;
-  svn_boolean_t printed_summary;
-};
-
-svn_error_t *
-svn_cl__get_conflict_func_interactive_baton(
-  svn_cl__interactive_conflict_baton_t **b,
-  svn_cl__accept_t accept_which,
-  apr_hash_t *config,
-  const char *editor_cmd,
-  svn_cl__conflict_stats_t *conflict_stats,
-  svn_cancel_func_t cancel_func,
-  void *cancel_baton,
-  apr_pool_t *result_pool)
-{
-  svn_cmdline_prompt_baton_t *pb = apr_palloc(result_pool, sizeof(*pb));
-  pb->cancel_func = cancel_func;
-  pb->cancel_baton = cancel_baton;
-
-  *b = apr_palloc(result_pool, sizeof(**b));
-  (*b)->accept_which = accept_which;
-  (*b)->config = config;
-  (*b)->editor_cmd = editor_cmd;
-  (*b)->external_failed = FALSE;
-  (*b)->pb = pb;
-  SVN_ERR(svn_dirent_get_absolute(&(*b)->path_prefix, "", result_pool));
-  (*b)->quit = FALSE;
-  (*b)->conflict_stats = conflict_stats;
-  (*b)->printed_summary = FALSE;
-
-  return SVN_NO_ERROR;
-}
-
 svn_cl__accept_t
 svn_cl__accept_from_word(const char *word)
 {
@@ -131,7 +86,7 @@ svn_cl__accept_from_word(const char *wor
 /* Print on stdout a diff that shows incoming conflicting changes
  * corresponding to the conflict described in CONFLICT. */
 static svn_error_t *
-show_diff(const svn_client_conflict_t *conflict,
+show_diff(svn_client_conflict_t *conflict,
   const char *merged_abspath,
   const char *path_prefix,
   svn_cancel_func_t cancel_func,
@@ -213,7 +168,7 @@ show_diff(const svn_client_conflict_t *c
 /* Print on stdout just the conflict hunks of a diff among the 'base', 'their'
  * and 'my' files of CONFLICT. */
 static svn_error_t *
-show_conflicts(const svn_client_conflict_t *conflict,
+show_conflicts(svn_client_conflict_t *conflict,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool)
@@ -383,23 +338,19 @@ edit_prop_conflict(const svn_string_t **
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
 {
-  apr_file_t *file;
   const char *file_path;
   svn_boolean_t performed_edit = FALSE;
   svn_stream_t *merged_prop;
 
-  SVN_ERR(svn_io_open_unique_file3(, _path, NULL,
-   svn_io_file_del_on_pool_cleanup,
-   result_pool, scratch_pool));
-  merged_prop = svn_stream_from_aprfile2(file, TRUE /* disown */,
- scratch_pool);
+  SVN_ERR(svn_stream_open_unique(_prop, _path, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
   SVN_ERR(merge_prop_conflict(merged_prop, base_propval, my_propval,
   their_propval, NULL,
   pb->cancel_func,
   pb->cancel_baton,
   scratch_pool));
   SVN_ERR(svn_stream_close(merged_prop));
-  SVN_ERR(svn_io_file_flush(file, scratch_pool));
   SVN_ERR(open_editor(_edit, file_path, editor_cmd,
   config, scratch_pool));
   if (performed_edit && merged_propval)
@@ -416,159 +367,161 @@ edit_prop_conflict(const svn_string_t **
 /* Maximum line length for the prompt string. */
 #define MAX_PROMPT_WIDTH 70
 
-/* Description of a resolver option */
+/* Description of a resolver option.
+ * Resolver options are used to build the resolver's conflict prompt.
+ * The user types a code to select the corresponding conflict resolution 
option.
+ * Some resolver options have a corresponding --accept argument. */
 typedef struct resolver_option_t
 {
   const char *code;/* one or two characters */
   const char *short_desc;  /* label in prompt (localized) */
   const char *long_desc;   /* longer description (localized) */
   svn_client_conflict_option_id_t choice;
-   /* or ..._undefined if not a simple choice 

svn commit: r1764214 [19/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: 
subversion/branches/ra-git/subversion/tests/cmdline/svntest/mergetrees.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svntest/mergetrees.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/svntest/mergetrees.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svntest/mergetrees.py 
Tue Oct 11 09:11:50 2016
@@ -29,7 +29,7 @@ import shutil, sys, re, os
 import time
 
 # Our testing module
-import main, wc, verify, actions, testcase
+from svntest import main, wc, verify, actions, testcase
 
 from prop_tests import binary_mime_type_on_text_file_warning
 

Modified: subversion/branches/ra-git/subversion/tests/cmdline/svntest/objects.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svntest/objects.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/svntest/objects.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svntest/objects.py Tue 
Oct 11 09:11:50 2016
@@ -127,7 +127,7 @@ def locate_db_dump():
 try:
   if subprocess.Popen([db_dump_name, "-V"]).wait() == 0:
 return db_dump_name
-except OSError, e:
+except OSError as e:
   pass
   return 'none'
 

Modified: subversion/branches/ra-git/subversion/tests/cmdline/svntest/sandbox.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svntest/sandbox.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/svntest/sandbox.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svntest/sandbox.py Tue 
Oct 11 09:11:50 2016
@@ -434,7 +434,8 @@ class Sandbox:
   def simple_append(self, dest, contents, truncate=False):
 """Append CONTENTS to file DEST, optionally truncating it first.
DEST is a relpath relative to the WC."""
-open(self.ospath(dest), truncate and 'wb' or 'ab').write(contents)
+svntest.main.file_write(self.ospath(dest), contents,
+truncate and 'wb' or 'ab')
 
   def simple_lock(self, *targets):
 """Lock TARGETS in the WC.

Modified: 
subversion/branches/ra-git/subversion/tests/cmdline/svntest/testcase.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svntest/testcase.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/svntest/testcase.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svntest/testcase.py Tue 
Oct 11 09:11:50 2016
@@ -141,9 +141,9 @@ class FunctionTestCase(TestCase):
 # docstring on it.
 assert isinstance(func, types.FunctionType)
 
-name = func.func_name
+name = func.__name__
 
-assert func.func_code.co_argcount == 1, \
+assert func.__code__.co_argcount == 1, \
 '%s must take an sbox argument' % name
 
 doc = func.__doc__.strip()
@@ -165,13 +165,13 @@ class FunctionTestCase(TestCase):
 self.skip_cross_check = skip_cross_check
 
   def get_function_name(self):
-return self.func.func_name
+return self.func.__name__
 
   def get_sandbox_name(self):
 """Base the sandbox's name on the name of the file in which the
 function was defined."""
 
-filename = self.func.func_code.co_filename
+filename = self.func.__code__.co_filename
 return os.path.splitext(os.path.basename(filename))[0]
 
   def run(self, sandbox):

Modified: subversion/branches/ra-git/subversion/tests/cmdline/svntest/tree.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svntest/tree.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/svntest/tree.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svntest/tree.py Tue Oct 
11 09:11:50 2016
@@ -499,6 +499,7 @@ def create_from_path(path, contents=None
 
 
 eol_re = re.compile(r'(\r\n|\r)')
+eol_re_binary = re.compile(br'(\r\n|\r)')
 
 # helper for build_tree_from_wc()
 def get_props(paths):
@@ -544,7 +545,10 @@ def get_props(paths):
   # contains a CR character XML-encoded as ''.  The XML
   # parser converts it back into a CR character.  So again convert
   # all end-of-line variants into a single LF:
-  value = eol_re.sub('\n', value)
+  if isinstance(value, str):
+value = eol_re.sub('\n', value)
+  else:
+value = eol_re_binary.sub(b'\n', value)
   file_props[name] = value
 files[filename] = file_props
 
@@ -715,7 +719,7 @@ def 

svn commit: r1764214 [1/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Author: rhuijben
Date: Tue Oct 11 09:11:50 2016
New Revision: 1764214

URL: http://svn.apache.org/viewvc?rev=1764214=rev
Log:
Bring up to date with trunk, resolving a few minor text conflicts in build.conf

Added:
subversion/branches/ra-git/notes/meetings/berlin-16-minutes
  - copied unchanged from r1764213, 
subversion/trunk/notes/meetings/berlin-16-minutes
subversion/branches/ra-git/notes/move-tracking/path_pairs_to_eid_map.py
  - copied unchanged from r1764213, 
subversion/trunk/notes/move-tracking/path_pairs_to_eid_map.py
subversion/branches/ra-git/subversion/bindings/swig/include/proxy.py
  - copied unchanged from r1764213, 
subversion/trunk/subversion/bindings/swig/include/proxy.py
subversion/branches/ra-git/subversion/include/private/ra_svn_wrapped_sasl.h
  - copied unchanged from r1764213, 
subversion/trunk/subversion/include/private/ra_svn_wrapped_sasl.h
subversion/branches/ra-git/subversion/libsvn_client/conflicts.c
  - copied unchanged from r1764213, 
subversion/trunk/subversion/libsvn_client/conflicts.c
subversion/branches/ra-git/subversion/libsvn_client/merge_elements.c
  - copied unchanged from r1764213, 
subversion/trunk/subversion/libsvn_client/merge_elements.c
subversion/branches/ra-git/subversion/libsvn_ra_serf/request_body.c
  - copied unchanged from r1764213, 
subversion/trunk/subversion/libsvn_ra_serf/request_body.c
subversion/branches/ra-git/subversion/libsvn_ra_svn/wrapped_sasl.c
  - copied unchanged from r1764213, 
subversion/trunk/subversion/libsvn_ra_svn/wrapped_sasl.c
subversion/branches/ra-git/subversion/libsvn_repos/compat.c
  - copied unchanged from r1764213, 
subversion/trunk/subversion/libsvn_repos/compat.c
subversion/branches/ra-git/subversion/tests/libsvn_client/conflicts-test.c
  - copied unchanged from r1764213, 
subversion/trunk/subversion/tests/libsvn_client/conflicts-test.c

subversion/branches/ra-git/tools/buildbot/slaves/svn-sparc-solaris/mount-tmpfs.c
  - copied unchanged from r1764213, 
subversion/trunk/tools/buildbot/slaves/svn-sparc-solaris/mount-tmpfs.c

subversion/branches/ra-git/tools/buildbot/slaves/svn-sparc-solaris/rebuild-svn-bits.sh
  - copied unchanged from r1764213, 
subversion/trunk/tools/buildbot/slaves/svn-sparc-solaris/rebuild-svn-bits.sh

subversion/branches/ra-git/tools/buildbot/slaves/svn-sparc-solaris/serf.patch
  - copied unchanged from r1764213, 
subversion/trunk/tools/buildbot/slaves/svn-sparc-solaris/serf.patch

subversion/branches/ra-git/tools/buildbot/slaves/svn-sparc-solaris/twisted.patch
  - copied unchanged from r1764213, 
subversion/trunk/tools/buildbot/slaves/svn-sparc-solaris/twisted.patch
subversion/branches/ra-git/tools/dev/find-control-statements.py
  - copied unchanged from r1764213, 
subversion/trunk/tools/dev/find-control-statements.py
subversion/branches/ra-git/tools/dist/backport_unicode_entry.dump
  - copied unchanged from r1764213, 
subversion/trunk/tools/dist/backport_unicode_entry.dump
Removed:
subversion/branches/ra-git/contrib/server-side/svncutter/svncutter
subversion/branches/ra-git/subversion/libsvn_ra_serf/README
Modified:
subversion/branches/ra-git/   (props changed)
subversion/branches/ra-git/CHANGES
subversion/branches/ra-git/COMMITTERS
subversion/branches/ra-git/INSTALL
subversion/branches/ra-git/Makefile.in
subversion/branches/ra-git/NOTICE
subversion/branches/ra-git/README
subversion/branches/ra-git/build.conf
subversion/branches/ra-git/build/ac-macros/apache.m4
subversion/branches/ra-git/build/ac-macros/kwallet.m4
subversion/branches/ra-git/build/ac-macros/swig.m4
subversion/branches/ra-git/build/ac-macros/zlib.m4
subversion/branches/ra-git/build/generator/gen_base.py
subversion/branches/ra-git/build/generator/gen_win_dependencies.py
subversion/branches/ra-git/build/run_tests.py
subversion/branches/ra-git/build/win32/svn.rc
subversion/branches/ra-git/configure.ac
subversion/branches/ra-git/contrib/client-side/incremental-update.py
subversion/branches/ra-git/contrib/client-side/svn-hgmerge.py
subversion/branches/ra-git/contrib/client-side/svn-merge-vendor.py
subversion/branches/ra-git/contrib/client-side/svn_apply_autoprops.py
subversion/branches/ra-git/contrib/client-side/svn_export_empty_files.py

subversion/branches/ra-git/contrib/client-side/svnmerge/svnmerge-migrate-history-remotely.py

subversion/branches/ra-git/contrib/client-side/svnmerge/svnmerge-migrate-history.py
subversion/branches/ra-git/contrib/client-side/svnmerge/svnmerge.py
subversion/branches/ra-git/contrib/client-side/svnmerge/svnmerge_test.py
subversion/branches/ra-git/contrib/hook-scripts/hook_toolbox.py
subversion/branches/ra-git/contrib/hook-scripts/remove-zombie-locks.py
subversion/branches/ra-git/contrib/server-side/add-needs-lock.py


svn commit: r1764214 [9/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_ra_serf/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_serf/commit.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_serf/commit.c Tue Oct 11 
09:11:50 2016
@@ -170,11 +170,11 @@ typedef struct file_context_t {
   const char *copy_path;
   svn_revnum_t copy_revision;
 
-  /* stream */
+  /* Stream for collecting the svndiff. */
   svn_stream_t *stream;
 
-  /* Temporary file containing the svndiff. */
-  apr_file_t *svndiff;
+  /* Buffer holding the svndiff (can spill to disk). */
+  svn_ra_serf__request_body_t *svndiff;
 
   /* Our base checksum as reported by the WC. */
   const char *base_checksum;
@@ -869,35 +869,6 @@ proppatch_resource(svn_ra_serf__session_
 
 /* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
-create_put_body(serf_bucket_t **body_bkt,
-void *baton,
-serf_bucket_alloc_t *alloc,
-apr_pool_t *pool /* request pool */,
-apr_pool_t *scratch_pool)
-{
-  file_context_t *ctx = baton;
-  apr_off_t offset;
-
-  /* We need to flush the file, make it unbuffered (so that it can be
-   * zero-copied via mmap), and reset the position before attempting to
-   * deliver the file.
-   *
-   * N.B. If we have APR 1.3+, we can unbuffer the file to let us use mmap
-   * and zero-copy the PUT body.  However, on older APR versions, we can't
-   * check the buffer status; but serf will fall through and create a file
-   * bucket for us on the buffered svndiff handle.
-   */
-  SVN_ERR(svn_io_file_flush(ctx->svndiff, pool));
-  apr_file_buffer_set(ctx->svndiff, NULL, 0);
-  offset = 0;
-  SVN_ERR(svn_io_file_seek(ctx->svndiff, APR_SET, , pool));
-
-  *body_bkt = serf_bucket_file_create(ctx->svndiff, alloc);
-  return SVN_NO_ERROR;
-}
-
-/* Implements svn_ra_serf__request_body_delegate_t */
-static svn_error_t *
 create_empty_put_body(serf_bucket_t **body_bkt,
   void *baton,
   serf_bucket_alloc_t *alloc,
@@ -1444,7 +1415,6 @@ delete_entry(const char *path,
   delete_context_t *delete_ctx;
   svn_ra_serf__handler_t *handler;
   const char *delete_target;
-  svn_error_t *err;
 
   if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
 {
@@ -1478,24 +1448,36 @@ delete_entry(const char *path,
 
   handler->method = "DELETE";
   handler->path = delete_target;
+  handler->no_fail_on_http_failure_status = TRUE;
 
-  err = svn_ra_serf__context_run_one(handler, pool);
-  if (err && err->apr_err == SVN_ERR_RA_DAV_REQUEST_FAILED
-  && handler->sline.code == 400)
-{
-  svn_error_clear(err);
+  SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
+  if (handler->sline.code == 400)
+{
   /* Try again with non-standard body to overcome Apache Httpd
  header limit */
   delete_ctx->non_recursive_if = TRUE;
+
+  handler = svn_ra_serf__create_handler(dir->commit_ctx->session, pool);
+
+  handler->response_handler = svn_ra_serf__expect_empty_body;
+  handler->response_baton = handler;
+
+  handler->header_delegate = setup_delete_headers;
+  handler->header_delegate_baton = delete_ctx;
+
+  handler->method = "DELETE";
+  handler->path = delete_target;
+
   handler->body_type = "text/xml";
   handler->body_delegate = create_delete_body;
   handler->body_delegate_baton = delete_ctx;
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 }
-  else
-SVN_ERR(err);
+
+  if (handler->server_error)
+return svn_ra_serf__server_error_create(handler, pool);
 
   /* 204 No Content: item successfully deleted */
   if (handler->sline.code != 204)
@@ -1877,23 +1859,6 @@ open_file(const char *path,
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_stream_lazyopen_func_t for apply_textdelta */
-static svn_error_t *
-delayed_commit_stream_open(svn_stream_t **stream,
-   void *baton,
-   apr_pool_t *result_pool,
-   apr_pool_t *scratch_pool)
-{
-  file_context_t *file_ctx = baton;
-
-  SVN_ERR(svn_io_open_unique_file3(_ctx->svndiff, NULL, NULL,
-   svn_io_file_del_on_pool_cleanup,
-   file_ctx->pool, scratch_pool));
-
-  *stream = svn_stream_from_aprfile2(file_ctx->svndiff, TRUE, result_pool);
-  return SVN_NO_ERROR;
-}
-
 static svn_error_t *
 apply_textdelta(void *file_baton,
 const char *base_checksum,
@@ -1905,12 +1870,12 @@ apply_textdelta(void *file_baton,
   int svndiff_version;
   int compression_level;
 
-  /* Store the stream in a temporary file; we'll give it to serf when we
+  /* Construct a holder for the request body; we'll give it to serf when we
* close this file.
*
 

svn commit: r1764214 [18/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/tests/cmdline/svnadmin_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/cmdline/svnadmin_tests.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/cmdline/svnadmin_tests.py 
(original)
+++ subversion/branches/ra-git/subversion/tests/cmdline/svnadmin_tests.py Tue 
Oct 11 09:11:50 2016
@@ -114,8 +114,8 @@ def check_hotcopy_fsfs_fsx(src, dst):
 # to match. Source and target must have the same number of lines
 # (due to having the same format).
 if src_path == os.path.join(src, 'db', 'uuid'):
-  lines1 = open(src_path, 'rb').read().split("\n")
-  lines2 = open(dst_path, 'rb').read().split("\n")
+  lines1 = open(src_path, 'rb').read().split(b"\n")
+  lines2 = open(dst_path, 'rb').read().split(b"\n")
   if len(lines1) != len(lines2):
 raise svntest.Failure("%s differs in number of lines"
   % dst_path)
@@ -153,8 +153,8 @@ def check_hotcopy_fsfs_fsx(src, dst):
 "revprop generation")
   continue
 
-f1 = open(src_path, 'r')
-f2 = open(dst_path, 'r')
+f1 = open(src_path, 'rb')
+f2 = open(dst_path, 'rb')
 while True:
   offset = 0
   BUFSIZE = 1024
@@ -239,14 +239,14 @@ def patch_format(repo_dir, shard_size):
   contents = open(format_path, 'rb').read()
   processed_lines = []
 
-  for line in contents.split("\n"):
-if line.startswith("layout "):
-  processed_lines.append("layout sharded %d" % shard_size)
+  for line in contents.split(b"\n"):
+if line.startswith(b"layout "):
+  processed_lines.append(("layout sharded %d" % shard_size).encode())
 else:
   processed_lines.append(line)
 
-  new_contents = "\n".join(processed_lines)
-  os.chmod(format_path, 0666)
+  new_contents = b"\n".join(processed_lines)
+  os.chmod(format_path, svntest.main.S_ALL_RW)
   open(format_path, 'wb').write(new_contents)
 
 def is_sharded(repo_dir):
@@ -255,8 +255,8 @@ def is_sharded(repo_dir):
   format_path = os.path.join(repo_dir, "db", "format")
   contents = open(format_path, 'rb').read()
 
-  for line in contents.split("\n"):
-if line.startswith("layout sharded"):
+  for line in contents.split(b"\n"):
+if line.startswith(b"layout sharded"):
   return True
 
   return False
@@ -269,8 +269,7 @@ def load_and_verify_dumpstream(sbox, exp
   of each rev's items.  VARARGS are optional arguments passed to the
   'load' command."""
 
-  if isinstance(dump, str):
-dump = [ dump ]
+  dump = svntest.main.ensure_list(dump)
 
   exit_code, output, errput = svntest.main.run_command_stdin(
 svntest.main.svnadmin_binary, expected_stderr, 0, True, dump,
@@ -334,24 +333,25 @@ class FSFS_Index:
 for line in output:
   values = line.split()
   if len(values) >= 4 and values[0] != 'Start':
-item = long(values[4])
+item = int(values[4])
 self.by_item[item] = values
 
   def _write(self):
 """ Rewrite indexes using svnfsfs. """
 by_offset = {}
-for values in self.by_item.itervalues():
-  by_offset[long(values[0], 16)] = values
+for key in self.by_item:
+  values = self.by_item[key]
+  by_offset[int(values[0], 16)] = values
 
 lines = []
 for (offset, values) in sorted(by_offset.items()):
   values = by_offset[offset]
   line = values[0] + ' ' + values[1] + ' ' + values[2] + ' ' + \
  values[3] + ' ' + values[4] + '\n';
-  lines.append(line)
+  lines.append(line.encode())
 
 exit_code, output, errput = svntest.main.run_command_stdin(
-  svntest.main.svnfsfs_binary, 0, 0, True, lines,
+  svntest.main.svnfsfs_binary, 0, 0, False, lines,
   'load-index', self.repo_dir)
 
 svntest.verify.verify_outputs("Error while rewriting index",
@@ -362,8 +362,8 @@ class FSFS_Index:
 """ Return offset, length and type of ITEM. """
 values = self.by_item[item]
 
-offset = long(values[0], 16)
-len = long(values[1], 16)
+offset = int(values[0], 16)
+len = int(values[1], 16)
 type = values[2]
 
 return (offset, len, type)
@@ -399,17 +399,20 @@ def set_changed_path_list(sbox, revision
 
   if repo_format(sbox) < 7:
 # replace the changed paths list
-header = contents[contents.rfind('\n', length - 64, length - 1):]
-body_len = long(header.split(' ')[1])
+header = contents[contents.rfind(b'\n', length - 64, length - 1):]
+body_len = int(header.split(b' ')[1])
 
   else:
 # read & parse revision file footer
-footer_length = ord(contents[length-1]);
+footer_length = contents[length-1];
+if isinstance(footer_length, str):
+  footer_length = ord(footer_length)
+
 footer = contents[length - footer_length - 1:length-1]
-l2p_offset = 

svn commit: r1764214 [16/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c Tue Oct 11 
09:11:50 2016
@@ -74,6 +74,8 @@ static int canonicalize_username(sasl_co
 {
   /* The only valid realm is user_realm (i.e. the repository's realm).
  If the user gave us another realm, complain. */
+  if (realm_len != inlen-(pos-in+1))
+return SASL_BADPROT;
   if (strncmp(pos+1, user_realm, inlen-(pos-in+1)) != 0)
 return SASL_BADPROT;
 }
@@ -110,11 +112,12 @@ static svn_error_t *initialize(void *bat
 
   /* The second parameter tells SASL to look for a configuration file
  named subversion.conf. */
-  result = sasl_server_init(callbacks, SVN_RA_SVN_SASL_NAME);
+  result = svn_sasl__server_init(callbacks, SVN_RA_SVN_SASL_NAME);
   if (result != SASL_OK)
 {
-  svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-  sasl_errstring(result, NULL, NULL));
+  svn_error_t *err = svn_error_create(
+  SVN_ERR_RA_NOT_AUTHORIZED, NULL,
+  svn_sasl__errstring(result, NULL, NULL));
   return svn_error_quick_wrap(err,
   _("Could not initialize the SASL library"));
 }
@@ -133,7 +136,7 @@ svn_error_t *cyrus_init(apr_pool_t *pool
 static svn_error_t *
 fail_auth(svn_ra_svn_conn_t *conn, apr_pool_t *pool, sasl_conn_t *sasl_ctx)
 {
-  const char *msg = sasl_errdetail(sasl_ctx);
+  const char *msg = svn_sasl__errdetail(sasl_ctx);
   SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(c)", "failure", msg));
   return svn_ra_svn__flush(conn, pool);
 }
@@ -154,7 +157,7 @@ static svn_error_t *
 fail_cmd(svn_ra_svn_conn_t *conn, apr_pool_t *pool, sasl_conn_t *sasl_ctx)
 {
   svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-  sasl_errdetail(sasl_ctx));
+  svn_sasl__errdetail(sasl_ctx));
   SVN_ERR(write_failure(conn, pool, ));
   return svn_ra_svn__flush(conn, pool);
 }
@@ -190,9 +193,10 @@ static svn_error_t *try_auth(svn_ra_svn_
 return svn_error_createf(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
  _("Initial token is too long"));
 
-  result = sasl_server_start(sasl_ctx, mech,
- in ? in->data : NULL,
- in ? (unsigned int) in->len : 0, , );
+  result = svn_sasl__server_start(sasl_ctx, mech,
+  in ? in->data : NULL,
+  in ? (unsigned int) in->len : 0,
+  , );
 
   if (result != SASL_OK && result != SASL_CONTINUE)
 return fail_auth(conn, pool, sasl_ctx);
@@ -221,8 +225,9 @@ static svn_error_t *try_auth(svn_ra_svn_
 return svn_error_createf(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
  _("Step response is too long"));
 
-  result = sasl_server_step(sasl_ctx, in->data, (unsigned int) in->len,
-, );
+  result = svn_sasl__server_step(sasl_ctx, in->data,
+ (unsigned int) in->len,
+ , );
 }
 
   if (result != SASL_OK)
@@ -244,7 +249,7 @@ static svn_error_t *try_auth(svn_ra_svn_
 static apr_status_t sasl_dispose_cb(void *data)
 {
   sasl_conn_t *sasl_ctx = (sasl_conn_t*) data;
-  sasl_dispose(_ctx);
+  svn_sasl__dispose(_ctx);
   return APR_SUCCESS;
 }
 
@@ -276,15 +281,16 @@ svn_error_t *cyrus_auth_request(svn_ra_s
 
   /* Create a SASL context. SASL_SUCCESS_DATA tells SASL that the protocol
  supports sending data along with the final "success" message. */
-  result = sasl_server_new(SVN_RA_SVN_SASL_NAME,
-   hostname, b->repository->realm,
-   localaddrport, remoteaddrport,
-   NULL, SASL_SUCCESS_DATA,
-   _ctx);
+  result = svn_sasl__server_new(SVN_RA_SVN_SASL_NAME,
+hostname, b->repository->realm,
+localaddrport, remoteaddrport,
+NULL, SASL_SUCCESS_DATA,
+_ctx);
   if (result != SASL_OK)
 {
-  svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-  sasl_errstring(result, NULL, NULL));
+  svn_error_t *err = svn_error_create(
+  SVN_ERR_RA_NOT_AUTHORIZED, NULL,
+  svn_sasl__errstring(result, NULL, NULL));
   SVN_ERR(write_failure(conn, pool, ));
   return svn_ra_svn__flush(conn, pool);
 }
@@ -305,20 +311,20 @@ svn_error_t 

svn commit: r1764214 [6/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_fs/pack.c Tue Oct 11 
09:11:50 2016
@@ -221,7 +221,7 @@ typedef struct pack_context_t
* to NULL that we already processed. */
   apr_array_header_t *reps;
 
-  /* array of int, marking for each revision, the which offset their items
+  /* array of int, marking for each revision, at which offset their items
* begin in REPS.  Will be filled in phase 2 and be cleared after
* each revision range. */
   apr_array_header_t *rev_offsets;
@@ -233,6 +233,9 @@ typedef struct pack_context_t
   /* pool used for temporary data structures that will be cleaned up when
* the next range of revisions is being processed */
   apr_pool_t *info_pool;
+
+  /* ensure that all filesystem changes are written to disk. */
+  svn_boolean_t flush_to_disk;
 } pack_context_t;
 
 /* Create and initialize a new pack context for packing shard SHARD_REV in
@@ -240,7 +243,7 @@ typedef struct pack_context_t
  * and return the structure in *CONTEXT.
  *
  * Limit the number of items being copied per iteration to MAX_ITEMS.
- * Set CANCEL_FUNC and CANCEL_BATON as well.
+ * Set FLUSH_TO_DISK, CANCEL_FUNC and CANCEL_BATON as well.
  */
 static svn_error_t *
 initialize_pack_context(pack_context_t *context,
@@ -249,6 +252,7 @@ initialize_pack_context(pack_context_t *
 const char *shard_dir,
 svn_revnum_t shard_rev,
 int max_items,
+svn_boolean_t flush_to_disk,
 svn_cancel_func_t cancel_func,
 void *cancel_baton,
 apr_pool_t *pool)
@@ -325,6 +329,8 @@ initialize_pack_context(pack_context_t *
   context->info_pool = svn_pool_create(pool);
   context->paths = svn_prefix_tree__create(context->info_pool);
 
+  context->flush_to_disk = flush_to_disk;
+
   return SVN_NO_ERROR;
 }
 
@@ -349,6 +355,7 @@ reset_pack_context(pack_context_t *conte
   SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool));
 
   svn_pool_clear(context->info_pool);
+  context->paths = svn_prefix_tree__create(context->info_pool);
 
   return SVN_NO_ERROR;
 }
@@ -385,7 +392,8 @@ close_pack_context(pack_context_t *conte
   SVN_ERR(svn_io_remove_file2(proto_p2l_index_path, FALSE, pool));
 
   /* Ensure that packed file is written to disk.*/
-  SVN_ERR(svn_io_file_flush_to_disk(context->pack_file, pool));
+  if (context->flush_to_disk)
+SVN_ERR(svn_io_file_flush_to_disk(context->pack_file, pool));
   SVN_ERR(svn_io_file_close(context->pack_file, pool));
 
   return SVN_NO_ERROR;
@@ -700,7 +708,7 @@ tweak_path_for_ordering(const char *orig
  */
 static svn_error_t *
 copy_node_to_temp(pack_context_t *context,
-  apr_file_t *rev_file,
+  svn_fs_fs__revision_file_t *rev_file,
   svn_fs_fs__p2l_entry_t *entry,
   apr_pool_t *pool)
 {
@@ -708,13 +716,10 @@ copy_node_to_temp(pack_context_t *contex
  sizeof(*path_order));
   node_revision_t *noderev;
   const char *sort_path;
-  svn_stream_t *stream;
   apr_off_t source_offset = entry->offset;
 
   /* read & parse noderev */
-  stream = svn_stream_from_aprfile2(rev_file, TRUE, pool);
-  SVN_ERR(svn_fs_fs__read_noderev(, stream, pool, pool));
-  SVN_ERR(svn_stream_close(stream));
+  SVN_ERR(svn_fs_fs__read_noderev(, rev_file->stream, pool, pool));
 
   /* create a copy of ENTRY, make it point to the copy destination and
* store it in CONTEXT */
@@ -724,9 +729,9 @@ copy_node_to_temp(pack_context_t *contex
   add_item_rep_mapping(context, entry);
 
   /* copy the noderev to our temp file */
-  SVN_ERR(svn_io_file_seek(rev_file, APR_SET, _offset, pool));
-  SVN_ERR(copy_file_data(context, context->reps_file, rev_file, entry->size,
- pool));
+  SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, _offset, pool));
+  SVN_ERR(copy_file_data(context, context->reps_file, rev_file->file,
+ entry->size, pool));
 
   /* if the node has a data representation, make that the node's "base".
* This will (often) cause the noderev to be placed right in front of
@@ -803,11 +808,11 @@ compare_ref_to_item(const reference_t *
 
 /* Look for the least significant bit set in VALUE and return the smallest
  * number with the same property, i.e. the largest power of 2 that is a
- * factor in VALUE. */
+ * factor in VALUE.  Edge case: roundness(0) := 0 . */
 static int
 roundness(int value)
 {
-  return value ? value - (value & (value - 1)) : INT_MAX;
+  return value - (value & (value - 1));
 }
 
 /* For all paths in first COUNT entries 

svn commit: r1764214 [12/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_wc/wc_db_update_move.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/wc_db_update_move.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_wc/wc_db_update_move.c 
(original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/wc_db_update_move.c Tue Oct 
11 09:11:50 2016
@@ -1197,6 +1197,135 @@ tc_editor_alter_file(node_move_baton_t *
 }
 
 static svn_error_t *
+tc_editor_merge_local_file_change(node_move_baton_t *nmb,
+  const char *dst_relpath,
+  const char *src_relpath,
+  const svn_checksum_t *src_checksum,
+  const svn_checksum_t *dst_checksum,
+  apr_hash_t *dst_props,
+  apr_hash_t *src_props,
+  svn_boolean_t do_text_merge,
+  apr_pool_t *scratch_pool)
+{
+  update_move_baton_t *b = nmb->umb;
+  working_node_version_t old_version, new_version;
+  const char *dst_abspath = svn_dirent_join(b->wcroot->abspath,
+dst_relpath,
+scratch_pool);
+  svn_skel_t *conflict_skel = NULL;
+  apr_hash_t *actual_props;
+  apr_array_header_t *propchanges;
+  enum svn_wc_merge_outcome_t merge_outcome;
+  svn_wc_notify_state_t prop_state, content_state;
+  svn_skel_t *work_item, *work_items = NULL;
+  svn_node_kind_t dst_kind_on_disk;
+  svn_boolean_t obstructed = FALSE;
+
+  SVN_ERR(mark_node_edited(nmb, scratch_pool));
+  if (nmb->skip)
+return SVN_NO_ERROR;
+
+  SVN_ERR(svn_io_check_path(dst_abspath, _kind_on_disk, scratch_pool));
+  if (dst_kind_on_disk != svn_node_none && dst_kind_on_disk != svn_node_file)
+{
+  SVN_ERR(create_node_tree_conflict(_skel, nmb, dst_relpath,
+svn_node_file, svn_node_file,
+svn_wc_conflict_reason_obstructed,
+svn_wc_conflict_action_edit,
+NULL,
+scratch_pool, scratch_pool));
+  obstructed = TRUE;
+}
+
+  old_version.location_and_kind = b->old_version;
+  new_version.location_and_kind = b->new_version;
+
+  old_version.checksum = src_checksum;
+  old_version.props = src_props;
+  new_version.checksum = dst_checksum;
+  new_version.props = dst_props;
+
+  SVN_ERR(update_working_props(_state, _skel, ,
+   _props, b, dst_relpath,
+   _version, _version,
+   scratch_pool, scratch_pool));
+
+  if (!obstructed && do_text_merge)
+{
+  const char *old_pristine_abspath;
+  const char *src_abspath;
+
+  /*
+   * Run a 3-way merge to update the file at its post-move location, using
+   * the pre-move file's pristine text as the merge base, the post-move
+   * content as the merge-left version, and the current content of the
+   * working file at the pre-move location as the merge-right version.
+   */
+  SVN_ERR(svn_wc__db_pristine_get_path(_pristine_abspath,
+   b->db, b->wcroot->abspath,
+   src_checksum,
+   scratch_pool, scratch_pool));
+  src_abspath = svn_dirent_join(b->wcroot->abspath, src_relpath,
+scratch_pool);
+  SVN_ERR(svn_wc__internal_merge(_item, _skel,
+ _outcome, b->db,
+ old_pristine_abspath,
+ src_abspath,
+ dst_abspath,
+ dst_abspath,
+ NULL, NULL, NULL, /* diff labels */
+ actual_props,
+ FALSE, /* dry-run */
+ NULL, /* diff3-cmd */
+ NULL, /* merge options */
+ propchanges,
+ b->cancel_func, b->cancel_baton,
+ scratch_pool, scratch_pool));
+
+  work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+
+  if (merge_outcome == svn_wc_merge_conflict)
+content_state = svn_wc_notify_state_conflicted;
+  else
+content_state = svn_wc_notify_state_merged;
+}
+  else
+content_state = svn_wc_notify_state_unchanged;
+
+  /* If there are any conflicts to be stored, convert them into work items
+   * too. */
+  if (conflict_skel)
+{
+  

svn commit: r1764214 [21/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/tools/dev/svnmover/scanlog.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/scanlog.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/tools/dev/svnmover/scanlog.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/scanlog.c Tue Oct 11 09:11:50 
2016
@@ -119,7 +119,7 @@ svn_client__format_move_chain_for_displa
   return s;
 }
 
-struct scan_moves_log_receiver_baton {
+typedef struct scan_moves_log_receiver_baton {
   /*const char *anchor_abspath;*/
   svn_client_ctx_t *ctx;
   svn_revnum_t start;
@@ -162,7 +162,7 @@ struct scan_moves_log_receiver_baton {
   apr_hash_t *moves_by_target_path;
 } scan_moves_log_receiver_baton;
 
-struct copy_info {
+typedef struct copy_info {
   const char *copyto_path;
   const char *copyfrom_path;
   svn_revnum_t copyfrom_rev;

Modified: subversion/branches/ra-git/tools/dev/svnmover/svnmover.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/tools/dev/svnmover/svnmover.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/tools/dev/svnmover/svnmover.c (original)
+++ subversion/branches/ra-git/tools/dev/svnmover/svnmover.c Tue Oct 11 
09:11:50 2016
@@ -917,6 +917,7 @@ svn_branch__replay(svn_branch__txn_t *ed
   SVN_ERR(svn_branch__txn_open_branch(edit_txn, _subbranch,
   new_branch_id,
   
svn_branch__root_eid(right_subbranch),
+  NULL /*tree_ref*/,
   scratch_pool, scratch_pool));
 }
 
@@ -1095,6 +1096,7 @@ update_wc_base_r(svnmover_wc_t *wc,
   _subbranch,
   new_branch_id,
   
svn_branch__root_eid(work_subbranch),
+  NULL /*tree_ref*/,
   scratch_pool, scratch_pool));
   SVN_ERR(svn_branch__state_get_history(
 work_subbranch, , scratch_pool));
@@ -1743,7 +1745,7 @@ list_branches(svn_branch__txn_t *txn,
 
   SVN_ERR(list_branch(branch, with_elements, scratch_pool));
   if (with_elements) /* separate branches by a blank line */
-svnmover_notify("");
+svnmover_notify("%s", "");
 }
 
   for (i = 0; i < branches->nelts; i++)
@@ -1767,7 +1769,7 @@ list_branches(svn_branch__txn_t *txn,
 }
   SVN_ERR(list_branch(branch, with_elements, scratch_pool));
   if (with_elements) /* separate branches by a blank line */
-svnmover_notify("");
+svnmover_notify("%s", "");
 }
 
   return SVN_NO_ERROR;
@@ -1794,7 +1796,7 @@ list_all_branches(svn_branch__txn_t *txn
 
   SVN_ERR(list_branch(branch, with_elements, scratch_pool));
   if (with_elements) /* separate branches by a blank line */
-svnmover_notify("");
+svnmover_notify("%s", "");
 }
 
   return SVN_NO_ERROR;
@@ -2432,7 +2434,7 @@ do_put_file(svn_branch__txn_t *txn,
   SVN_ERR(svn_stream_open_readonly(, local_file_path,
scratch_pool, scratch_pool));
 else
-  SVN_ERR(svn_stream_for_stdin(, scratch_pool));
+  SVN_ERR(svn_stream_for_stdin2(, FALSE, scratch_pool));
 
 svn_stringbuf_from_stream(, src, 0, scratch_pool);
   }
@@ -2634,6 +2636,7 @@ do_mkbranch(const char **new_branch_id_p
   scratch_pool);
   SVN_ERR(svn_branch__txn_open_branch(txn, _branch,
   new_branch_id, new_inner_eid,
+  NULL /*tree_ref*/,
   scratch_pool, scratch_pool));
   SVN_ERR(svn_branch__state_alter_one(new_branch, new_inner_eid,
   -1, "", payload, scratch_pool));
@@ -2683,9 +2686,9 @@ do_branch(svn_branch__state_t **new_bran
 
   new_branch_id = svn_branch__id_nest(to_outer_branch_id, to_outer_eid,
   scratch_pool);
-  SVN_ERR(svn_branch__txn_branch(txn, _branch,
- from, new_branch_id,
- result_pool, scratch_pool));
+  SVN_ERR(svn_branch__txn_open_branch(txn, _branch,
+  new_branch_id, from->eid, from,
+  result_pool, scratch_pool));
   history = svn_branch__history_create_empty(scratch_pool);
   SVN_ERR(svn_branch__history_add_parent(history, from->rev, from->bid,
  scratch_pool));
@@ -2718,9 +2721,9 @@ do_topbranch(svn_branch__state_t **new_b
   

svn commit: r1764214 [2/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/contrib/client-side/svn_apply_autoprops.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/contrib/client-side/svn_apply_autoprops.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/contrib/client-side/svn_apply_autoprops.py 
(original)
+++ subversion/branches/ra-git/contrib/client-side/svn_apply_autoprops.py Tue 
Oct 11 09:11:50 2016
@@ -152,7 +152,7 @@ def filter_walk(autoprop_lines, dirname,
 def main():
   try:
 opts, args = getopt.getopt(sys.argv[1:], 'h', ['help', 'config='])
-  except getopt.GetoptError, e:
+  except getopt.GetoptError as e:
 usage()
 return 1
 

Modified: 
subversion/branches/ra-git/contrib/client-side/svn_export_empty_files.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/contrib/client-side/svn_export_empty_files.py?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/contrib/client-side/svn_export_empty_files.py 
(original)
+++ subversion/branches/ra-git/contrib/client-side/svn_export_empty_files.py 
Tue Oct 11 09:11:50 2016
@@ -71,7 +71,7 @@ def check_url_for_export(ctx, url, revis
 # is something wrong with the given URL.
 try:
 if ctx.verbose:
-print "Trying to list '%s'" % url
+print("Trying to list '%s'" % url)
 svn.client.ls(url, revision, 0, client_ctx)
 
 # Given a URL, the ls command does not tell you if
@@ -82,7 +82,7 @@ def check_url_for_export(ctx, url, revis
 try:
 last_slash_index = url.rindex('/')
 except ValueError:
-print "Cannot find a / in the URL '%s'" % url
+print("Cannot find a / in the URL '%s'" % url)
 return False
 
 parent_url = url[:last_slash_index]
@@ -90,31 +90,31 @@ def check_url_for_export(ctx, url, revis
 
 try:
 if ctx.verbose:
-print "Trying to list '%s'" % parent_url
+print("Trying to list '%s'" % parent_url)
 remote_ls = svn.client.ls(parent_url,
   revision,
   0,
   client_ctx)
 except svn.core.SubversionException:
 if ctx.verbose:
-print "Listing of '%s' failed, assuming URL is top of repos" \
-  % parent_url
+print("Listing of '%s' failed, assuming URL is top of repos" \
+  % parent_url)
 return True
 
 try:
 path_info = remote_ls[path_name]
 except ValueError:
-print "Able to ls '%s' but '%s' not in ls of '%s'" \
-  % (url, path_name, parent_url)
+print("Able to ls '%s' but '%s' not in ls of '%s'" \
+  % (url, path_name, parent_url))
 return False
 
 if svn.core.svn_node_dir != path_info.kind:
 if ctx.verbose:
-print "The URL '%s' is not a directory" % url
+print("The URL '%s' is not a directory" % url)
 return False
 else:
 if ctx.verbose:
-print "The URL '%s' is a directory" % url
+print("The URL '%s' is a directory" % url)
 return True
 finally:
 pass
@@ -154,16 +154,16 @@ def synchronize_dir(ctx, url, dir_name,
 msg = ("'%s' which is a local non-directory but remotely a " +
"directory") % dir_name
 if ctx.delete_local_paths:
-print "Removing", msg
+print("Removing", msg)
 os.unlink(dir_name)
 local_path_kind = LOCAL_PATH_NONE
 else:
-print "Need to remove", msg
+print("Need to remove", msg)
 ctx.delete_needed = True
 return False
 
 if LOCAL_PATH_NONE == local_path_kind:
-print "Creating directory '%s'" % dir_name
+print("Creating directory '%s'" % dir_name)
 os.mkdir(dir_name)
 
 remote_ls = svn.client.ls(url,
@@ -172,7 +172,7 @@ def synchronize_dir(ctx, url, dir_name,
   client_ctx)
 
 if ctx.verbose:
-print "Syncing '%s' to '%s'" % (url, dir_name)
+print("Syncing '%s' to '%s'" % (url, dir_name))
 
 remote_pathnames = remote_ls.keys()
 remote_pathnames.sort()
@@ -191,7 +191,7 @@ def synchronize_dir(ctx, url, dir_name,
 
 if remote_pathname in ctx.ignore_names or \
full_remote_pathname in ctx.ignore_paths:
-print "Skipping '%s'" % full_remote_pathname
+print("Skipping '%s'" % full_remote_pathname)
 continue
 
 # Get the remote path kind.
@@ -221,16 +221,16 @@ def synchronize_dir(ctx, url, dir_name,
 msg = ("'%s' which is a local directory but 

svn commit: r1764214 [20/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/tests/libsvn_subr/stream-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/tests/libsvn_subr/stream-test.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/tests/libsvn_subr/stream-test.c 
(original)
+++ subversion/branches/ra-git/subversion/tests/libsvn_subr/stream-test.c Tue 
Oct 11 09:11:50 2016
@@ -848,6 +848,158 @@ test_stream_compressed_read_full(apr_poo
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_stream_checksum(apr_pool_t *pool)
+{
+  svn_string_t *str =
+svn_string_create("The quick brown fox jumps over the lazy dog", pool);
+  svn_checksum_t *actual;
+
+  SVN_ERR(svn_stream_contents_checksum(,
+   svn_stream_from_string(str, pool),
+   svn_checksum_md5, pool, pool));
+  SVN_TEST_STRING_ASSERT("9e107d9d372bb6826bd81d3542a419d6",
+ svn_checksum_to_cstring(actual, pool));
+
+  SVN_ERR(svn_stream_contents_checksum(,
+   svn_stream_from_string(str, pool),
+   svn_checksum_sha1, pool, pool));
+  SVN_TEST_STRING_ASSERT("2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
+ svn_checksum_to_cstring(actual, pool));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_stream_readline_file(const char *testname,
+  const char *eol,
+  apr_pool_t *pool)
+{
+  const char *tmp_dir;
+  const char *tmp_file;
+  svn_stream_t *stream;
+  svn_stringbuf_t *line;
+  svn_boolean_t eof;
+  static const char long_line[] =
+"The quick brown fox jumps over the lazy dog, and "
+"jackdaws love my big sphinx of quartz, and "
+"pack my box with five dozen liquor jugs.";
+
+  SVN_ERR(svn_dirent_get_absolute(_dir, testname, pool));
+  SVN_ERR(svn_io_remove_dir2(tmp_dir, TRUE, NULL, NULL, pool));
+  SVN_ERR(svn_io_make_dir_recursively(tmp_dir, pool));
+  svn_test_add_dir_cleanup(tmp_dir);
+
+  /* Test 1: Read empty file. */
+  tmp_file = svn_dirent_join(tmp_dir, "empty", pool);
+  SVN_ERR(svn_io_file_create(tmp_file, "", pool));
+  SVN_ERR(svn_stream_open_readonly(, tmp_file, pool, pool));
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 0);
+  SVN_TEST_STRING_ASSERT(line->data, "");
+  SVN_TEST_ASSERT(eof);
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 0);
+  SVN_TEST_STRING_ASSERT(line->data, "");
+  SVN_TEST_ASSERT(eof);
+
+  SVN_ERR(svn_stream_close(stream));
+
+  /* Test 2: Read empty line. */
+  tmp_file = svn_dirent_join(tmp_dir, "empty-line", pool);
+  SVN_ERR(svn_io_file_create(tmp_file, eol, pool));
+  SVN_ERR(svn_stream_open_readonly(, tmp_file, pool, pool));
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 0);
+  SVN_TEST_STRING_ASSERT(line->data, "");
+  SVN_TEST_ASSERT(!eof);
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 0);
+  SVN_TEST_STRING_ASSERT(line->data, "");
+  SVN_TEST_ASSERT(eof);
+
+  SVN_ERR(svn_stream_close(stream));
+
+  /* Test 3: Read two lines. */
+  tmp_file = svn_dirent_join(tmp_dir, "lines", pool);
+  SVN_ERR(svn_io_file_create(tmp_file,
+ apr_pstrcat(pool,
+ "first", eol, "second", eol,
+ SVN_VA_NULL),
+ pool));
+  SVN_ERR(svn_stream_open_readonly(, tmp_file, pool, pool));
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 5);
+  SVN_TEST_STRING_ASSERT(line->data, "first");
+  SVN_TEST_ASSERT(!eof);
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 6);
+  SVN_TEST_STRING_ASSERT(line->data, "second");
+  SVN_TEST_ASSERT(!eof);
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 0);
+  SVN_TEST_STRING_ASSERT(line->data, "");
+  SVN_TEST_ASSERT(eof);
+
+  SVN_ERR(svn_stream_close(stream));
+
+  /* Test 4: Content without end-of-line. */
+  tmp_file = svn_dirent_join(tmp_dir, "no-eol", pool);
+  SVN_ERR(svn_io_file_create(tmp_file, "text", pool));
+  SVN_ERR(svn_stream_open_readonly(, tmp_file, pool, pool));
+
+  SVN_ERR(svn_stream_readline(stream, , eol, , pool));
+  SVN_TEST_ASSERT(line->len == 4);
+  SVN_TEST_STRING_ASSERT(line->data, "text");
+  SVN_TEST_ASSERT(eof);
+
+  SVN_ERR(svn_stream_close(stream));
+
+  /* Test 5: Read long line. */
+  tmp_file = svn_dirent_join(tmp_dir, "long-line", pool);
+  SVN_ERR(svn_io_file_create(tmp_file,
+ apr_pstrcat(pool, long_line, eol, SVN_VA_NULL),
+ pool));
+  SVN_ERR(svn_stream_open_readonly(, tmp_file, pool, pool));
+
+  

svn commit: r1764214 [3/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/include/private/svn_wc_private.h?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/include/private/svn_wc_private.h 
(original)
+++ subversion/branches/ra-git/subversion/include/private/svn_wc_private.h Tue 
Oct 11 09:11:50 2016
@@ -1748,6 +1748,195 @@ svn_wc__resolve_conflicts(svn_wc_context
   void *notify_baton,
   apr_pool_t *scratch_pool);
 
+/** 
+ * Resolve the text conflict at LOCAL_ABSPATH as per CHOICE, and then
+ * mark the conflict resolved.
+ * The working copy must already be locked for resolving, e.g. by calling
+ * svn_wc__acquire_write_lock_for_resolve() first.
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_wc__conflict_text_mark_resolved(svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+svn_wc_conflict_choice_t choice,
+svn_cancel_func_t cancel_func,
+void *cancel_baton,
+svn_wc_notify_func2_t notify_func,
+void *notify_baton,
+apr_pool_t *scratch_pool);
+
+/** 
+ * Resolve the conflicted property PROPNAME at LOCAL_ABSPATH as per CHOICE,
+ * and then mark the conflict resolved.  If MERGED_VALUE is not NULL, this is
+ * the new merged property, used when choosing #svn_wc_conflict_choose_merged.
+ *
+ * The working copy must already be locked for resolving, e.g. by calling
+ * svn_wc__acquire_write_lock_for_resolve() first.
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_wc__conflict_prop_mark_resolved(svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+const char *propname,
+svn_wc_conflict_choice_t choice,
+const svn_string_t *merged_value,
+svn_wc_notify_func2_t notify_func,
+void *notify_baton,
+apr_pool_t *scratch_pool);
+
+/* Resolve a tree conflict where the victim at LOCAL_ABSPATH is a directory
+ * which was locally deleted, replaced or moved away, and which received an
+ * arbitrary incoming change during an update or switch operation.
+ *
+ * The conflict is resolved by accepting the current working copy state and
+ * breaking the 'moved-here' link for any files or directories which were
+ * moved out of the victim directory before the update operation.
+ * As a result, any such files or directories become copies (rather than moves)
+ * of content which the victim directory contained before it was updated.
+ *
+ * The tree conflict at LOCAL_ABSPATH must have the following properties or
+ * SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
+ * 
+ * operation: svn_wc_operation_update or svn_wc_operation_switch
+ * local change: svn_wc_conflict_reason_deleted or
+ *   svn_wc_conflict_reason_replaced or
+ *   svn_wc_conflict_reason_moved_away
+ * incoming change: any
+ *
+ * The working copy must already be locked for resolving, e.g. by calling
+ * svn_wc__acquire_write_lock_for_resolve() first.
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_wc__conflict_tree_update_break_moved_away(svn_wc_context_t *wc_ctx,
+  const char *local_abspath,
+  svn_cancel_func_t cancel_func,
+  void *cancel_baton,
+  svn_wc_notify_func2_t 
notify_func,
+  void *notify_baton,
+  apr_pool_t *scratch_pool);
+
+
+/* Resolve a tree conflict where the victim at LOCAL_ABSPATH is a directory
+ * which was locally deleted or replaced, and which received an edit (some
+ * change inside the directory, or a change to the direcotory's properties)
+ * during an update or switch operation.
+ *
+ * The conflict is resolved by keeping the victim deleted, and propagating
+ * its tree conflict to any children which were moved out of the directory
+ * before the update operation.
+ * As a result, any such files or directories become victims of the tree
+ * conflict as well and must be resolved independently.
+ * Additionally, LOCAL_ABSPATH itself may become the victim of a different
+ * tree conflict as a result of resolving the existing tree conflict.
+ *
+ * The tree conflict at LOCAL_ABSPATH must have the following properties or
+ * SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
+ * 
+ * operation: 

svn commit: r1764214 [8/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_fs_x/revprops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_x/revprops.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_x/revprops.c Tue Oct 11 
09:11:50 2016
@@ -381,16 +381,9 @@ typedef struct packed_revprops_t
   /* sum of values in SIZES */
   apr_size_t total_size;
 
-  /* size of the revprops in PACKED_REVPROPS */
-  apr_array_header_t *sizes;
-
-  /* offset of the revprops in PACKED_REVPROPS */
-  apr_array_header_t *offsets;
-
-
-  /* concatenation of the serialized representation of all revprops
-   * in the pack, i.e. the pack content without header and compression */
-  svn_stringbuf_t *packed_revprops;
+  /* Array of svn_string_t, containing the serialized revprops for
+   * REVISION * I. */
+  apr_array_header_t *revprops;
 
   /* content of the manifest.
* Sorted list of manifest_entry_t. */
@@ -409,7 +402,7 @@ static svn_error_t *
 parse_revprop(apr_hash_t **properties,
   svn_fs_t *fs,
   svn_revnum_t revision,
-  svn_string_t *content,
+  const svn_string_t *content,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool)
 {
@@ -433,6 +426,35 @@ parse_revprop(apr_hash_t **properties,
   return SVN_NO_ERROR;
 }
 
+/* Verify the checksum attached to CONTENT and remove it.
+ * Use SCRATCH_POOL for temporary allocations.
+ */
+static svn_error_t *
+verify_checksum(svn_stringbuf_t *content,
+apr_pool_t *scratch_pool)
+{
+  const apr_byte_t *digest;
+  svn_checksum_t *actual, *expected;
+
+  /* Verify the checksum. */
+  if (content->len < sizeof(apr_uint32_t))
+return svn_error_create(SVN_ERR_CORRUPT_PACKED_DATA, NULL,
+"File too short");
+
+  content->len -= sizeof(apr_uint32_t);
+  digest = (apr_byte_t *)content->data + content->len;
+
+  expected = svn_checksum__from_digest_fnv1a_32x4(digest, scratch_pool);
+  SVN_ERR(svn_checksum(, svn_checksum_fnv1a_32x4, content->data,
+   content->len, scratch_pool));
+
+  if (!svn_checksum_match(actual, expected))
+SVN_ERR(svn_checksum_mismatch_err(expected, actual, scratch_pool, 
+  "checksum mismatch"));
+
+  return SVN_NO_ERROR;
+}
+
 /* Read the non-packed revprops for revision REV in FS, put them into the
  * revprop cache if activated and return them in *PROPERTIES.
  *
@@ -467,10 +489,17 @@ read_non_packed_revprop(apr_hash_t **pro
 
   if (content)
 {
+  svn_string_t *as_string;
+
+  /* Consistency check. */
+  SVN_ERR_W(verify_checksum(content, scratch_pool),
+apr_psprintf(scratch_pool,
+ "Revprop file for r%ld is corrupt",
+ rev));
+
   /* The contents string becomes part of the *PROPERTIES structure, i.e.
* we must make sure it lives at least as long as the latter. */
-  svn_string_t *as_string = svn_string_create_from_buf(content,
-   result_pool);
+  as_string = svn_string_create_from_buf(content, result_pool);
   SVN_ERR(parse_revprop(properties, fs, rev, as_string,
 result_pool, iterpool));
 }
@@ -480,6 +509,32 @@ read_non_packed_revprop(apr_hash_t **pro
   return SVN_NO_ERROR;
 }
 
+/* Serialize ROOT into FILE and append a checksum to it.
+ * Use SCRATCH_POOL for temporary allocations.
+ */
+static svn_error_t *
+write_packed_data_checksummed(svn_packed__data_root_t *root,
+  apr_file_t *file,
+  apr_pool_t *scratch_pool)
+{
+  svn_checksum_t *checksum;
+  svn_stream_t *stream;
+
+  stream = svn_stream_from_aprfile2(file, TRUE, scratch_pool);
+  stream = svn_checksum__wrap_write_stream(, stream,
+   svn_checksum_fnv1a_32x4,
+   scratch_pool);
+  SVN_ERR(svn_packed__data_write(stream, root, scratch_pool));
+  SVN_ERR(svn_stream_close(stream));
+
+  /* Append the checksum */
+  SVN_ERR(svn_io_file_write_full(file, checksum->digest,
+ svn_checksum_size(checksum), NULL,
+ scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Serialize the packed revprops MANIFEST into FILE.
  * Use SCRATCH_POOL for temporary allocations.
  */
@@ -489,8 +544,6 @@ write_manifest(apr_file_t *file,
apr_pool_t *scratch_pool)
 {
   int i;
-  svn_checksum_t *checksum;
-  svn_stream_t *stream;
   svn_packed__data_root_t *root = svn_packed__data_create_root(scratch_pool);
 
   /* one top-level stream per struct element */
@@ -508,17 +561,26 @@ write_manifest(apr_file_t *file,
 }
 
   /* Write to 

svn commit: r1764214 [10/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_repos/replay.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_repos/replay.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_repos/replay.c Tue Oct 11 
09:11:50 2016
@@ -198,7 +198,7 @@ add_subdir(svn_fs_root_t *source_root,
 
   for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
 {
-  svn_fs_path_change2_t *change;
+  svn_fs_path_change3_t *change;
   svn_boolean_t readable = TRUE;
   svn_fs_dirent_t *dent = apr_hash_this_val(hi);
   const char *copyfrom_path = NULL;
@@ -412,7 +412,7 @@ fill_copyfrom(svn_fs_root_t **copyfrom_r
   svn_revnum_t *copyfrom_rev,
   svn_boolean_t *src_readable,
   svn_fs_root_t *root,
-  svn_fs_path_change2_t *change,
+  svn_fs_path_change3_t *change,
   svn_repos_authz_func_t authz_read_func,
   void *authz_read_baton,
   const char *path,
@@ -463,7 +463,7 @@ path_driver_cb_func(void **dir_baton,
   const svn_delta_editor_t *editor = cb->editor;
   void *edit_baton = cb->edit_baton;
   svn_fs_root_t *root = cb->root;
-  svn_fs_path_change2_t *change;
+  svn_fs_path_change3_t *change;
   svn_boolean_t do_add = FALSE, do_delete = FALSE;
   void *file_baton = NULL;
   svn_revnum_t copyfrom_rev;
@@ -843,6 +843,80 @@ fetch_props_func(apr_hash_t **props,
 
 
 
+/* Retrieve the path changes under ROOT, filter them with AUTHZ_READ_FUNC
+   and AUTHZ_READ_BATON and return those that intersect with BASE_RELPATH.
+
+   The svn_fs_path_change3_t* will be returned in *CHANGED_PATHS, keyed by
+   their path.  The paths themselves are additionally returned in *PATHS.
+
+   Allocate the returned data in RESULT_POOL and use SCRATCH_POOL for
+   temporary allocations.
+ */
+static svn_error_t *
+get_relevant_changes(apr_hash_t **changed_paths,
+ apr_array_header_t **paths,
+ svn_fs_root_t *root,
+ const char *base_relpath,
+ svn_repos_authz_func_t authz_read_func,
+ void *authz_read_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+  svn_fs_path_change_iterator_t *iterator;
+  svn_fs_path_change3_t *change;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+  /* Fetch the paths changed under ROOT. */
+  SVN_ERR(svn_fs_paths_changed3(, root, scratch_pool, scratch_pool));
+  SVN_ERR(svn_fs_path_change_get(, iterator));
+
+  /* Make an array from the keys of our CHANGED_PATHS hash, and copy
+ the values into a new hash whose keys have no leading slashes. */
+  *paths = apr_array_make(result_pool, 16, sizeof(const char *));
+  *changed_paths = apr_hash_make(result_pool);
+  while (change)
+{
+  const char *path = change->path.data;
+  apr_ssize_t keylen = change->path.len;
+  svn_boolean_t allowed = TRUE;
+
+  svn_pool_clear(iterpool);
+  if (authz_read_func)
+SVN_ERR(authz_read_func(, root, path, authz_read_baton,
+iterpool));
+
+  if (allowed)
+{
+  if (path[0] == '/')
+{
+  path++;
+  keylen--;
+}
+
+  /* If the base_path doesn't match the top directory of this path
+ we don't want anything to do with it... 
+ ...unless this was a change to one of the parent directories of
+ base_path. */
+  if (   svn_relpath_skip_ancestor(base_relpath, path)
+  || svn_relpath_skip_ancestor(path, base_relpath))
+{
+  change = svn_fs_path_change3_dup(change, result_pool);
+  path = change->path.data;
+  if (path[0] == '/')
+path++;
+
+  APR_ARRAY_PUSH(*paths, const char *) = path;
+  apr_hash_set(*changed_paths, path, keylen, change);
+}
+}
+
+  SVN_ERR(svn_fs_path_change_get(, iterator));
+}
+
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_repos_replay2(svn_fs_root_t *root,
   const char *base_path,
@@ -855,9 +929,7 @@ svn_repos_replay2(svn_fs_root_t *root,
   apr_pool_t *pool)
 {
 #ifndef USE_EV2_IMPL
-  apr_hash_t *fs_changes;
   apr_hash_t *changed_paths;
-  apr_hash_index_t *hi;
   apr_array_header_t *paths;
   struct path_driver_cb_baton cb_baton;
 
@@ -869,54 +941,15 @@ svn_repos_replay2(svn_fs_root_t *root,
   return SVN_NO_ERROR;
 }
 
-  /* Fetch the paths changed under ROOT. */
-  SVN_ERR(svn_fs_paths_changed2(_changes, root, pool));
-
   if (! base_path)
 base_path = "";
   else if (base_path[0] == '/')
 ++base_path;
 
-  /* Make an array 

svn commit: r1764214 [15/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/svn/info-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svn/info-cmd.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/svn/info-cmd.c (original)
+++ subversion/branches/ra-git/subversion/svn/info-cmd.c Tue Oct 11 09:11:50 
2016
@@ -162,6 +162,9 @@ typedef struct print_info_baton_t
 
   /* Did we already print a line of output? */
   svn_boolean_t start_new_line;
+
+  /* The client context. */
+  svn_client_ctx_t *ctx;
 } print_info_baton_t;
 
 
@@ -403,9 +406,9 @@ print_info_xml(void *baton,
 
   svn_pool_clear(iterpool);
 
-  SVN_ERR(svn_client_conflict_from_wc_description2_t(, desc,
- iterpool,
- iterpool));
+  SVN_ERR(svn_client_conflict_get(, desc->local_abspath,
+  receiver_baton->ctx,
+  iterpool, iterpool));
   SVN_ERR(svn_cl__append_conflict_info_xml(sb, conflict, iterpool));
 }
   svn_pool_destroy(iterpool);
@@ -592,87 +595,86 @@ print_info(void *baton,
 {
   svn_boolean_t printed_tc = FALSE;
   svn_stringbuf_t *conflicted_props = NULL;
-  int i;
-  apr_pool_t *iterpool;
-
-  iterpool = svn_pool_create(pool);
-  for (i = 0; i < info->wc_info->conflicts->nelts; i++)
+  svn_client_conflict_t *conflict;
+  svn_boolean_t text_conflicted;
+  apr_array_header_t *props_conflicted;
+  svn_boolean_t tree_conflicted;
+  const svn_wc_conflict_description2_t *desc2 =
+APR_ARRAY_IDX(info->wc_info->conflicts, 0,
+  const svn_wc_conflict_description2_t *);
+
+  SVN_ERR(svn_client_conflict_get(, desc2->local_abspath,
+  receiver_baton->ctx, pool, pool));
+  SVN_ERR(svn_client_conflict_get_conflicted(_conflicted,
+ _conflicted,
+ _conflicted,
+ conflict, pool, pool));
+  if (text_conflicted)
 {
-  const svn_wc_conflict_description2_t *desc2 =
-APR_ARRAY_IDX(info->wc_info->conflicts, i,
-  const svn_wc_conflict_description2_t *);
-  const char *desc;
   const char *base_abspath = NULL;
   const char *my_abspath = NULL;
   const char *their_abspath = NULL;
-  svn_client_conflict_t *conflict;
 
-  svn_pool_clear(iterpool);
+  SVN_ERR(svn_client_conflict_text_get_contents(
+NULL, _abspath, _abspath, _abspath,
+conflict, pool, pool));
+
+  if (base_abspath)
+SVN_ERR(svn_cmdline_printf(pool,
+  _("Conflict Previous Base File: %s\n"),
+  svn_cl__local_style_skip_ancestor(
+  receiver_baton->path_prefix,
+  base_abspath,
+  pool)));
+
+  if (my_abspath)
+SVN_ERR(svn_cmdline_printf(pool,
+  _("Conflict Previous Working File: %s\n"),
+  svn_cl__local_style_skip_ancestor(
+  receiver_baton->path_prefix,
+  my_abspath,
+  pool)));
+
+  if (their_abspath)
+SVN_ERR(svn_cmdline_printf(pool,
+  _("Conflict Current Base File: %s\n"),
+  svn_cl__local_style_skip_ancestor(
+  receiver_baton->path_prefix,
+  their_abspath,
+  pool)));
+}
 
-  SVN_ERR(svn_client_conflict_from_wc_description2_t(,
- desc2,
- iterpool,
- iterpool));
-  switch (svn_client_conflict_get_kind(conflict))
-{
-  case svn_wc_conflict_kind_text:
+  if (props_conflicted)
+{
+  int i;
 
-SVN_ERR(svn_client_conflict_text_get_contents(
-  NULL, _abspath, _abspath, _abspath,
-  conflict, pool, pool));
-
-if (base_abspath)
-  SVN_ERR(svn_cmdline_printf(pool,
- 

svn commit: r1764214 [11/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_subr/utf_validate.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/utf_validate.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_subr/utf_validate.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/utf_validate.c Tue Oct 11 
09:11:50 2016
@@ -258,24 +258,7 @@ static const char machine [9][14] = {
 static const char *
 first_non_fsm_start_char(const char *data, apr_size_t max_len)
 {
-#if !SVN_UNALIGNED_ACCESS_IS_OK
-
-  /* On some systems, we need to make sure that buf is properly aligned
-   * for chunky data access.
-   */
-  if ((apr_uintptr_t)data & (sizeof(apr_uintptr_t)-1))
-{
-  apr_size_t len = (~(apr_uintptr_t)data) & (sizeof(apr_uintptr_t)-1);
-  if (len > max_len)
-len = max_len;
-  max_len -= len;
-
-  for (; len > 0; ++data, --len)
-if ((unsigned char)*data >= 0x80)
-  return data;
-}
-
-#endif
+#if SVN_UNALIGNED_ACCESS_IS_OK
 
   /* Scan the input one machine word at a time. */
   for (; max_len > sizeof(apr_uintptr_t)
@@ -283,55 +266,11 @@ first_non_fsm_start_char(const char *dat
 if (*(const apr_uintptr_t *)data & SVN__BIT_7_SET)
   break;
 
-  /* The remaining odd bytes will be examined the naive way: */
-  for (; max_len > 0; ++data, --max_len)
-if ((unsigned char)*data >= 0x80)
-  break;
-
-  return data;
-}
-
-/* Scan the C string in *DATA for chars that are not in the octet
- * category 0 (FSM_START).  Return the position of either the such
- * char or of the terminating NUL.
- */
-static const char *
-first_non_fsm_start_char_cstring(const char *data)
-{
-  /* We need to make sure that BUF is properly aligned for chunky data
-   * access because we don't know the string's length. Unaligned chunk
-   * read access beyond the NUL terminator could therefore result in a
-   * segfault.
-   */
-  for (; (apr_uintptr_t)data & (sizeof(apr_uintptr_t)-1); ++data)
-if (*data == 0 || (unsigned char)*data >= 0x80)
-  return data;
-
-  /* Scan the input one machine word at a time. */
-#ifndef SVN_UTF_NO_UNINITIALISED_ACCESS
-  /* This may read allocated but uninitialised bytes beyond the
- terminating null.  Any such bytes are always readable and this
- code operates correctly whatever the uninitialised values happen
- to be.  However memory checking tools such as valgrind and GCC
- 4.8's address santitizer will object so this bit of code can be
- disabled at compile time. */
-  for (; ; data += sizeof(apr_uintptr_t))
-{
-  /* Check for non-ASCII chars: */
-  apr_uintptr_t chunk = *(const apr_uintptr_t *)data;
-  if (chunk & SVN__BIT_7_SET)
-break;
-
-  /* This is the well-known strlen test: */
-  chunk |= (chunk & SVN__LOWER_7BITS_SET) + SVN__LOWER_7BITS_SET;
-  if ((chunk & SVN__BIT_7_SET) != SVN__BIT_7_SET)
-break;
-}
 #endif
 
   /* The remaining odd bytes will be examined the naive way: */
-  for (; ; ++data)
-if (*data == 0 || (unsigned char)*data >= 0x80)
+  for (; max_len > 0; ++data, --max_len)
+if ((unsigned char)*data >= 0x80)
   break;
 
   return data;
@@ -359,20 +298,10 @@ svn_utf__last_valid(const char *data, ap
 svn_boolean_t
 svn_utf__cstring_is_valid(const char *data)
 {
-  int state = FSM_START;
-
   if (!data)
 return FALSE;
 
-  data = first_non_fsm_start_char_cstring(data);
-
-  while (*data)
-{
-  unsigned char octet = *data++;
-  int category = octet_category[octet];
-  state = machine[state][category];
-}
-  return state == FSM_START;
+  return svn_utf__is_valid(data, strlen(data));
 }
 
 svn_boolean_t

Modified: subversion/branches/ra-git/subversion/libsvn_subr/version.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/version.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/version.c Tue Oct 11 
09:11:50 2016
@@ -143,7 +143,7 @@ svn_version_extended(svn_boolean_t verbo
   info->build_time = __TIME__;
   info->build_host = SVN_BUILD_HOST;
   info->copyright = apr_pstrdup
-(pool, _("Copyright (C) 2015 The Apache Software Foundation.\n"
+(pool, _("Copyright (C) 2016 The Apache Software Foundation.\n"
  "This software consists of contributions made by many people;\n"
  "see the NOTICE file for more information.\n"
  "Subversion is open source software, see "

Modified: subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c?rev=1764214=1764213=1764214=diff

svn commit: r1764214 [7/21] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/win32/ contrib/client-side/ contrib/client-side/svnmerge/ contrib/hook-scripts/ contrib/

2016-10-11 Thread rhuijben
Modified: subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.c?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.c Tue Oct 11 
09:11:50 2016
@@ -203,6 +203,9 @@ struct svn_fs_x__batch_fsync_t
 
   /* Counts the number of completed fsync tasks. */
   waitable_counter_t *counter;
+
+  /* Perform fsyncs only if this flag has been set. */
+  svn_boolean_t flush_to_disk;
 };
 
 /* Data structures for concurrent fsync execution are only available if
@@ -299,10 +302,12 @@ fsync_batch_cleanup(void *data)
 
 svn_error_t *
 svn_fs_x__batch_fsync_create(svn_fs_x__batch_fsync_t **result_p,
+ svn_boolean_t flush_to_disk,
  apr_pool_t *result_pool)
 {
   svn_fs_x__batch_fsync_t *result = apr_pcalloc(result_pool, sizeof(*result));
   result->files = svn_hash__make(result_pool);
+  result->flush_to_disk = flush_to_disk;
 
   SVN_ERR(waitable_counter__create(>counter, result_pool));
   apr_pool_cleanup_register(result_pool, result, fsync_batch_cleanup,
@@ -493,33 +498,38 @@ svn_fs_x__batch_fsync_run(svn_fs_x__batc
waitable_counter__reset(batch->counter));
 
   /* Start the actual fsyncing process. */
-  for (hi = apr_hash_first(scratch_pool, batch->files);
-   hi;
-   hi = apr_hash_next(hi))
+  if (batch->flush_to_disk)
 {
-  to_sync_t *to_sync = apr_hash_this_val(hi);
+  for (hi = apr_hash_first(scratch_pool, batch->files);
+   hi;
+   hi = apr_hash_next(hi))
+{
+  to_sync_t *to_sync = apr_hash_this_val(hi);
 
 #if APR_HAS_THREADS
 
-  /* If there are multiple fsyncs to perform, run them in parallel.
-   * Otherwise, skip the thread-pool and synchronization overhead. */
-  if (apr_hash_count(batch->files) > 1)
-{
-  apr_status_t status = APR_SUCCESS;
-  status = apr_thread_pool_push(thread_pool, flush_task, to_sync,
-0, NULL);
-  if (status)
-to_sync->result = svn_error_wrap_apr(status, _("Can't push task"));
+  /* If there are multiple fsyncs to perform, run them in parallel.
+   * Otherwise, skip the thread-pool and synchronization overhead. */
+  if (apr_hash_count(batch->files) > 1)
+{
+  apr_status_t status = APR_SUCCESS;
+  status = apr_thread_pool_push(thread_pool, flush_task, to_sync,
+0, NULL);
+  if (status)
+to_sync->result = svn_error_wrap_apr(status,
+ _("Can't push task"));
+  else
+tasks++;
+}
   else
-tasks++;
-}
-  else
 
 #endif
 
-{
-  to_sync->result = svn_error_trace(svn_io_file_flush_to_disk
-  (to_sync->file, to_sync->pool));
+{
+  to_sync->result = svn_error_trace(svn_io_file_flush_to_disk
+  (to_sync->file,
+   to_sync->pool));
+}
 }
 }
 
@@ -534,7 +544,9 @@ svn_fs_x__batch_fsync_run(svn_fs_x__batc
hi = apr_hash_next(hi))
 {
   to_sync_t *to_sync = apr_hash_this_val(hi);
-  chain = svn_error_compose_create(chain, to_sync->result);
+  if (batch->flush_to_disk)
+chain = svn_error_compose_create(chain, to_sync->result);
+
   chain = svn_error_compose_create(chain,
svn_io_file_close(to_sync->file,
  scratch_pool));

Modified: subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.h?rev=1764214=1764213=1764214=diff
==
--- subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_fs_x/batch_fsync.h Tue Oct 11 
09:11:50 2016
@@ -52,9 +52,12 @@ typedef struct svn_fs_x__batch_fsync_t s
 svn_error_t *
 svn_fs_x__batch_fsync_init(void);
 
-/* Set *RESULT_P to a new batch fsync structure, allocated in RESULT_POOL. */
+/* Set *RESULT_P to a new batch fsync structure, allocated in RESULT_POOL.
+ * If FLUSH_TO_DISK is not set, the resulting struct will not actually use
+ * fsync. */
 svn_error_t *
 svn_fs_x__batch_fsync_create(svn_fs_x__batch_fsync_t **result_p,
+ svn_boolean_t flush_to_disk,