subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1662916 [2/15] - in /subversion/branches/1.9.x: ./ build/ build/generator/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subve...
Date Sat, 28 Feb 2015 10:37:30 GMT
Modified: subversion/branches/1.9.x/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_client/commit.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_client/commit.c Sat Feb 28 10:37:27 2015
@@ -240,7 +240,9 @@ post_process_commit_item(svn_wc_committe
     loop_recurse = TRUE;
 
   remove_lock = (! keep_locks && (item->state_flags
-                                       & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN));
+                                       & (SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN
+                                          | SVN_CLIENT_COMMIT_ITEM_ADD
+                                          | SVN_CLIENT_COMMIT_ITEM_DELETE)));
 
   /* When the node was deleted (or replaced), we need to always remove the
      locks, as they're invalidated on the server. We cannot honor the
@@ -537,6 +539,7 @@ svn_client_commit6(const apr_array_heade
   const char *current_abspath;
   const char *notify_prefix;
   int depth_empty_after = -1;
+  apr_hash_t *move_youngest = NULL;
   int i;
 
   SVN_ERR_ASSERT(depth != svn_depth_unknown && depth != svn_depth_exclude);
@@ -707,62 +710,12 @@ svn_client_commit6(const apr_array_heade
           if (cmt_err)
             goto cleanup;
 
-          if (moved_from_abspath && delete_op_root_abspath &&
-              strcmp(moved_from_abspath, delete_op_root_abspath) == 0)
-
+          if (moved_from_abspath && delete_op_root_abspath)
             {
-              svn_boolean_t found_delete_half =
-                (svn_hash_gets(committables->by_path, delete_op_root_abspath)
-                 != NULL);
+              svn_client_commit_item3_t *delete_half =
+                svn_hash_gets(committables->by_path, delete_op_root_abspath);
 
-              if (!found_delete_half)
-                {
-                  const char *delete_half_parent_abspath;
-
-                  /* The delete-half isn't in the commit target list.
-                   * However, it might itself be the child of a deleted node,
-                   * either because of another move or a deletion.
-                   *
-                   * For example, consider: mv A/B B; mv B/C C; commit;
-                   * C's moved-from A/B/C is a child of the deleted A/B.
-                   * A/B/C does not appear in the commit target list, but
-                   * A/B does appear.
-                   * (Note that moved-from information is always stored
-                   * relative to the BASE tree, so we have 'C moved-from
-                   * A/B/C', not 'C moved-from B/C'.)
-                   *
-                   * An example involving a move and a delete would be:
-                   * mv A/B C; rm A; commit;
-                   * Now C is moved-from A/B which does not appear in the
-                   * commit target list, but A does appear.
-                   */
-
-                  /* Scan upwards for a deletion op-root from the
-                   * delete-half's parent directory. */
-                  delete_half_parent_abspath =
-                    svn_dirent_dirname(delete_op_root_abspath, iterpool);
-                  if (strcmp(delete_op_root_abspath,
-                             delete_half_parent_abspath) != 0)
-                    {
-                      const char *parent_delete_op_root_abspath;
-
-                      cmt_err = svn_error_trace(
-                                  svn_wc__node_get_deleted_ancestor(
-                                    &parent_delete_op_root_abspath,
-                                    ctx->wc_ctx, delete_half_parent_abspath,
-                                    iterpool, iterpool));
-                      if (cmt_err)
-                        goto cleanup;
-
-                      if (parent_delete_op_root_abspath)
-                        found_delete_half =
-                          (svn_hash_gets(committables->by_path,
-                                         parent_delete_op_root_abspath)
-                           != NULL);
-                    }
-                }
-
-              if (!found_delete_half)
+              if (!delete_half)
                 {
                   cmt_err = svn_error_createf(
                               SVN_ERR_ILLEGAL_TARGET, NULL,
@@ -787,6 +740,17 @@ svn_client_commit6(const apr_array_heade
 
                   goto cleanup;
                 }
+              else if (delete_half->revision == item->copyfrom_rev)
+                {
+                  /* Ok, now we know that we perform an out-of-date check
+                     on the copyfrom location. Remember this for a fixup
+                     round right before committing. */
+
+                  if (!move_youngest)
+                    move_youngest = apr_hash_make(pool);
+
+                  svn_hash_sets(move_youngest, item->path, item);
+                }
             }
         }
 
@@ -885,6 +849,37 @@ svn_client_commit6(const apr_array_heade
   if (cmt_err)
     goto cleanup;
 
+  if (move_youngest != NULL)
+    {
+      apr_hash_index_t *hi;
+      svn_revnum_t youngest;
+
+      SVN_ERR(svn_ra_get_latest_revnum(ra_session, &youngest, pool));
+
+      for (hi = apr_hash_first(iterpool, move_youngest);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          svn_client_commit_item3_t *item = apr_hash_this_val(hi);
+
+          /* We delete the original side with its original revision and will
+             receive an out-of-date error if that node changed since that
+             revision.
+
+             The copy is of that same revision and we know that this revision
+             didn't change between this revision and youngest. So we can just
+             as well commit a copy from youngest.
+
+            Note that it is still possible to see gaps between the delete and
+            copy revisions as the repository might handle multiple commits
+            at the same time (or when an out of date proxy is involved), but
+            in general it should decrease the number of gaps. */
+
+          if (item->copyfrom_rev < youngest)
+            item->copyfrom_rev = youngest;
+        }
+    }
+
   cmt_err = svn_error_trace(
               get_ra_editor(&editor, &edit_baton, ra_session, ctx,
                             log_msg, commit_items, revprop_table,

Modified: subversion/branches/1.9.x/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_client/commit_util.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_client/commit_util.c Sat Feb 28 10:37:27 2015
@@ -467,10 +467,12 @@ harvest_not_present_for_copy(svn_wc_cont
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   int i;
 
+  SVN_ERR_ASSERT(commit_relpath != NULL);
+
   /* A function to retrieve not present children would be nice to have */
-  SVN_ERR(svn_wc__node_get_children_of_working_node(
-                                    &children, wc_ctx, local_abspath, TRUE,
-                                    scratch_pool, iterpool));
+  SVN_ERR(svn_wc__node_get_not_present_children(&children, wc_ctx,
+                                                local_abspath,
+                                                scratch_pool, iterpool));
 
   for (i = 0; i < children->nelts; i++)
     {
@@ -486,13 +488,10 @@ harvest_not_present_for_copy(svn_wc_cont
                                           this_abspath, FALSE, scratch_pool));
 
       if (!not_present)
-        continue;
+        continue; /* Node is replaced */
 
-      if (commit_relpath == NULL)
-        this_commit_relpath = NULL;
-      else
-        this_commit_relpath = svn_relpath_join(commit_relpath, name,
-                                              iterpool);
+      this_commit_relpath = svn_relpath_join(commit_relpath, name,
+                                             iterpool);
 
       /* We should check if we should really add a delete operation */
       if (check_url_func)
@@ -1380,7 +1379,10 @@ svn_client__get_copy_committables(svn_cl
 }
 
 
-int svn_client__sort_commit_item_urls(const void *a, const void *b)
+/* A svn_sort__array()/qsort()-compatible sort routine for sorting
+   an array of svn_client_commit_item_t *'s by their URL member. */
+static int
+sort_commit_item_urls(const void *a, const void *b)
 {
   const svn_client_commit_item3_t *item1
     = *((const svn_client_commit_item3_t * const *) a);
@@ -1404,7 +1406,7 @@ svn_client__condense_commit_items(const
   SVN_ERR_ASSERT(ci && ci->nelts);
 
   /* Sort our commit items by their URLs. */
-  svn_sort__array(ci, svn_client__sort_commit_item_urls);
+  svn_sort__array(ci, sort_commit_item_urls);
 
   /* Loop through the URLs, finding the longest usable ancestor common
      to all of them, and making sure there are no duplicate URLs.  */

Modified: subversion/branches/1.9.x/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_client/copy.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_client/copy.c Sat Feb 28 10:37:27 2015
@@ -477,7 +477,7 @@ pin_externals_prop(svn_string_t **pinned
                                              SVN_PROP_EXTERNALS);
 
                   SVN_ERR(svn_wc__has_local_mods(&is_modified, ctx->wc_ctx,
-                                                 external_abspath,
+                                                 external_abspath, TRUE,
                                                  ctx->cancel_func,
                                                  ctx->cancel_baton,
                                                  iterpool));
@@ -655,6 +655,7 @@ static svn_error_t *
 do_wc_to_wc_copies_with_write_lock(svn_boolean_t *timestamp_sleep,
                                    const apr_array_header_t *copy_pairs,
                                    const char *dst_parent,
+                                   svn_boolean_t metadata_only,
                                    svn_boolean_t pin_externals,
                                    const apr_hash_t *externals_to_pin,
                                    svn_client_ctx_t *ctx,
@@ -696,7 +697,7 @@ do_wc_to_wc_copies_with_write_lock(svn_b
                                     iterpool);
       *timestamp_sleep = TRUE;
       err = svn_wc_copy3(ctx->wc_ctx, pair->src_abspath_or_url, dst_abspath,
-                         FALSE /* metadata_only */,
+                         metadata_only,
                          ctx->cancel_func, ctx->cancel_baton,
                          ctx->notify_func2, ctx->notify_baton2, iterpool);
       if (err)
@@ -738,6 +739,7 @@ do_wc_to_wc_copies_with_write_lock(svn_b
 static svn_error_t *
 do_wc_to_wc_copies(svn_boolean_t *timestamp_sleep,
                    const apr_array_header_t *copy_pairs,
+                   svn_boolean_t metadata_only,
                    svn_boolean_t pin_externals,
                    const apr_hash_t *externals_to_pin,
                    svn_client_ctx_t *ctx,
@@ -753,8 +755,8 @@ do_wc_to_wc_copies(svn_boolean_t *timest
 
   SVN_WC__CALL_WITH_WRITE_LOCK(
     do_wc_to_wc_copies_with_write_lock(timestamp_sleep, copy_pairs, dst_parent,
-                                       pin_externals, externals_to_pin,
-                                       ctx, pool),
+                                       metadata_only, pin_externals,
+                                       externals_to_pin, ctx, pool),
     ctx->wc_ctx, dst_parent_abspath, FALSE, pool);
 
   return SVN_NO_ERROR;
@@ -3053,9 +3055,10 @@ try_copy(svn_boolean_t *timestamp_sleep,
       else
         {
           /* We ignore these values, so assert the default value */
-          SVN_ERR_ASSERT(allow_mixed_revisions && !metadata_only);
+          SVN_ERR_ASSERT(allow_mixed_revisions);
           return svn_error_trace(do_wc_to_wc_copies(timestamp_sleep,
                                                     copy_pairs,
+                                                    metadata_only,
                                                     pin_externals,
                                                     externals_to_pin,
                                                     ctx, pool));
@@ -3093,6 +3096,7 @@ svn_client_copy7(const apr_array_header_
                  svn_boolean_t copy_as_child,
                  svn_boolean_t make_parents,
                  svn_boolean_t ignore_externals,
+                 svn_boolean_t metadata_only,
                  svn_boolean_t pin_externals,
                  const apr_hash_t *externals_to_pin,
                  const apr_hash_t *revprop_table,
@@ -3113,7 +3117,7 @@ svn_client_copy7(const apr_array_header_
                  sources, dst_path,
                  FALSE /* is_move */,
                  TRUE /* allow_mixed_revisions */,
-                 FALSE /* metadata_only */,
+                 metadata_only,
                  make_parents,
                  ignore_externals,
                  pin_externals,
@@ -3149,7 +3153,7 @@ svn_client_copy7(const apr_array_header_
                      sources, dst_path,
                      FALSE /* is_move */,
                      TRUE /* allow_mixed_revisions */,
-                     FALSE /* metadata_only */,
+                     metadata_only,
                      make_parents,
                      ignore_externals,
                      pin_externals,

Modified: subversion/branches/1.9.x/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_client/deprecated.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_client/deprecated.c Sat Feb 28 10:37:27 2015
@@ -640,7 +640,10 @@ svn_client_copy6(const apr_array_header_
 {
   return svn_error_trace(svn_client_copy7(sources, dst_path, copy_as_child,
                                           make_parents, ignore_externals,
-                                          FALSE, NULL, revprop_table,
+                                          FALSE /* metadata_only */,
+                                          FALSE /* pin_externals */,
+                                          NULL /* externals_to_pin */,
+                                          revprop_table,
                                           commit_callback, commit_baton,
                                           ctx, pool));
 }

Modified: subversion/branches/1.9.x/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_client/merge.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_client/merge.c Sat Feb 28 10:37:27 2015
@@ -6131,8 +6131,9 @@ insert_parent_and_sibs_of_sw_absent_del_
     } /*(parent == NULL) */
 
   /* Add all of PARENT's non-missing children that are not already present.*/
-  SVN_ERR(svn_wc__node_get_children(&children, ctx->wc_ctx,
-                                    parent_abspath, FALSE, pool, pool));
+  SVN_ERR(svn_wc__node_get_children_of_working_node(&children, ctx->wc_ctx,
+                                                    parent_abspath,
+                                                    pool, pool));
   iterpool = svn_pool_create(pool);
   for (i = 0; i < children->nelts; i++)
     {
@@ -6614,7 +6615,7 @@ get_mergeinfo_paths(apr_array_header_t *
 
       SVN_ERR(svn_wc__node_get_children_of_working_node(
         &immediate_children, ctx->wc_ctx,
-        target->abspath, FALSE, scratch_pool, scratch_pool));
+        target->abspath, scratch_pool, scratch_pool));
 
       for (j = 0; j < immediate_children->nelts; j++)
         {
@@ -6698,9 +6699,10 @@ get_mergeinfo_paths(apr_array_header_t *
           const apr_array_header_t *children;
           int j;
 
-          SVN_ERR(svn_wc__node_get_children(&children,
+          SVN_ERR(svn_wc__node_get_children_of_working_node(
+                                            &children,
                                             ctx->wc_ctx,
-                                            child->abspath, FALSE,
+                                            child->abspath,
                                             iterpool, iterpool));
           for (j = 0; j < children->nelts; j++)
             {
@@ -10269,7 +10271,7 @@ ensure_wc_is_suitable_merge_target(const
       svn_boolean_t is_modified;
 
       SVN_ERR(svn_wc__has_local_mods(&is_modified, ctx->wc_ctx,
-                                     target_abspath,
+                                     target_abspath, TRUE,
                                      ctx->cancel_func,
                                      ctx->cancel_baton,
                                      scratch_pool));

Modified: subversion/branches/1.9.x/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_client/patch.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_client/patch.c Sat Feb 28 10:37:27 2015
@@ -326,7 +326,8 @@ obtain_eol_and_keywords_for_file(apr_has
       const char *rev_str;
       const char *author;
       const char *url;
-      const char *root_url;
+      const char *repos_root_url;
+      const char *repos_relpath;
 
       SVN_ERR(svn_wc__node_get_changed_info(&changed_rev,
                                             &changed_date,
@@ -335,15 +336,17 @@ obtain_eol_and_keywords_for_file(apr_has
                                             scratch_pool,
                                             scratch_pool));
       rev_str = apr_psprintf(scratch_pool, "%ld", changed_rev);
-      SVN_ERR(svn_wc__node_get_url(&url, wc_ctx,
-                                   local_abspath,
-                                   scratch_pool, scratch_pool));
-      SVN_ERR(svn_wc__node_get_repos_info(NULL, NULL, &root_url, NULL,
+      SVN_ERR(svn_wc__node_get_repos_info(NULL, &repos_relpath, &repos_root_url,
+                                          NULL,
                                           wc_ctx, local_abspath,
                                           scratch_pool, scratch_pool));
+      url = svn_path_url_add_component2(repos_root_url, repos_relpath,
+                                        scratch_pool);
+
       SVN_ERR(svn_subst_build_keywords3(keywords,
                                         keywords_val->data,
-                                        rev_str, url, root_url, changed_date,
+                                        rev_str, url, repos_root_url,
+                                        changed_date,
                                         author, result_pool));
     }
 
@@ -1592,7 +1595,7 @@ static svn_error_t *
 get_hunk_info(hunk_info_t **hi, patch_target_t *target,
               target_content_t *content,
               svn_diff_hunk_t *hunk, svn_linenum_t fuzz,
-              apr_int64_t previous_offset,
+              svn_linenum_t previous_offset,
               svn_boolean_t ignore_whitespace,
               svn_boolean_t is_prop_hunk,
               svn_cancel_func_t cancel_func, void *cancel_baton,
@@ -2272,7 +2275,7 @@ apply_one_patch(patch_target_t **patch_t
   int i;
   static const svn_linenum_t MAX_FUZZ = 2;
   apr_hash_index_t *hash_index;
-  apr_int64_t previous_offset = 0;
+  svn_linenum_t previous_offset = 0;
 
   SVN_ERR(init_patch_target(&target, patch, abs_wc_path, wc_ctx, strip_count,
                             remove_tempfiles, result_pool, scratch_pool));

Modified: subversion/branches/1.9.x/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs/fs-loader.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs/fs-loader.c Sat Feb 28 10:37:27 2015
@@ -441,6 +441,8 @@ default_warning_func(void *baton, svn_er
 svn_error_t *
 svn_fs__path_valid(const char *path, apr_pool_t *pool)
 {
+  char *c;
+
   /* UTF-8 encoded string without NULs. */
   if (! svn_utf__cstring_is_valid(path))
     {
@@ -457,6 +459,18 @@ svn_fs__path_valid(const char *path, apr
                                path);
     }
 
+  /* Raise an error if PATH contains a newline because svn:mergeinfo and
+     friends can't handle them.  Issue #4340 describes a similar problem
+     in the FSFS code itself.
+   */
+  c = strchr(path, '\n');
+  if (c)
+    {
+      return svn_error_createf(SVN_ERR_FS_PATH_SYNTAX, NULL,
+               _("Invalid control character '0x%02x' in path '%s'"),
+               (unsigned char)*c, svn_path_illegal_path_escape(path, pool));
+    }
+
   /* That's good enough. */
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/1.9.x/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_fs/hotcopy.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_fs/hotcopy.c Sat Feb 28 10:37:27 2015
@@ -855,7 +855,6 @@ hotcopy_body(void *baton, apr_pool_t *po
                * ### so we have no way of just printing a warning via
                * ### the fs->warning() callback. */
 
-              const char *msg;
               const char *src_abspath;
               const char *dst_abspath;
               const char *config_relpath;
@@ -874,13 +873,12 @@ hotcopy_body(void *baton, apr_pool_t *po
               src_abspath = svn_dirent_dirname(src_abspath, pool);
               dst_abspath = svn_dirent_dirname(dst_abspath, pool);
 
-              msg = apr_psprintf(pool,
+              return svn_error_quick_wrapf(err,
                                  _("Failed to create hotcopy at '%s'. "
                                    "The file '%s' is missing from the source "
                                    "repository. Please create this file, for "
                                    "instance by running 'svnadmin upgrade %s'"),
                                  dst_abspath, config_relpath, src_abspath);
-              return svn_error_quick_wrap(err, msg);
             }
           else
             return svn_error_trace(err);

Modified: subversion/branches/1.9.x/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_repos/commit.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_repos/commit.c Sat Feb 28 10:37:27 2015
@@ -201,7 +201,7 @@ invoke_commit_cb(svn_commit_callback2_t
   commit_info->date = date ? date->data : NULL;
   commit_info->author = author ? author->data : NULL;
   commit_info->post_commit_err = post_commit_errstr;
-  /* commit_info->repos_root = NULL; ### Fixed up in ra-local handling */
+  /* commit_info->repos_root is not set by the repos layer, only by RA layers */
 
   return svn_error_trace(commit_cb(commit_info, commit_baton, scratch_pool));
 }

Modified: subversion/branches/1.9.x/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_repos/load-fs-vtable.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_repos/load-fs-vtable.c Sat Feb 28 10:37:27 2015
@@ -726,6 +726,7 @@ set_revision_property(void *baton,
   struct revision_baton *rb = baton;
   struct parse_baton *pb = rb->pb;
   svn_boolean_t is_date = strcmp(name, SVN_PROP_REVISION_DATE) == 0;
+  svn_prop_t *prop;
 
   /* If we're skipping this revision, we're done here. */
   if (rb->skipped)
@@ -735,32 +736,16 @@ set_revision_property(void *baton,
   if (is_date && pb->ignore_dates)
     return SVN_NO_ERROR;
 
-  if (rb->rev > 0)
-    {
-      svn_prop_t *prop = &APR_ARRAY_PUSH(rb->revprops, svn_prop_t);
-
-      /* Collect property changes to apply them in one FS call in
-         close_revision. */
-      prop->name = apr_pstrdup(rb->pool, name);
-      prop->value = svn_string_dup(value, rb->pool);
-
-      /* Remember any datestamp that passes through!  (See comment in
-         close_revision() below.) */
-      if (is_date)
-        rb->datestamp = svn_string_dup(value, rb->pool);
-    }
-  else if (rb->rev == 0)
-    {
-      /* Special case: set revision 0 properties when loading into an
-         'empty' filesystem. */
-      svn_revnum_t youngest_rev;
-
-      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, pb->fs, rb->pool));
-
-      if (youngest_rev == 0)
-        SVN_ERR(change_rev_prop(pb->repos, 0, name, value,
-                                pb->validate_props, rb->pool));
-    }
+  /* Collect property changes to apply them in one FS call in
+     close_revision. */
+  prop = &APR_ARRAY_PUSH(rb->revprops, svn_prop_t);
+  prop->name = apr_pstrdup(rb->pool, name);
+  prop->value = svn_string_dup(value, rb->pool);
+
+  /* Remember any datestamp that passes through!  (See comment in
+     close_revision() below.) */
+  if (is_date)
+    rb->datestamp = svn_string_dup(value, rb->pool);
 
   return SVN_NO_ERROR;
 }
@@ -1018,11 +1003,41 @@ close_revision(void *baton)
   const char *txn_name = NULL;
   apr_hash_t *hooks_env;
 
-  /* If we're skipping this revision or it has an invalid revision
-     number, we're done here. */
-  if (rb->skipped || (rb->rev <= 0))
+  /* If we're skipping this revision we're done here. */
+  if (rb->skipped)
     return SVN_NO_ERROR;
 
+  if (rb->rev == 0)
+    {
+      /* Special case: set revision 0 properties when loading into an
+         'empty' filesystem. */
+      svn_revnum_t youngest_rev;
+
+      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, pb->fs, rb->pool));
+
+      if (youngest_rev == 0)
+        {
+          apr_hash_t *orig_props;
+          apr_hash_t *new_props;
+          apr_array_header_t *diff;
+          int i;
+
+          SVN_ERR(svn_fs_revision_proplist(&orig_props, pb->fs, 0, rb->pool));
+          new_props = svn_prop_array_to_hash(rb->revprops, rb->pool);
+          SVN_ERR(svn_prop_diffs(&diff, new_props, orig_props, rb->pool));
+
+          for (i = 0; i < diff->nelts; i++)
+          {
+              const svn_prop_t *prop = &APR_ARRAY_IDX(diff, i, svn_prop_t);
+
+              SVN_ERR(change_rev_prop(pb->repos, 0, prop->name, prop->value,
+                                      pb->validate_props, rb->pool));
+          }
+        }
+
+      return SVN_NO_ERROR;
+    }
+
   /* If the dumpstream doesn't have an 'svn:date' property and we
      aren't ignoring the dates in the dumpstream altogether, remove
      any 'svn:date' revision property that was set by FS layer when

Modified: subversion/branches/1.9.x/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/cache-membuffer.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/cache-membuffer.c Sat Feb 28 10:37:27 2015
@@ -1819,6 +1819,61 @@ svn_cache__membuffer_cache_create(svn_me
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_cache__membuffer_clear(svn_membuffer_t *cache)
+{
+  apr_size_t seg;
+  apr_size_t segment_count = cache->segment_count;
+
+  /* Length of the group_initialized array in bytes.
+     See also svn_cache__membuffer_cache_create(). */
+  apr_size_t group_init_size
+    = 1 + (cache->group_count + cache->spare_group_count)
+            / (8 * GROUP_INIT_GRANULARITY);
+
+  /* Clear segment by segment.  This implies that other thread may read
+     and write to other segments after we cleared them and before the
+     last segment is done.
+
+     However, that is no different from a write request coming through
+     right after we cleared all segments because dependencies between
+     cache entries (recursive lookup / access locks) are not allowed.
+   */
+  for (seg = 0; seg < segment_count; ++seg)
+    {
+      /* Unconditionally acquire the write lock. */
+      SVN_ERR(force_write_lock_cache(&cache[seg]));
+
+      /* Mark all groups as "not initialized", which implies "empty". */
+      cache[seg].first_spare_group = NO_INDEX;
+      cache[seg].max_spare_used = 0;
+
+      memset(cache[seg].group_initialized, 0, group_init_size);
+
+      /* Unlink L1 contents. */
+      cache[seg].l1.first = NO_INDEX;
+      cache[seg].l1.last = NO_INDEX;
+      cache[seg].l1.next = NO_INDEX;
+      cache[seg].l1.current_data = cache[seg].l1.start_offset;
+
+      /* Unlink L2 contents. */
+      cache[seg].l2.first = NO_INDEX;
+      cache[seg].l2.last = NO_INDEX;
+      cache[seg].l2.next = NO_INDEX;
+      cache[seg].l2.current_data = cache[seg].l2.start_offset;
+
+      /* Reset content counters. */
+      cache[seg].data_used = 0;
+      cache[seg].used_entries = 0;
+
+      /* Segment may be used again. */
+      SVN_ERR(unlock_cache(&cache[seg], SVN_NO_ERROR));
+    }
+
+  /* done here */
+  return SVN_NO_ERROR;
+}
+
 /* Look for the cache entry in group GROUP_INDEX of CACHE, identified
  * by the hash value TO_FIND and set *FOUND accordingly.
  *

Modified: subversion/branches/1.9.x/subversion/libsvn_subr/cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/cache.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/cache.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/cache.c Sat Feb 28 10:37:27 2015
@@ -102,6 +102,11 @@ svn_cache__has_key(svn_boolean_t *found,
                    apr_pool_t *scratch_pool)
 {
   *found = FALSE;
+#ifdef SVN_DEBUG
+  if (cache->pretend_empty)
+    return SVN_NO_ERROR;
+#endif
+
   return handle_error(cache,
                       (cache->vtable->has_key)(found,
                                                cache->cache_internal,

Modified: subversion/branches/1.9.x/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/error.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/error.c Sat Feb 28 10:37:27 2015
@@ -67,6 +67,7 @@ static const char SVN_FILE_LINE_UNDEFINE
 #undef svn_error_create
 #undef svn_error_createf
 #undef svn_error_quick_wrap
+#undef svn_error_quick_wrapf
 #undef svn_error_wrap_apr
 
 /* Note: Although this is a "__" function, it was historically in the
@@ -224,6 +225,26 @@ svn_error_quick_wrap(svn_error_t *child,
                           new_msg);
 }
 
+svn_error_t *
+svn_error_quick_wrapf(svn_error_t *child,
+                      const char *fmt,
+                      ...)
+{
+  svn_error_t *err;
+  va_list ap;
+
+  if (child == SVN_NO_ERROR)
+    return SVN_NO_ERROR;
+
+  err = make_error_internal(child->apr_err, child);
+
+  va_start(ap, fmt);
+  err->message = apr_pvsprintf(err->pool, fmt, ap);
+  va_end(ap);
+
+  return err;
+}
+
 /* Messages in tracing errors all point to this static string. */
 static const char error_tracing_link[] = "traced call";
 
@@ -557,10 +578,6 @@ svn_handle_error2(svn_error_t *err,
   apr_array_header_t *empties;
   svn_error_t *tmp_err;
 
-  /* ### The rest of this file carefully avoids using svn_pool_*(),
-     preferring apr_pool_*() instead.  I can't remember why -- it may
-     be an artifact of r843793, or it may be for some deeper reason --
-     but I'm playing it safe and using apr_pool_*() here too. */
   subpool = svn_pool_create(err->pool);
   empties = apr_array_make(subpool, 0, sizeof(apr_status_t));
 

Modified: subversion/branches/1.9.x/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/io.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/io.c Sat Feb 28 10:37:27 2015
@@ -1002,10 +1002,9 @@ svn_io_copy_perms(const char *src,
           svn_error_clear(err);
         else
           {
-            const char *message;
-            message = apr_psprintf(pool, _("Can't set permissions on '%s'"),
-                                   svn_dirent_local_style(dst, pool));
-            return svn_error_quick_wrap(err, message);
+            return svn_error_quick_wrapf(
+                     err, _("Can't set permissions on '%s'"),
+                     svn_dirent_local_style(dst, pool));
           }
       }
   }
@@ -5080,12 +5079,9 @@ svn_io_open_unique_file3(apr_file_t **fi
             svn_error_clear(err);
           else
             {
-              const char *message;
-              message = apr_psprintf(scratch_pool,
-                                     _("Can't set permissions on '%s'"),
-                                     svn_dirent_local_style(tempname,
-                                                            scratch_pool));
-              return svn_error_quick_wrap(err, message);
+              return svn_error_quick_wrapf(
+                       err, _("Can't set permissions on '%s'"),
+                       svn_dirent_local_style(tempname, scratch_pool));
             }
         }
     }

Modified: subversion/branches/1.9.x/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/sqlite.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/sqlite.c Sat Feb 28 10:37:27 2015
@@ -1477,8 +1477,6 @@ struct function_wrapper_baton_t
 {
   svn_sqlite__func_t func;
   void *baton;
-
-  apr_pool_t *scratch_pool;
 };
 
 static void
@@ -1488,22 +1486,12 @@ wrapped_func(sqlite3_context *context,
 {
   struct function_wrapper_baton_t *fwb = sqlite3_user_data(context);
   svn_sqlite__context_t sctx;
-  svn_sqlite__value_t **local_vals =
-                            apr_palloc(fwb->scratch_pool,
-                                       sizeof(svn_sqlite__value_t *) * argc);
   svn_error_t *err;
-  int i;
+  void *void_values = values;
 
   sctx.context = context;
 
-  for (i = 0; i < argc; i++)
-    {
-      local_vals[i] = apr_palloc(fwb->scratch_pool, sizeof(*local_vals[i]));
-      local_vals[i]->value = values[i];
-    }
-
-  err = fwb->func(&sctx, argc, local_vals, fwb->scratch_pool);
-  svn_pool_clear(fwb->scratch_pool);
+  err = fwb->func(&sctx, argc, void_values, fwb->baton);
 
   if (err)
     {
@@ -1515,6 +1503,7 @@ wrapped_func(sqlite3_context *context,
     }
 }
 
+
 svn_error_t *
 svn_sqlite__create_scalar_function(svn_sqlite__db_t *db,
                                    const char *func_name,
@@ -1527,7 +1516,6 @@ svn_sqlite__create_scalar_function(svn_s
   struct function_wrapper_baton_t *fwb = apr_pcalloc(db->state_pool,
                                                      sizeof(*fwb));
 
-  fwb->scratch_pool = svn_pool_create(db->state_pool);
   fwb->func = func;
   fwb->baton = baton;
 
@@ -1545,13 +1533,15 @@ svn_sqlite__create_scalar_function(svn_s
 int
 svn_sqlite__value_type(svn_sqlite__value_t *val)
 {
-  return sqlite3_value_type(val->value);
+  void *v = val;
+  return sqlite3_value_type(v);
 }
 
 const char *
 svn_sqlite__value_text(svn_sqlite__value_t *val)
 {
-  return (const char *) sqlite3_value_text(val->value);
+  void *v = val;
+  return (const char *) sqlite3_value_text(v);
 }
 
 void

Modified: subversion/branches/1.9.x/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/string.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/string.c Sat Feb 28 10:37:27 2015
@@ -1300,7 +1300,7 @@ svn__base36toui64(const char **next, con
 }
 
 
-unsigned int
+apr_size_t
 svn_cstring__similarity(const char *stra, const char *strb,
                         svn_membuf_t *buffer, apr_size_t *rlcs)
 {
@@ -1312,7 +1312,7 @@ svn_cstring__similarity(const char *stra
   return svn_string__similarity(&stringa, &stringb, buffer, rlcs);
 }
 
-unsigned int
+apr_size_t
 svn_string__similarity(const svn_string_t *stringa,
                        const svn_string_t *stringb,
                        svn_membuf_t *buffer, apr_size_t *rlcs)
@@ -1401,9 +1401,9 @@ svn_string__similarity(const svn_string_
 
   /* Return similarity ratio rounded to 4 significant digits */
   if (total)
-    return(unsigned int)((2000 * lcs + total/2) / total);
+    return ((2 * SVN_STRING__SIM_RANGE_MAX * lcs + total/2) / total);
   else
-    return 1000;
+    return SVN_STRING__SIM_RANGE_MAX;
 }
 
 apr_size_t

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/adm_ops.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/adm_ops.c Sat Feb 28 10:37:27 2015
@@ -680,7 +680,8 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
                                          repos_relpath,
                                          repos_root_url, repos_uuid,
                                          copyfrom_rev,
-                                         NULL /* children */, FALSE, depth,
+                                         NULL /* children */, depth,
+                                         FALSE /* is_move */,
                                          NULL /* conflicts */,
                                          NULL /* work items */,
                                          scratch_pool));

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/conflicts.c Sat Feb 28 10:37:27 2015
@@ -2537,19 +2537,31 @@ resolve_tree_conflict_on_node(svn_boolea
             {
               /* Break moves for any children moved out of this directory,
                * and leave this directory deleted. */
-              SVN_ERR(svn_wc__db_resolve_break_moved_away_children(
-                        db, local_abspath, src_op_root_abspath,
-                        notify_func, notify_baton,
-                        scratch_pool));
+
+              if (action != svn_wc_conflict_action_delete)
+                {
+                  SVN_ERR(svn_wc__db_op_break_moved_away(
+                                  db, local_abspath, src_op_root_abspath, TRUE,
+                                  notify_func, notify_baton,
+                                  scratch_pool));
+                  *did_resolve = TRUE;
+                  return SVN_NO_ERROR; /* Marked resolved by function*/
+                }
+              /* else # The move is/moves are already broken */
+
+
               *did_resolve = TRUE;
             }
           else if (conflict_choice == svn_wc_conflict_choose_mine_conflict)
             {
-              /* Raised moved-away conflicts on any children moved out of
-               * this directory, and leave this directory deleted.
+              svn_skel_t *new_conflicts;
+
+              /* Raise moved-away conflicts on any children moved out of
+               * this directory, and leave this directory as-is.
+               *
                * The newly conflicted moved-away children will be updated
                * if they are resolved with 'mine_conflict' as well. */
-              err = svn_wc__db_resolve_delete_raise_moved_away(
+              err = svn_wc__db_op_raise_moved_away(
                         db, local_abspath, notify_func, notify_baton,
                         scratch_pool);
 
@@ -2569,8 +2581,44 @@ resolve_tree_conflict_on_node(svn_boolea
 
                   return SVN_NO_ERROR; /* Retry after other conflicts */
                 }
-              else
-                *did_resolve = TRUE;
+
+              /* We might now have a moved-away on *this* path, let's
+                 try to resolve that directly if that is the case */
+              SVN_ERR(svn_wc__db_read_conflict(&new_conflicts, NULL,
+                                               db, local_abspath,
+                                               scratch_pool, scratch_pool));
+
+              if (new_conflicts)
+                SVN_ERR(svn_wc__conflict_read_info(NULL, NULL, NULL, NULL,
+                                                   &tree_conflicted,
+                                                   db, local_abspath,
+                                                   new_conflicts,
+                                                   scratch_pool,
+                                                   scratch_pool));
+
+              if (!new_conflicts || !tree_conflicted)
+                {
+                  /* TC is marked resolved by calling
+                     svn_wc__db_resolve_delete_raise_moved_away */
+                  *did_resolve = TRUE;
+                  return SVN_NO_ERROR;
+                }
+
+              SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
+                                                          &src_op_root_abspath,
+                                                          db, local_abspath,
+                                                          new_conflicts,
+                                                          scratch_pool,
+                                                          scratch_pool));
+
+              if (reason != svn_wc_conflict_reason_moved_away)
+                {
+                  *did_resolve = TRUE;
+                  return SVN_NO_ERROR; /* We fixed one, but... */
+                }
+
+              conflicts = new_conflicts;
+              /* Fall through in moved_away handling */
             }
           else
             return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
@@ -2581,8 +2629,9 @@ resolve_tree_conflict_on_node(svn_boolea
                                      svn_dirent_local_style(local_abspath,
                                                             scratch_pool));
         }
-      else if (reason == svn_wc_conflict_reason_moved_away
-               && action == svn_wc_conflict_action_edit)
+
+      if (reason == svn_wc_conflict_reason_moved_away
+           && action == svn_wc_conflict_action_edit)
         {
           /* After updates, we can resolve local moved-away
            * vs. any incoming change, either by updating the
@@ -2622,15 +2671,12 @@ resolve_tree_conflict_on_node(svn_boolea
                * working copy state instead of updating the move.
                * Else the move would be left in an invalid state. */
 
-              /* ### This breaks the move but leaves the conflict
-                 ### involving the move until
-                 ### svn_wc__db_op_mark_resolved. */
-              SVN_ERR(svn_wc__db_resolve_break_moved_away(db, local_abspath,
-                                                          src_op_root_abspath,
-                                                          notify_func,
-                                                          notify_baton,
-                                                          scratch_pool));
+              SVN_ERR(svn_wc__db_op_break_moved_away(db, local_abspath,
+                                                     src_op_root_abspath, TRUE,
+                                                     notify_func, notify_baton,
+                                                     scratch_pool));
               *did_resolve = TRUE;
+              return SVN_NO_ERROR; /* Conflict is marked resolved */
             }
           else
             return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
@@ -2768,6 +2814,7 @@ struct conflict_status_walker_baton
   void *cancel_baton;
   svn_wc_notify_func2_t notify_func;
   void *notify_baton;
+  svn_boolean_t resolved_one;
   apr_hash_t *resolve_later;
 };
 
@@ -2943,6 +2990,9 @@ conflict_status_walker(void *baton,
                                            iterpool),
                       iterpool);
 
+  if (resolved)
+    cswb->resolved_one = TRUE;
+
   svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
@@ -3008,6 +3058,7 @@ svn_wc__resolve_conflicts(svn_wc_context
   cswb.notify_func = notify_func;
   cswb.notify_baton = notify_baton;
 
+  cswb.resolved_one = FALSE;
   cswb.resolve_later = (depth != svn_depth_empty)
                           ? apr_hash_make(scratch_pool)
                           : NULL;
@@ -3030,10 +3081,12 @@ svn_wc__resolve_conflicts(svn_wc_context
                            cancel_func, cancel_baton,
                            scratch_pool);
 
+  /* If we got new tree conflicts (or delayed conflicts) during the initial
+     walk, we now walk them one by one as closure. */
   while (!err && cswb.resolve_later && apr_hash_count(cswb.resolve_later))
     {
       apr_hash_index_t *hi;
-      svn_boolean_t cleared_one = FALSE;
+      svn_wc_status3_t *status = NULL;
       const char *tc_abspath = NULL;
 
       if (iterpool)
@@ -3043,31 +3096,64 @@ svn_wc__resolve_conflicts(svn_wc_context
 
       hi = apr_hash_first(scratch_pool, cswb.resolve_later);
       cswb.resolve_later = apr_hash_make(scratch_pool);
+      cswb.resolved_one = FALSE;
 
       for (; hi && !err; hi = apr_hash_next(hi))
         {
-          tc_abspath = apr_hash_this_key(hi);
+          const char *relpath;
           svn_pool_clear(iterpool);
 
-          /* ### TODO: Check if tc_abspath falls within selected depth */
+          tc_abspath = apr_hash_this_key(hi);
+
+          if (cancel_func)
+            SVN_ERR(cancel_func(cancel_baton));
+
+          relpath = svn_dirent_skip_ancestor(local_abspath,
+                                             tc_abspath);
 
-          err = svn_wc_walk_status(wc_ctx, tc_abspath, svn_depth_empty,
-                                   FALSE, FALSE, TRUE, NULL,
-                                   conflict_status_walker, &cswb,
-                                   cancel_func, cancel_baton,
-                                   iterpool);
+          if (!relpath
+              || (depth >= svn_depth_empty
+                  && depth < svn_depth_infinity
+                  && strchr(relpath, '/')))
+            {
+              continue;
+            }
+
+          SVN_ERR(svn_wc_status3(&status, wc_ctx, tc_abspath,
+                                 iterpool, iterpool));
 
-          if (!err && !svn_hash_gets(cswb.resolve_later, tc_abspath))
-            cleared_one = TRUE;
+          if (depth == svn_depth_files
+              && status->kind == svn_node_dir)
+            continue;
+
+          err = svn_error_trace(conflict_status_walker(&cswb, tc_abspath,
+                                                       status, scratch_pool));
         }
 
-      if (!cleared_one && !err)
+      /* None of the remaining conflicts got resolved, and non did provide
+         an error...
+
+         We can fix that if we disable the 'resolve_later' option...
+       */
+      if (!cswb.resolved_one && !err && tc_abspath
+          && apr_hash_count(cswb.resolve_later))
         {
-          /* Return the error on one of the paths: The last one. */
+          /* Run the last resolve operation again. We still have status
+             and tc_abspath for that one. */
+
+          cswb.resolve_later = NULL; /* Produce proper error! */
+
+          /* Recreate the error */
+          err = svn_error_trace(conflict_status_walker(&cswb, tc_abspath,
+                                                       status, scratch_pool));
+
+          SVN_ERR_ASSERT(err != NULL);
+
           err = svn_error_createf(
-                    SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                    SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, err,
                     _("Unable to resolve pending conflict on '%s'"),
                     svn_dirent_local_style(tc_abspath, scratch_pool));
+          break;
         }
     }
 

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/copy.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/copy.c Sat Feb 28 10:37:27 2015
@@ -997,6 +997,8 @@ static svn_error_t *
 remove_all_conflict_markers(svn_wc__db_t *db,
                             const char *src_dir_abspath,
                             const char *dst_dir_abspath,
+                            svn_cancel_func_t cancel_func,
+                            void *cancel_baton,
                             apr_pool_t *scratch_pool)
 {
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -1020,6 +1022,9 @@ remove_all_conflict_markers(svn_wc__db_t
       const char *name = apr_hash_this_key(hi);
       struct svn_wc__db_info_t *info = apr_hash_this_val(hi);
 
+      if (cancel_func)
+        SVN_ERR(cancel_func(cancel_baton));
+
       if (info->conflicted)
         {
           svn_pool_clear(iterpool);
@@ -1036,6 +1041,7 @@ remove_all_conflict_markers(svn_wc__db_t
                             db,
                             svn_dirent_join(src_dir_abspath, name, iterpool),
                             svn_dirent_join(dst_dir_abspath, name, iterpool),
+                            cancel_func, cancel_baton,
                             iterpool));
         }
     }
@@ -1093,7 +1099,25 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
      is still in a valid state. So be careful when switching this over
      to the workqueue. */
   if (!metadata_only)
-    SVN_ERR(svn_io_file_rename(src_abspath, dst_abspath, scratch_pool));
+    {
+      svn_error_t *err;
+
+      err = svn_error_trace(svn_io_file_rename(src_abspath, dst_abspath,
+                                               scratch_pool));
+
+      /* Let's try if we can keep wc.db consistent even when the move
+         fails. Deleting the target is a wc.db only operation, while
+         going forward (delaying the error) would try to change
+         conflict markers, which might also fail. */
+      if (err)
+        return svn_error_trace(
+          svn_error_compose_create(
+              err,
+              svn_wc__db_op_delete(wc_ctx->db, dst_abspath, NULL, TRUE,
+                                   NULL, NULL, cancel_func, cancel_baton,
+                                   NULL, NULL,
+                                   scratch_pool)));
+    }
 
   SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -1105,6 +1129,7 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
 
   if (kind == svn_node_dir)
     SVN_ERR(remove_all_conflict_markers(db, src_abspath, dst_abspath,
+                                        cancel_func, cancel_baton,
                                         scratch_pool));
 
   if (conflicted)

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/crop.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/crop.c Sat Feb 28 10:37:27 2015
@@ -53,7 +53,7 @@ crop_children(svn_wc__db_t *db,
               void *notify_baton,
               svn_cancel_func_t cancel_func,
               void *cancel_baton,
-              apr_pool_t *pool)
+              apr_pool_t *scratch_pool)
 {
   const apr_array_header_t *children;
   apr_pool_t *iterpool;
@@ -65,7 +65,7 @@ crop_children(svn_wc__db_t *db,
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
 
-  iterpool = svn_pool_create(pool);
+  iterpool = svn_pool_create(scratch_pool);
 
   if (dir_depth == svn_depth_unknown)
     dir_depth = svn_depth_infinity;
@@ -76,8 +76,8 @@ crop_children(svn_wc__db_t *db,
                                          iterpool));
 
   /* Looping over current directory's SVN entries: */
-  SVN_ERR(svn_wc__db_read_children(&children, db, local_abspath, pool,
-                                   iterpool));
+  SVN_ERR(svn_wc__db_base_get_children(&children, db, local_abspath,
+                                       scratch_pool, iterpool));
 
   for (i = 0; i < children->nelts; i++)
     {
@@ -86,6 +86,8 @@ crop_children(svn_wc__db_t *db,
       svn_wc__db_status_t child_status;
       svn_node_kind_t kind;
       svn_depth_t child_depth;
+      svn_boolean_t have_work;
+      svn_depth_t remove_below;
 
       svn_pool_clear(iterpool);
 
@@ -96,86 +98,80 @@ crop_children(svn_wc__db_t *db,
                                    NULL,NULL, NULL, NULL, &child_depth,
                                    NULL, NULL, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, &have_work,
                                    db, child_abspath, iterpool, iterpool));
 
-      if (child_status == svn_wc__db_status_server_excluded ||
-          child_status == svn_wc__db_status_excluded ||
-          child_status == svn_wc__db_status_not_present)
+      if (have_work)
+        {
+          svn_boolean_t modified, all_deletes;
+
+          if (child_status != svn_wc__db_status_deleted)
+            continue; /* Leave local additions alone */
+
+          SVN_ERR(svn_wc__node_has_local_mods(&modified, &all_deletes,
+                                              db, child_abspath, FALSE,
+                                              cancel_func, cancel_baton,
+                                              iterpool));
+
+          if (modified && !all_deletes)
+            continue; /* Something interesting is still there */
+        }
+
+      remove_below = (kind == svn_node_dir)
+                       ? svn_depth_immediates
+                       : svn_depth_files;
+
+      if ((child_status == svn_wc__db_status_server_excluded ||
+           child_status == svn_wc__db_status_excluded ||
+           child_status == svn_wc__db_status_not_present))
         {
-          svn_depth_t remove_below = (kind == svn_node_dir)
-                                            ? svn_depth_immediates
-                                            : svn_depth_files;
           if (new_depth < remove_below)
             SVN_ERR(svn_wc__db_base_remove(db, child_abspath,
                                            FALSE /* keep_as_working */,
-                                           FALSE /* queue_deletes */,
-                                           FALSE /* remove_locks */,
+                                           FALSE, FALSE,
                                            SVN_INVALID_REVNUM,
                                            NULL, NULL, iterpool));
 
-          continue;
+          continue; /* No recurse */
         }
-      else if (kind == svn_node_file)
+
+      if (new_depth < remove_below)
         {
-          if (new_depth == svn_depth_empty)
-            SVN_ERR(svn_wc__db_op_remove_node(NULL,
-                                              db, child_abspath,
-                                              TRUE /* destroy */,
-                                              FALSE /* destroy_changes */,
-                                              SVN_INVALID_REVNUM,
-                                              svn_wc__db_status_not_present,
-                                              svn_node_none,
-                                              NULL, NULL,
+          svn_boolean_t modified, all_deletes;
+
+          SVN_ERR(svn_wc__node_has_local_mods(&modified, &all_deletes,
+                                              db, child_abspath, FALSE,
                                               cancel_func, cancel_baton,
                                               iterpool));
-          else
-            continue;
 
-        }
-      else if (kind == svn_node_dir)
-        {
-          if (new_depth < svn_depth_immediates)
+          if (!modified || all_deletes)
             {
-              SVN_ERR(svn_wc__db_op_remove_node(NULL,
-                                                db, child_abspath,
-                                                TRUE /* destroy */,
-                                                FALSE /* destroy_changes */,
-                                                SVN_INVALID_REVNUM,
-                                                svn_wc__db_status_not_present,
-                                                svn_node_none,
-                                                NULL, NULL,
-                                                cancel_func, cancel_baton,
-                                                iterpool));
-            }
-          else
-            {
-              SVN_ERR(crop_children(db,
-                                    child_abspath,
-                                    child_depth,
-                                    svn_depth_empty,
-                                    notify_func,
-                                    notify_baton,
-                                    cancel_func,
-                                    cancel_baton,
-                                    iterpool));
-              continue;
+              SVN_ERR(svn_wc__db_base_remove(db, child_abspath,
+                                             FALSE, FALSE, FALSE,
+                                             SVN_INVALID_REVNUM,
+                                             NULL, NULL, iterpool));
+              if (notify_func)
+                {
+                  svn_wc_notify_t *notify;
+                  notify = svn_wc_create_notify(child_abspath,
+                                                svn_wc_notify_delete,
+                                                iterpool);
+                  (*notify_func)(notify_baton, notify, iterpool);
+                }
+
+              continue; /* No recurse */
             }
-        }
-      else
-        {
-          return svn_error_createf
-            (SVN_ERR_NODE_UNKNOWN_KIND, NULL, _("Unknown node kind for '%s'"),
-             svn_dirent_local_style(child_abspath, iterpool));
+
+          /* Fall through: recurse:*/
         }
 
-      if (notify_func)
+      if (kind == svn_node_dir)
         {
-          svn_wc_notify_t *notify;
-          notify = svn_wc_create_notify(child_abspath,
-                                        svn_wc_notify_delete,
-                                        iterpool);
-          (*notify_func)(notify_baton, notify, iterpool);
+          SVN_ERR(crop_children(db, child_abspath,
+                                child_depth, svn_depth_empty,
+                                notify_func, notify_baton,
+                                cancel_func, cancel_baton,
+                                iterpool));
         }
     }
 
@@ -197,6 +193,8 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
   svn_wc__db_status_t status;
   svn_node_kind_t kind;
   svn_revnum_t revision;
+  svn_depth_t depth;
+  svn_boolean_t modified, all_deletes;
   const char *repos_relpath, *repos_root, *repos_uuid;
 
   SVN_ERR(svn_wc__db_is_switched(&is_root, &is_switched, NULL,
@@ -221,7 +219,7 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
 
   SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision, &repos_relpath,
                                &repos_root, &repos_uuid, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               &depth, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL,
                                wc_ctx->db, local_abspath,
@@ -258,29 +256,41 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
         break; /* Ok to exclude */
     }
 
-  /* Remove all working copy data below local_abspath */
-  SVN_ERR(svn_wc__db_op_remove_node(NULL,
-                                    wc_ctx->db, local_abspath,
-                                    TRUE /* destroy */,
-                                    FALSE /* destroy_changes */,
-                                    revision,
-                                    svn_wc__db_status_excluded,
-                                    kind,
-                                    NULL, NULL,
-                                    cancel_func, cancel_baton,
-                                    scratch_pool));
-
-  SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
-                         cancel_func, cancel_baton,
-                         scratch_pool));
-
-  if (notify_func)
-    {
-      svn_wc_notify_t *notify;
-      notify = svn_wc_create_notify(local_abspath,
-                                    svn_wc_notify_exclude,
-                                    scratch_pool);
-      notify_func(notify_baton, notify, scratch_pool);
+  SVN_ERR(svn_wc__node_has_local_mods(&modified, &all_deletes,
+                                      wc_ctx->db, local_abspath, FALSE,
+                                      cancel_func, cancel_baton,
+                                      scratch_pool));
+
+  if (!modified || all_deletes)
+    {
+      /* Remove all working copy data below local_abspath */
+      SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
+                                     FALSE /* keep_working */,
+                                     FALSE, TRUE,
+                                     revision,
+                                     NULL, NULL,
+                                     scratch_pool));
+
+      SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
+                             cancel_func, cancel_baton,
+                             scratch_pool));
+
+      if (notify_func)
+        {
+          svn_wc_notify_t *notify;
+          notify = svn_wc_create_notify(local_abspath,
+                                        svn_wc_notify_exclude,
+                                        scratch_pool);
+          notify_func(notify_baton, notify, scratch_pool);
+        }
+    }
+  else
+    {
+      /* Do the next best thing: retry below this path */
+      SVN_ERR(crop_children(wc_ctx->db, local_abspath, depth, svn_depth_empty,
+                            notify_func, notify_baton,
+                            cancel_func, cancel_baton,
+                            scratch_pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/1.9.x/subversion/libsvn_wc/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/delete.c?rev=1662916&r1=1662915&r2=1662916&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/delete.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/delete.c Sat Feb 28 10:37:27 2015
@@ -431,9 +431,6 @@ svn_wc__internal_remove_from_revision_co
                                     db, local_abspath,
                                     destroy_wf /* destroy_wc */,
                                     destroy_wf /* destroy_changes */,
-                                    SVN_INVALID_REVNUM,
-                                    svn_wc__db_status_not_present,
-                                    svn_node_none,
                                     NULL, NULL,
                                     cancel_func, cancel_baton,
                                     scratch_pool));



Mime
View raw message