You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/01/03 15:00:44 UTC

svn commit: r1649205 [3/30] - in /subversion/branches/authzperf: ./ build/ build/ac-macros/ notes/ subversion/bindings/ctypes-python/ subversion/bindings/cxxhl/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/bindings/swig/ su...

Modified: subversion/branches/authzperf/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/externals.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/externals.c Sat Jan  3 14:00:41 2015
@@ -150,6 +150,7 @@ switch_dir_external(const char *local_ab
                     const svn_opt_revision_t *revision,
                     const char *defining_abspath,
                     svn_boolean_t *timestamp_sleep,
+                    svn_ra_session_t *ra_session,
                     svn_client_ctx_t *ctx,
                     apr_pool_t *pool)
 {
@@ -169,6 +170,36 @@ switch_dir_external(const char *local_ab
   if (revision->kind == svn_opt_revision_number)
     external_rev = revision->value.number;
 
+  /* 
+   * The code below assumes existing versioned paths are *not* part of
+   * the external's defining working copy.
+   * The working copy library does not support registering externals
+   * on top of existing BASE nodes and will error out if we try.
+   * So if the external target is part of the defining working copy's
+   * BASE tree, don't attempt to create the external. Doing so would
+   * leave behind a switched path instead of an external (since the
+   * switch succeeds but registration of the external in the DB fails).
+   * The working copy then cannot be updated until the path is switched back.
+   * See issue #4085.
+   */
+  SVN_ERR(svn_wc__node_get_base(&kind, NULL, NULL,
+                                &repos_root_url, &repos_uuid,
+                                NULL, ctx->wc_ctx, local_abspath,
+                                TRUE, /* ignore_enoent */
+                                pool, pool));
+  if (kind != svn_node_unknown)
+    {
+      const char *wcroot_abspath;
+      const char *defining_wcroot_abspath;
+
+      SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath, ctx->wc_ctx,
+                                 local_abspath, pool, pool));
+      SVN_ERR(svn_wc__get_wcroot(&defining_wcroot_abspath, ctx->wc_ctx,
+                                 defining_abspath, pool, pool));
+      if (strcmp(wcroot_abspath, defining_wcroot_abspath) == 0)
+        return svn_error_create(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, NULL);
+    }
+
   /* If path is a directory, try to update/switch to the correct URL
      and revision. */
   SVN_ERR(svn_io_check_path(local_abspath, &kind, pool));
@@ -195,12 +226,12 @@ switch_dir_external(const char *local_ab
              externals definition, perform an update. */
           if (strcmp(node_url, url) == 0)
             {
-              SVN_ERR(svn_client__update_internal(NULL, local_abspath,
+              SVN_ERR(svn_client__update_internal(NULL, timestamp_sleep,
+                                                  local_abspath,
                                                   revision, svn_depth_unknown,
                                                   FALSE, FALSE, FALSE, TRUE,
                                                   FALSE, TRUE,
-                                                  timestamp_sleep,
-                                                  ctx, subpool));
+                                                  ra_session, ctx, subpool));
               svn_pool_destroy(subpool);
               goto cleanup;
             }
@@ -317,9 +348,11 @@ switch_dir_external(const char *local_ab
     }
 
   /* ... Hello, new hotness. */
-  SVN_ERR(svn_client__checkout_internal(NULL, url, local_abspath, peg_revision,
+  SVN_ERR(svn_client__checkout_internal(NULL, timestamp_sleep,
+                                        url, local_abspath, peg_revision,
                                         revision, svn_depth_infinity,
-                                        FALSE, FALSE, timestamp_sleep,
+                                        FALSE, FALSE,
+                                        ra_session,
                                         ctx, pool));
 
   SVN_ERR(svn_wc__node_get_repos_info(NULL, NULL,
@@ -346,14 +379,15 @@ switch_dir_external(const char *local_ab
   return SVN_NO_ERROR;
 }
 
-/* Try to update a file external at LOCAL_ABSPATH to URL at REVISION using a
-   access baton that has a write lock.  Use SCRATCH_POOL for temporary
+/* Try to update a file external at LOCAL_ABSPATH to SWITCH_LOC. This function
+   assumes caller has a write lock in CTX.  Use SCRATCH_POOL for temporary
    allocations, and use the client context CTX. */
 static svn_error_t *
 switch_file_external(const char *local_abspath,
-                     const char *url,
-                     const svn_opt_revision_t *peg_revision,
-                     const svn_opt_revision_t *revision,
+                     const svn_client__pathrev_t *switch_loc,
+                     const char *record_url,
+                     const svn_opt_revision_t *record_peg_revision,
+                     const svn_opt_revision_t *record_revision,
                      const char *def_dir_abspath,
                      svn_ra_session_t *ra_session,
                      svn_client_ctx_t *ctx,
@@ -430,7 +464,8 @@ switch_file_external(const char *local_a
               SVN_ERR_CLIENT_FILE_EXTERNAL_OVERWRITE_VERSIONED, 0,
              _("The file external from '%s' cannot overwrite the existing "
                "versioned item at '%s'"),
-             url, svn_dirent_local_style(local_abspath, scratch_pool));
+             switch_loc->url,
+             svn_dirent_local_style(local_abspath, scratch_pool));
         }
     }
   else
@@ -452,25 +487,17 @@ switch_file_external(const char *local_a
     void *report_baton;
     const svn_delta_editor_t *switch_editor;
     void *switch_baton;
-    svn_client__pathrev_t *switch_loc;
     svn_revnum_t revnum;
     apr_array_header_t *inherited_props;
-    const char *dir_abspath;
-    const char *target;
-
-    svn_dirent_split(&dir_abspath, &target, local_abspath, scratch_pool);
+    const char *target = svn_dirent_basename(local_abspath, scratch_pool);
 
-    /* Open an RA session to 'source' URL */
-    SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &switch_loc,
-                                              url, dir_abspath,
-                                              peg_revision, revision,
-                                              ctx, scratch_pool));
     /* Get the external file's iprops. */
     SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props, "",
                                        switch_loc->rev,
                                        scratch_pool, scratch_pool));
 
-    SVN_ERR(svn_ra_reparent(ra_session, svn_uri_dirname(url, scratch_pool),
+    SVN_ERR(svn_ra_reparent(ra_session,
+                            svn_uri_dirname(switch_loc->url, scratch_pool),
                             scratch_pool));
 
     SVN_ERR(svn_wc__get_file_external_editor(&switch_editor, &switch_baton,
@@ -484,7 +511,9 @@ switch_file_external(const char *local_a
                                              use_commit_times,
                                              diff3_cmd, preserved_exts,
                                              def_dir_abspath,
-                                             url, peg_revision, revision,
+                                             record_url,
+                                             record_peg_revision,
+                                             record_revision,
                                              ctx->cancel_func,
                                              ctx->cancel_baton,
                                              ctx->notify_func2,
@@ -495,7 +524,7 @@ switch_file_external(const char *local_a
      invalid revnum, that means RA will use the latest revision. */
     SVN_ERR(svn_ra_do_switch3(ra_session, &reporter, &report_baton,
                               switch_loc->rev,
-                              target, svn_depth_unknown, url,
+                              target, svn_depth_unknown, switch_loc->url,
                               FALSE /* send_copyfrom */,
                               TRUE /* ignore_ancestry */,
                               switch_editor, switch_baton,
@@ -518,7 +547,7 @@ switch_file_external(const char *local_a
           = svn_wc_notify_state_inapplicable;
         notify->lock_state = svn_wc_notify_lock_state_inapplicable;
         notify->revision = revnum;
-        (*ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+        ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
       }
   }
 
@@ -631,7 +660,7 @@ handle_external_item_removal(const svn_c
       notify->kind = kind;
       notify->err = err;
 
-      (ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
 
       if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
         {
@@ -641,7 +670,7 @@ handle_external_item_removal(const svn_c
           notify->kind = svn_node_dir;
           notify->err = err;
 
-          (ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+          ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
         }
     }
 
@@ -662,10 +691,10 @@ handle_external_item_change(svn_client_c
                             const char *local_abspath,
                             const char *old_defining_abspath,
                             const svn_wc_external_item2_t *new_item,
+                            svn_ra_session_t *ra_session,
                             svn_boolean_t *timestamp_sleep,
                             apr_pool_t *scratch_pool)
 {
-  svn_ra_session_t *ra_session;
   svn_client__pathrev_t *new_loc;
   const char *new_url;
   svn_node_kind_t ext_kind;
@@ -686,12 +715,39 @@ handle_external_item_change(svn_client_c
                                                 scratch_pool, scratch_pool));
 
   /* Determine if the external is a file or directory. */
-  /* Get the RA connection. */
-  SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
-                                            new_url, NULL,
-                                            &(new_item->peg_revision),
-                                            &(new_item->revision), ctx,
-                                            scratch_pool));
+  /* Get the RA connection, if needed. */
+  if (ra_session)
+    {
+      svn_error_t *err = svn_ra_reparent(ra_session, new_url, scratch_pool);
+
+      if (err)
+        {
+          if (err->apr_err == SVN_ERR_RA_ILLEGAL_URL)
+            {
+              svn_error_clear(err);
+              ra_session = NULL;
+            }
+          else
+            return svn_error_trace(err);
+        }
+      else
+        {
+          SVN_ERR(svn_client__resolve_rev_and_url(&new_loc,
+                                                  ra_session, new_url,
+                                                  &(new_item->peg_revision),
+                                                  &(new_item->revision), ctx,
+                                                  scratch_pool));
+
+          SVN_ERR(svn_ra_reparent(ra_session, new_loc->url, scratch_pool));
+        }
+    }
+
+  if (!ra_session)
+    SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
+                                              new_url, NULL,
+                                              &(new_item->peg_revision),
+                                              &(new_item->revision), ctx,
+                                              scratch_pool));
 
   SVN_ERR(svn_ra_check_path(ra_session, "", new_loc->rev, &ext_kind,
                             scratch_pool));
@@ -715,7 +771,7 @@ handle_external_item_change(svn_client_c
   /* First notify that we're about to handle an external. */
   if (ctx->notify_func2)
     {
-      (*ctx->notify_func2)(
+      ctx->notify_func2(
          ctx->notify_baton2,
          svn_wc_create_notify(local_abspath,
                               svn_wc_notify_update_external,
@@ -739,7 +795,7 @@ handle_external_item_change(svn_client_c
                                     &(new_item->peg_revision),
                                     &(new_item->revision),
                                     parent_dir_abspath,
-                                    timestamp_sleep, ctx,
+                                    timestamp_sleep, ra_session, ctx,
                                     scratch_pool));
         break;
       case svn_node_file:
@@ -797,6 +853,7 @@ handle_external_item_change(svn_client_c
           }
 
         SVN_ERR(switch_file_external(local_abspath,
+                                     new_loc,
                                      new_url,
                                      &new_item->peg_revision,
                                      &new_item->revision,
@@ -847,6 +904,7 @@ handle_externals_change(svn_client_ctx_t
                         apr_hash_t *old_externals,
                         svn_depth_t ambient_depth,
                         svn_depth_t requested_depth,
+                        svn_ra_session_t *ra_session,
                         apr_pool_t *scratch_pool)
 {
   apr_array_header_t *new_desc;
@@ -915,7 +973,7 @@ handle_externals_change(svn_client_ctx_t
                                                   local_abspath, url,
                                                   target_abspath,
                                                   old_defining_abspath,
-                                                  new_item,
+                                                  new_item, ra_session,
                                                   timestamp_sleep,
                                                   iterpool),
                       iterpool));
@@ -938,6 +996,7 @@ svn_client__handle_externals(apr_hash_t
                              const char *target_abspath,
                              svn_depth_t requested_depth,
                              svn_boolean_t *timestamp_sleep,
+                             svn_ra_session_t *ra_session,
                              svn_client_ctx_t *ctx,
                              apr_pool_t *scratch_pool)
 {
@@ -987,7 +1046,7 @@ svn_client__handle_externals(apr_hash_t
                                       local_abspath,
                                       desc_text, old_external_defs,
                                       ambient_depth, requested_depth,
-                                      iterpool));
+                                      ra_session, iterpool));
     }
 
   /* Remove the remaining externals */

Modified: subversion/branches/authzperf/subversion/libsvn_client/import.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/import.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/import.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/import.c Sat Jan  3 14:00:41 2015
@@ -245,7 +245,7 @@ import_file(const svn_delta_editor_t *ed
       notify->content_state = notify->prop_state
         = svn_wc_notify_state_inapplicable;
       notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, pool);
     }
 
   /* If this is a special file, we need to set the svn:special
@@ -328,7 +328,7 @@ get_filtered_children(apr_hash_t **child
               notify->content_state = notify->prop_state
                 = svn_wc_notify_state_inapplicable;
               notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
+              ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
             }
 
           svn_hash_sets(dirents, base_name, NULL);
@@ -470,7 +470,7 @@ import_children(const char *dir_abspath,
                   notify->content_state = notify->prop_state
                     = svn_wc_notify_state_inapplicable;
                   notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-                  (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
+                  ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
                 }
             }
           else
@@ -559,7 +559,7 @@ import_dir(const svn_delta_editor_t *edi
         notify->content_state = notify->prop_state
           = svn_wc_notify_state_inapplicable;
         notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-        (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+        ctx->notify_func2(ctx->notify_baton2, notify, pool);
       }
   }
 
@@ -844,7 +844,7 @@ svn_client_import5(const char *path,
         = apr_array_make(scratch_pool, 1, sizeof(item));
 
       item = svn_client_commit_item3_create(scratch_pool);
-      item->path = apr_pstrdup(scratch_pool, path);
+      item->path = local_abspath;
       item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
       APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
 

Modified: subversion/branches/authzperf/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/info.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/info.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/info.c Sat Jan  3 14:00:41 2015
@@ -388,8 +388,7 @@ svn_client_info4(const char *abspath_or_
   SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
                                             abspath_or_url, NULL, peg_revision,
                                             revision, ctx, pool));
-
-  svn_uri_split(NULL, &base_name, pathrev->url, pool);
+  base_name = svn_uri_basename(pathrev->url, pool);
 
   /* Get the dirent for the URL itself. */
   SVN_ERR(svn_ra_stat(ra_session, "", pathrev->rev, &the_ent, pool));

Modified: subversion/branches/authzperf/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/locking_commands.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/locking_commands.c Sat Jan  3 14:00:41 2015
@@ -375,7 +375,6 @@ organize_lock_targets(apr_array_header_t
                                             &wli->lock_token,
                                             wc_ctx, local_abspath,
                                             FALSE /* ignore_enoent */,
-                                            FALSE /* show_hidden */,
                                             result_pool, iterpool));
 
               if (kind != svn_node_file)
@@ -403,10 +402,9 @@ organize_lock_targets(apr_array_header_t
                                 _("Unable to lock/unlock across multiple "
                                   "repositories"));
 
-      /* Now we need to create a couple of different hash mappings. */
+      /* Now we need to create our mapping. */
       rel_fs_paths = apr_hash_make(result_pool);
-      target_urls = apr_array_make(scratch_pool, targets->nelts,
-                                   sizeof(const char *));
+
       for (hi = apr_hash_first(scratch_pool, wc_info);
            hi;
            hi = apr_hash_next(hi))

Modified: subversion/branches/authzperf/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/merge.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/merge.c Sat Jan  3 14:00:41 2015
@@ -1288,8 +1288,8 @@ record_skip(merge_cmd_baton_t *merge_b,
       notify->kind = kind;
       notify->content_state = notify->prop_state = state;
 
-      (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2, notify,
-                                    scratch_pool);
+      merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2, notify,
+                                 scratch_pool);
     }
   return SVN_NO_ERROR;
 }
@@ -1415,8 +1415,8 @@ record_tree_conflict(merge_cmd_baton_t *
                                     scratch_pool);
       notify->kind = local_node_kind;
 
-      (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2, notify,
-                                    scratch_pool);
+      merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2, notify,
+                                 scratch_pool);
     }
 
   return SVN_NO_ERROR;
@@ -1450,8 +1450,8 @@ record_update_add(merge_cmd_baton_t *mer
       notify = svn_wc_create_notify(local_abspath, action, scratch_pool);
       notify->kind = kind;
 
-      (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2, notify,
-                                    scratch_pool);
+      merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2, notify,
+                                 scratch_pool);
     }
 
   return SVN_NO_ERROR;
@@ -1484,8 +1484,8 @@ record_update_update(merge_cmd_baton_t *
       notify->content_state = content_state;
       notify->prop_state = prop_state;
 
-      (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2, notify,
-                                    scratch_pool);
+      merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2, notify,
+                                 scratch_pool);
     }
 
   return SVN_NO_ERROR;
@@ -1551,8 +1551,8 @@ handle_pending_notifications(merge_cmd_b
           notify->kind = svn_node_kind_from_word(
                                     apr_hash_this_val(hi));
 
-          (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2,
-                                        notify, scratch_pool);
+          merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2,
+                                     notify, scratch_pool);
         }
 
       db->pending_deletes = NULL;
@@ -1618,9 +1618,9 @@ mark_dir_edited(merge_cmd_baton_t *merge
           notify->kind = svn_node_dir;
           notify->content_state = notify->prop_state = db->skip_reason;
 
-          (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2,
-                                        notify,
-                                        scratch_pool);
+          merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2,
+                                     notify,
+                                     scratch_pool);
         }
 
       if (merge_b->merge_source.ancestral
@@ -1700,9 +1700,9 @@ mark_file_edited(merge_cmd_baton_t *merg
           notify->kind = svn_node_file;
           notify->content_state = notify->prop_state = fb->skip_reason;
 
-          (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2,
-                                        notify,
-                                        scratch_pool);
+          merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2,
+                                     notify,
+                                     scratch_pool);
         }
 
       if (merge_b->merge_source.ancestral
@@ -3680,8 +3680,8 @@ notify_merge_begin(merge_cmd_baton_t *me
       notify->merge_range = NULL;
     }
 
-  (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2, notify,
-                                scratch_pool);
+  merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2, notify,
+                             scratch_pool);
 
   return SVN_NO_ERROR;
 }
@@ -4706,7 +4706,6 @@ calculate_remaining_ranges(svn_client__m
                                 NULL, NULL, NULL, NULL,
                                 ctx->wc_ctx, child->abspath,
                                 TRUE /* ignore_enoent */,
-                                FALSE /* show_hidden */,
                                 scratch_pool, scratch_pool));
   /* If CHILD has no base revision then it hasn't been committed yet, so it
      can't have any "future" history. */

Modified: subversion/branches/authzperf/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/mergeinfo.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/mergeinfo.c Sat Jan  3 14:00:41 2015
@@ -224,7 +224,6 @@ svn_client__get_wc_mergeinfo(svn_mergein
   SVN_ERR(svn_wc__node_get_base(NULL, &base_revision, NULL, NULL, NULL, NULL,
                                 ctx->wc_ctx, local_abspath,
                                 TRUE /* ignore_enoent */,
-                                FALSE /* show_hidden */,
                                 scratch_pool, scratch_pool));
 
   iterpool = svn_pool_create(scratch_pool);
@@ -295,7 +294,7 @@ svn_client__get_wc_mergeinfo(svn_mergein
           SVN_ERR(svn_wc__node_get_base(NULL, &parent_base_rev, NULL, NULL,
                                         NULL, NULL,
                                         ctx->wc_ctx, local_abspath,
-                                        TRUE, FALSE,
+                                        TRUE /* ignore_enoent */,
                                         scratch_pool, scratch_pool));
 
           /* ### This checks the WORKING changed_rev, so invalid on replacement

Modified: subversion/branches/authzperf/subversion/libsvn_client/mtcc.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/mtcc.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/mtcc.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/mtcc.c Sat Jan  3 14:00:41 2015
@@ -337,7 +337,6 @@ svn_client__mtcc_create(svn_client__mtcc
 
   *mtcc = apr_pcalloc(mtcc_pool, sizeof(**mtcc));
   (*mtcc)->pool = mtcc_pool;
-  (*mtcc)->base_revision = base_revision;
 
   (*mtcc)->root_op = mtcc_op_create(NULL, FALSE, TRUE, mtcc_pool);
 
@@ -350,9 +349,12 @@ svn_client__mtcc_create(svn_client__mtcc
   SVN_ERR(svn_ra_get_latest_revnum((*mtcc)->ra_session, &(*mtcc)->head_revision,
                                    scratch_pool));
 
-  if (! SVN_IS_VALID_REVNUM(base_revision))
-    base_revision = (*mtcc)->head_revision;
-  else if (base_revision > (*mtcc)->head_revision)
+  if (SVN_IS_VALID_REVNUM(base_revision))
+    (*mtcc)->base_revision = base_revision;
+  else
+    (*mtcc)->base_revision = (*mtcc)->head_revision;
+
+  if ((*mtcc)->base_revision > (*mtcc)->head_revision)
     return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
                              _("No such revision %ld (HEAD is %ld)"),
                              base_revision, (*mtcc)->head_revision);
@@ -1250,6 +1252,7 @@ add_commit_items(mtcc_op_t *op,
                                                            op->src_relpath,
                                                            result_pool);
           item->copyfrom_rev = op->src_rev;
+          item->state_flags |= SVN_CLIENT_COMMIT_ITEM_IS_COPY;
         }
       else
         item->copyfrom_rev = SVN_INVALID_REVNUM;

Modified: subversion/branches/authzperf/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/patch.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/patch.c Sat Jan  3 14:00:41 2015
@@ -48,6 +48,7 @@
 #include "private/svn_dep_compat.h"
 #include "private/svn_string_private.h"
 #include "private/svn_subr_private.h"
+#include "private/svn_sorts_private.h"
 
 typedef struct hunk_info_t {
   /* The hunk. */
@@ -1578,7 +1579,8 @@ match_existing_target(svn_boolean_t *mat
 /* Determine the line at which a HUNK applies to CONTENT of the TARGET
  * file, and return an appropriate hunk_info object in *HI, allocated from
  * RESULT_POOL. Use fuzz factor FUZZ. Set HI->FUZZ to FUZZ. If no correct
- * line can be determined, set HI->REJECTED to TRUE.
+ * line can be determined, set HI->REJECTED to TRUE.  PREVIOUS_OFFSET
+ * is the offset at which the previous matching hunk was applied, or zero.
  * IGNORE_WHITESPACE tells whether whitespace should be considered when
  * matching. IS_PROP_HUNK indicates whether the hunk patches file content
  * or a property.
@@ -1590,6 +1592,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_boolean_t ignore_whitespace,
               svn_boolean_t is_prop_hunk,
               svn_cancel_func_t cancel_func, void *cancel_baton,
@@ -1599,7 +1602,7 @@ get_hunk_info(hunk_info_t **hi, patch_ta
   svn_linenum_t original_start;
   svn_boolean_t already_applied;
 
-  original_start = svn_diff_hunk_get_original_start(hunk);
+  original_start = svn_diff_hunk_get_original_start(hunk) + previous_offset;
   already_applied = FALSE;
 
   /* An original offset of zero means that this hunk wants to create
@@ -1707,7 +1710,9 @@ get_hunk_info(hunk_info_t **hi, patch_ta
               modified_start = svn_diff_hunk_get_modified_start(hunk);
               if (modified_start == 0)
                 {
-                  /* Patch wants to delete the file. */
+                  /* Patch wants to delete the file.
+
+                     ### locally_deleted is always false here? */
                   already_applied = target->locally_deleted;
                 }
               else
@@ -2017,7 +2022,7 @@ send_hunk_notification(const hunk_info_t
   notify->hunk_fuzz = hi->fuzz;
   notify->prop_name = prop_name;
 
-  (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+  ctx->notify_func2(ctx->notify_baton2, notify, pool);
 
   return SVN_NO_ERROR;
 }
@@ -2079,7 +2084,7 @@ send_patch_notification(const patch_targ
         notify->prop_state = svn_wc_notify_state_changed;
     }
 
-  (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+  ctx->notify_func2(ctx->notify_baton2, notify, pool);
 
   if (action == svn_wc_notify_patch)
     {
@@ -2133,12 +2138,44 @@ send_patch_notification(const patch_targ
       notify = svn_wc_create_notify(target->local_abspath,
                                     svn_wc_notify_delete, pool);
       notify->kind = svn_node_file;
-      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, pool);
     }
 
   return SVN_NO_ERROR;
 }
 
+/* Implements the callback for svn_sort__array.  Puts hunks that match
+   before hunks that do not match, puts hunks that match in order
+   based on postion matched, puts hunks that do not match in order
+   based on original position. */
+static int
+sort_matched_hunks(const void *a, const void *b)
+{
+  const hunk_info_t *item1 = *((const hunk_info_t * const *)a);
+  const hunk_info_t *item2 = *((const hunk_info_t * const *)b);
+  svn_boolean_t matched1 = !item1->rejected && !item1->already_applied;
+  svn_boolean_t matched2 = !item2->rejected && !item2->already_applied;
+
+  if (matched1 && matched2)
+    {
+      /* Both match so use order matched in file. */
+      if (item1->matched_line > item2->matched_line)
+        return 1;
+    }
+  else if (matched2)
+    /* Only second matches, put it before first. */
+    return 1;
+  else
+    {
+      /* Neither matches, sort by original_start. */
+      if (svn_diff_hunk_get_original_start(item1->hunk)
+          > svn_diff_hunk_get_original_start(item2->hunk))
+        return 1;
+    }
+
+  return -1;
+}
+
 /* Apply a PATCH to a working copy at ABS_WC_PATH and put the result
  * into temporary files, to be installed in the working copy later.
  * Return information about the patch target in *PATCH_TARGET, allocated
@@ -2167,6 +2204,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_ERR(init_patch_target(&target, patch, abs_wc_path, wc_ctx, strip_count,
                             remove_tempfiles, result_pool, scratch_pool));
@@ -2209,6 +2247,7 @@ apply_one_patch(patch_target_t **patch_t
       do
         {
           SVN_ERR(get_hunk_info(&hi, target, target->content, hunk, fuzz,
+                                previous_offset,
                                 ignore_whitespace,
                                 FALSE /* is_prop_hunk */,
                                 cancel_func, cancel_baton,
@@ -2217,9 +2256,17 @@ apply_one_patch(patch_target_t **patch_t
         }
       while (hi->rejected && fuzz <= MAX_FUZZ && ! hi->already_applied);
 
+      if (hi->matched_line)
+        previous_offset
+          = hi->matched_line - svn_diff_hunk_get_original_start(hunk);
+
       APR_ARRAY_PUSH(target->content->hunks, hunk_info_t *) = hi;
     }
 
+  /* Hunks are applied in the order determined by the matched line and
+     this may be different from the order of the original lines. */
+  svn_sort__array(target->content->hunks, sort_matched_hunks);
+
   /* Apply or reject hunks. */
   for (i = 0; i < target->content->hunks->nelts; i++)
     {
@@ -2291,7 +2338,7 @@ apply_one_patch(patch_target_t **patch_t
           do
             {
               SVN_ERR(get_hunk_info(&hi, target, prop_target->content,
-                                    hunk, fuzz,
+                                    hunk, fuzz, 0,
                                     ignore_whitespace,
                                     TRUE /* is_prop_hunk */,
                                     cancel_func, cancel_baton,

Modified: subversion/branches/authzperf/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/prop_commands.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/prop_commands.c Sat Jan  3 14:00:41 2015
@@ -520,7 +520,7 @@ svn_client_revprop_set2(const char *prop
       notify->prop_name = propname;
       notify->revision = *set_rev;
 
-      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, pool);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/authzperf/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/ra.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/ra.c Sat Jan  3 14:00:41 2015
@@ -431,7 +431,7 @@ svn_client__open_ra_session_internal(svn
                 svn_wc_create_notify_url(corrected,
                                          svn_wc_notify_url_redirect,
                                          scratch_pool);
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+              ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
             }
 
           /* Our caller will want to know what our final corrected URL was. */

Modified: subversion/branches/authzperf/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/relocate.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/relocate.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/relocate.c Sat Jan  3 14:00:41 2015
@@ -127,85 +127,6 @@ validator_func(void *baton,
   return SVN_NO_ERROR;
 }
 
-
-/* Examing the array of svn_wc_external_item2_t's EXT_DESC (parsed
-   from the svn:externals property set on LOCAL_ABSPATH) and determine
-   if the external working copies described by such should be
-   relocated as a side-effect of the relocation of their parent
-   working copy (from OLD_PARENT_REPOS_ROOT_URL to
-   NEW_PARENT_REPOS_ROOT_URL).  If so, attempt said relocation.  */
-static svn_error_t *
-relocate_externals(const char *local_abspath,
-                   apr_array_header_t *ext_desc,
-                   const char *old_parent_repos_root_url,
-                   const char *new_parent_repos_root_url,
-                   svn_client_ctx_t *ctx,
-                   apr_pool_t *scratch_pool)
-{
-  apr_pool_t *iterpool;
-  int i;
-
-  /* Parse an externals definition into an array of external items. */
-
-  iterpool = svn_pool_create(scratch_pool);
-
-  for (i = 0; i < ext_desc->nelts; i++)
-    {
-      svn_wc_external_item2_t *ext_item =
-        APR_ARRAY_IDX(ext_desc, i, svn_wc_external_item2_t *);
-      const char *target_repos_root_url;
-      const char *target_abspath;
-      svn_error_t *err;
-
-      svn_pool_clear(iterpool);
-
-      /* If this external isn't pulled in via a relative URL, ignore
-         it.  There's no sense in relocating a working copy only to
-         have the next 'svn update' try to point it back to another
-         location. */
-      if (! ((strncmp("../", ext_item->url, 3) == 0) ||
-             (strncmp("^/", ext_item->url, 2) == 0)))
-        continue;
-
-      /* If the external working copy's not-yet-relocated repos root
-         URL matches the primary working copy's pre-relocated
-         repository root URL, try to relocate that external, too.
-         You might wonder why this check is needed, given that we're
-         already limiting ourselves to externals pulled via URLs
-         relative to their primary working copy.  Well, it's because
-         you can use "../" to "crawl up" above one repository's URL
-         space and down into another one.  */
-      SVN_ERR(svn_dirent_get_absolute(&target_abspath,
-                                      svn_dirent_join(local_abspath,
-                                                      ext_item->target_dir,
-                                                      iterpool),
-                                      iterpool));
-      err = svn_client_get_repos_root(&target_repos_root_url, NULL /* uuid */,
-                                      target_abspath, ctx, iterpool, iterpool);
-
-      /* Ignore externals that aren't present in the working copy.
-       * This can happen if an external is deleted from disk accidentally,
-       * or if an external is configured on a locally added directory. */
-      if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-        {
-          svn_error_clear(err);
-          continue;
-        }
-      else
-        SVN_ERR(err);
-
-      if (strcmp(target_repos_root_url, old_parent_repos_root_url) == 0)
-        SVN_ERR(svn_client_relocate2(target_abspath,
-                                     old_parent_repos_root_url,
-                                     new_parent_repos_root_url,
-                                     FALSE, ctx, iterpool));
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_client_relocate2(const char *wcroot_dir,
                      const char *from_prefix,
@@ -256,10 +177,9 @@ svn_client_relocate2(const char *wcroot_
 
 
   /* Relocate externals, too (if any). */
-  SVN_ERR(svn_wc__externals_gather_definitions(&externals_hash, NULL,
-                                               ctx->wc_ctx, local_abspath,
-                                               svn_depth_infinity,
-                                               pool, pool));
+  SVN_ERR(svn_wc__externals_defined_below(&externals_hash,
+                                          ctx->wc_ctx, local_abspath,
+                                          pool, pool));
   if (! apr_hash_count(externals_hash))
     return SVN_NO_ERROR;
 
@@ -269,18 +189,39 @@ svn_client_relocate2(const char *wcroot_
        hi != NULL;
        hi = apr_hash_next(hi))
     {
+      svn_node_kind_t kind;
       const char *this_abspath = apr_hash_this_key(hi);
-      const char *value = apr_hash_this_val(hi);
-      apr_array_header_t *ext_desc;
 
       svn_pool_clear(iterpool);
 
-      SVN_ERR(svn_wc_parse_externals_description3(&ext_desc, this_abspath,
-                                                  value, FALSE,
-                                                  iterpool));
-      if (ext_desc->nelts)
-        SVN_ERR(relocate_externals(this_abspath, ext_desc, old_repos_root_url,
-                                   new_repos_root_url, ctx, iterpool));
+      SVN_ERR(svn_wc__read_external_info(&kind, NULL, NULL, NULL, NULL,
+                                         ctx->wc_ctx,
+                                         local_abspath, this_abspath,
+                                         FALSE, iterpool, iterpool));
+
+      if (kind == svn_node_dir)
+        {
+          const char *this_repos_root_url;
+          svn_error_t *err;
+
+          err = svn_client_get_repos_root(&this_repos_root_url, NULL /* uuid */,
+                                          this_abspath, ctx, iterpool, iterpool);
+
+          /* Ignore externals that aren't present in the working copy.
+           * This can happen if an external is deleted from disk accidentally,
+           * or if an external is configured on a locally added directory. */
+          if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+            {
+              svn_error_clear(err);
+              continue;
+            }
+          SVN_ERR(err);
+
+          if (strcmp(old_repos_root_url, this_repos_root_url) == 0)
+            SVN_ERR(svn_client_relocate2(this_abspath, from_prefix, to_prefix,
+                                         FALSE /* ignore_externals */,
+                                         ctx, iterpool));
+        }
     }
 
   svn_pool_destroy(iterpool);

Modified: subversion/branches/authzperf/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/resolved.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/resolved.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/resolved.c Sat Jan  3 14:00:41 2015
@@ -77,7 +77,7 @@ svn_client__resolve_conflicts(svn_boolea
                                         ctx->notify_func2, ctx->notify_baton2,
                                         iterpool));
 
-      if (conflicts_remain)
+      if (conflicts_remain && !*conflicts_remain)
         {
           svn_error_t *err;
           svn_boolean_t text_c, prop_c, tree_c;

Modified: subversion/branches/authzperf/subversion/libsvn_client/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/revert.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/revert.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/revert.c Sat Jan  3 14:00:41 2015
@@ -98,7 +98,7 @@ revert(void *baton, apr_pool_t *result_p
           || err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
         {
           if (b->ctx->notify_func2)
-            (*b->ctx->notify_func2)(
+            b->ctx->notify_func2(
                b->ctx->notify_baton2,
                svn_wc_create_notify(b->local_abspath, svn_wc_notify_skip,
                                     scratch_pool),

Modified: subversion/branches/authzperf/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/status.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/status.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/status.c Sat Jan  3 14:00:41 2015
@@ -577,7 +577,7 @@ svn_client_status6(svn_revnum_t *result_
             = svn_wc_create_notify(target_abspath,
                                    svn_wc_notify_status_completed, pool);
           notify->revision = edit_revision;
-          (ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+          ctx->notify_func2(ctx->notify_baton2, notify, pool);
         }
 
       /* If the caller wants the result revision, give it to them. */

Modified: subversion/branches/authzperf/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/switch.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/switch.c Sat Jan  3 14:00:41 2015
@@ -365,7 +365,7 @@ switch_internal(svn_revnum_t *result_rev
                                            new_depths,
                                            switch_loc->repos_root_url,
                                            local_abspath,
-                                           depth, timestamp_sleep,
+                                           depth, timestamp_sleep, ra_session,
                                            ctx, pool));
     }
 
@@ -380,7 +380,7 @@ switch_internal(svn_revnum_t *result_rev
         = svn_wc_notify_state_inapplicable;
       notify->lock_state = svn_wc_notify_lock_state_inapplicable;
       notify->revision = revnum;
-      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, pool);
     }
 
   /* If the caller wants the result revision, give it to them. */

Modified: subversion/branches/authzperf/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/update.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/update.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/update.c Sat Jan  3 14:00:41 2015
@@ -203,7 +203,9 @@ record_conflict(svn_wc_conflict_result_t
 */
 static svn_error_t *
 update_internal(svn_revnum_t *result_rev,
+                svn_boolean_t *timestamp_sleep,
                 apr_hash_t *conflicted_paths,
+                svn_ra_session_t **ra_session_p,
                 const char *local_abspath,
                 const char *anchor_abspath,
                 const svn_opt_revision_t *revision,
@@ -212,11 +214,10 @@ update_internal(svn_revnum_t *result_rev
                 svn_boolean_t ignore_externals,
                 svn_boolean_t allow_unver_obstructions,
                 svn_boolean_t adds_as_modification,
-                svn_boolean_t *timestamp_sleep,
                 svn_boolean_t notify_summary,
                 svn_client_ctx_t *ctx,
-                svn_ra_session_t **ra_session_p,
-                apr_pool_t *pool)
+                apr_pool_t *result_pool,
+                apr_pool_t *scratch_pool)
 {
   const svn_delta_editor_t *update_editor;
   void *update_edit_baton;
@@ -253,7 +254,7 @@ update_internal(svn_revnum_t *result_rev
     depth_is_sticky = FALSE;
 
   if (strcmp(local_abspath, anchor_abspath))
-    target = svn_dirent_basename(local_abspath, pool);
+    target = svn_dirent_basename(local_abspath, scratch_pool);
   else
     target = "";
 
@@ -261,8 +262,8 @@ update_internal(svn_revnum_t *result_rev
   SVN_ERR(svn_wc__node_get_base(NULL, NULL, &repos_relpath, &repos_root_url,
                                 &repos_uuid, NULL,
                                 ctx->wc_ctx, anchor_abspath,
-                                TRUE, FALSE,
-                                pool, pool));
+                                TRUE /* ignore_enoent */,
+                                scratch_pool, scratch_pool));
 
   /* It does not make sense to update conflict victims. */
   if (repos_relpath)
@@ -271,11 +272,11 @@ update_internal(svn_revnum_t *result_rev
       svn_boolean_t text_conflicted, prop_conflicted;
 
       anchor_url = svn_path_url_add_component2(repos_root_url, repos_relpath,
-                                               pool);
+                                               scratch_pool);
 
       err = svn_wc_conflicted_p3(&text_conflicted, &prop_conflicted,
                                  NULL,
-                                 ctx->wc_ctx, local_abspath, pool);
+                                 ctx->wc_ctx, local_abspath, scratch_pool);
 
       if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
         return svn_error_trace(err);
@@ -298,9 +299,9 @@ update_internal(svn_revnum_t *result_rev
                                     target_conflicted
                                       ? svn_wc_notify_skip_conflicted
                                       : svn_wc_notify_update_skip_working_only,
-                                    pool);
+                                    scratch_pool);
 
-          ctx->notify_func2(ctx->notify_baton2, nt, pool);
+          ctx->notify_func2(ctx->notify_baton2, nt, scratch_pool);
         }
       return SVN_NO_ERROR;
     }
@@ -317,32 +318,33 @@ update_internal(svn_revnum_t *result_rev
                                  local_abspath,
                                  ctx->cancel_func, ctx->cancel_baton,
                                  ctx->notify_func2, ctx->notify_baton2,
-                                 pool));
+                                 scratch_pool));
 
           /* Target excluded, we are done now */
           return SVN_NO_ERROR;
         }
 
       SVN_ERR(svn_wc_read_kind2(&target_kind, ctx->wc_ctx, local_abspath,
-                                TRUE, TRUE, pool));
+                                TRUE, TRUE, scratch_pool));
       if (target_kind == svn_node_dir)
         {
           SVN_ERR(svn_wc_crop_tree2(ctx->wc_ctx, local_abspath, depth,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
-                                    pool));
+                                    scratch_pool));
         }
     }
 
   /* check whether the "clean c/o" optimization is applicable */
-  SVN_ERR(is_empty_wc(&clean_checkout, local_abspath, anchor_abspath, pool));
+  SVN_ERR(is_empty_wc(&clean_checkout, local_abspath, anchor_abspath,
+                      scratch_pool));
 
   /* Get the external diff3, if any. */
   svn_config_get(cfg, &diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
                  SVN_CONFIG_OPTION_DIFF3_CMD, NULL);
 
   if (diff3_cmd != NULL)
-    SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
+    SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, scratch_pool));
 
   /* See if the user wants last-commit timestamps instead of current ones. */
   SVN_ERR(svn_config_get_bool(cfg, &use_commit_times,
@@ -354,7 +356,7 @@ update_internal(svn_revnum_t *result_rev
   svn_config_get(cfg, &preserved_exts_str, SVN_CONFIG_SECTION_MISCELLANY,
                  SVN_CONFIG_OPTION_PRESERVED_CF_EXTS, "");
   preserved_exts = *preserved_exts_str
-    ? svn_cstring_split(preserved_exts_str, "\n\r\t\v ", FALSE, pool)
+    ? svn_cstring_split(preserved_exts_str, "\n\r\t\v ", FALSE, scratch_pool)
     : NULL;
 
   /* Let everyone know we're starting a real update (unless we're
@@ -363,12 +365,12 @@ update_internal(svn_revnum_t *result_rev
     {
       svn_wc_notify_t *notify
         = svn_wc_create_notify(local_abspath, svn_wc_notify_update_started,
-                               pool);
+                               scratch_pool);
       notify->kind = svn_node_none;
       notify->content_state = notify->prop_state
         = svn_wc_notify_state_inapplicable;
       notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
     }
 
   /* Try to reuse the RA session by reparenting it to the anchor_url.
@@ -377,7 +379,7 @@ update_internal(svn_revnum_t *result_rev
    * have to be in the same repo. */
   if (ra_session)
     {
-      svn_error_t *err = svn_ra_reparent(ra_session, anchor_url, pool);
+      svn_error_t *err = svn_ra_reparent(ra_session, anchor_url, scratch_pool);
       if (err)
         {
           if (err->apr_err == SVN_ERR_RA_ILLEGAL_URL)
@@ -405,7 +407,8 @@ update_internal(svn_revnum_t *result_rev
                                                    anchor_abspath, NULL,
                                                    TRUE /* write_dav_props */,
                                                    TRUE /* read_dav_props */,
-                                                   ctx, pool, pool));
+                                                   ctx,
+                                                   result_pool, scratch_pool));
       *ra_session_p = ra_session;
     }
 
@@ -417,12 +420,13 @@ update_internal(svn_revnum_t *result_rev
 
       /* To relocate everything inside our repository we need the old and new
          repos root. */
-      SVN_ERR(svn_ra_get_repos_root2(ra_session, &new_repos_root_url, pool));
+      SVN_ERR(svn_ra_get_repos_root2(ra_session, &new_repos_root_url,
+                                     scratch_pool));
 
       /* svn_client_relocate2() will check the uuid */
       SVN_ERR(svn_client_relocate2(anchor_abspath, repos_root_url,
                                    new_repos_root_url, ignore_externals,
-                                   ctx, pool));
+                                   ctx, scratch_pool));
 
       /* Store updated repository root for externals */
       repos_root_url = new_repos_root_url;
@@ -443,10 +447,10 @@ update_internal(svn_revnum_t *result_rev
      to take a URL as easily as a local path?  */
   SVN_ERR(svn_client__get_revision_number(&revnum, NULL, ctx->wc_ctx,
                                           local_abspath, ra_session, &opt_rev,
-                                          pool));
+                                          scratch_pool));
 
   SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
-                                SVN_RA_CAPABILITY_DEPTH, pool));
+                                SVN_RA_CAPABILITY_DEPTH, scratch_pool));
 
   dfb.ra_session = ra_session;
   dfb.target_revision = revnum;
@@ -454,7 +458,7 @@ update_internal(svn_revnum_t *result_rev
 
   SVN_ERR(svn_client__get_inheritable_props(&wcroot_iprops, local_abspath,
                                             revnum, depth, ra_session,
-                                            ctx, pool, pool));
+                                            ctx, scratch_pool, scratch_pool));
 
   /* Fetch the update editor.  If REVISION is invalid, that's okay;
      the RA driver will call editor->set_target_revision later on. */
@@ -473,7 +477,7 @@ update_internal(svn_revnum_t *result_rev
                                     NULL, NULL,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
-                                    pool, pool));
+                                    scratch_pool, scratch_pool));
 
   /* Tell RA to do an update of URL+TARGET to REVISION; if we pass an
      invalid revnum, that means RA will use the latest revision.  */
@@ -484,7 +488,8 @@ update_internal(svn_revnum_t *result_rev
                              : svn_depth_unknown),
                             FALSE /* send_copyfrom_args */,
                             FALSE /* ignore_ancestry */,
-                            update_editor, update_edit_baton, pool, pool));
+                            update_editor, update_edit_baton,
+                            scratch_pool, scratch_pool));
 
   /* Past this point, we assume the WC is going to be modified so we will
    * need to sleep for timestamps. */
@@ -500,7 +505,7 @@ update_internal(svn_revnum_t *result_rev
                                   use_commit_times,
                                   ctx->cancel_func, ctx->cancel_baton,
                                   ctx->notify_func2, ctx->notify_baton2,
-                                  pool));
+                                  scratch_pool));
 
   /* We handle externals after the update is complete, so that
      handling external items (and any errors therefrom) doesn't delay
@@ -513,13 +518,14 @@ update_internal(svn_revnum_t *result_rev
       SVN_ERR(svn_wc__externals_gather_definitions(&new_externals,
                                                    &new_depths,
                                                    ctx->wc_ctx, local_abspath,
-                                                   depth, pool, pool));
+                                                   depth,
+                                                   scratch_pool, scratch_pool));
 
       SVN_ERR(svn_client__handle_externals(new_externals,
                                            new_depths,
                                            repos_root_url, local_abspath,
-                                           depth, timestamp_sleep,
-                                           ctx, pool));
+                                           depth, timestamp_sleep, ra_session,
+                                           ctx, scratch_pool));
     }
 
   /* Let everyone know we're finished here (unless we're asked not to). */
@@ -527,13 +533,13 @@ update_internal(svn_revnum_t *result_rev
     {
       svn_wc_notify_t *notify
         = svn_wc_create_notify(local_abspath, svn_wc_notify_update_completed,
-                               pool);
+                               scratch_pool);
       notify->kind = svn_node_none;
       notify->content_state = notify->prop_state
         = svn_wc_notify_state_inapplicable;
       notify->lock_state = svn_wc_notify_lock_state_inapplicable;
       notify->revision = revnum;
-      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      ctx->notify_func2(ctx->notify_baton2, notify, scratch_pool);
     }
 
   /* If the caller wants the result revision, give it to them. */
@@ -545,6 +551,7 @@ update_internal(svn_revnum_t *result_rev
 
 svn_error_t *
 svn_client__update_internal(svn_revnum_t *result_rev,
+                            svn_boolean_t *timestamp_sleep,
                             const char *local_abspath,
                             const svn_opt_revision_t *revision,
                             svn_depth_t depth,
@@ -554,14 +561,13 @@ svn_client__update_internal(svn_revnum_t
                             svn_boolean_t adds_as_modification,
                             svn_boolean_t make_parents,
                             svn_boolean_t innerupdate,
-                            svn_boolean_t *timestamp_sleep,
+                            svn_ra_session_t *ra_session,
                             svn_client_ctx_t *ctx,
                             apr_pool_t *pool)
 {
   const char *anchor_abspath, *lockroot_abspath;
   svn_error_t *err;
   svn_opt_revision_t peg_revision = *revision;
-  svn_ra_session_t *ra_session = NULL;
   apr_hash_t *conflicted_paths
     = ctx->conflict_func2 ? apr_hash_make(pool) : NULL;
 
@@ -574,16 +580,21 @@ svn_client__update_internal(svn_revnum_t
       const char *parent_abspath = local_abspath;
       apr_array_header_t *missing_parents =
         apr_array_make(pool, 4, sizeof(const char *));
+      apr_pool_t *iterpool;
+
+      iterpool = svn_pool_create(pool);
 
       while (1)
         {
+          svn_pool_clear(iterpool);
+
           /* Try to lock.  If we can't lock because our target (or its
              parent) isn't a working copy, we'll try to walk up the
              tree to find a working copy, remembering this path's
              parent as one we need to flesh out.  */
           err = svn_wc__acquire_write_lock(&lockroot_abspath, ctx->wc_ctx,
                                            parent_abspath, !innerupdate,
-                                           pool, pool);
+                                           pool, iterpool);
           if (!err)
             break;
           if ((err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
@@ -605,12 +616,14 @@ svn_client__update_internal(svn_revnum_t
           const char *missing_parent =
             APR_ARRAY_IDX(missing_parents, i, const char *);
 
-          err = update_internal(result_rev, conflicted_paths,
-                                missing_parent, anchor_abspath,
-                                &peg_revision, svn_depth_empty, FALSE,
-                                ignore_externals, allow_unver_obstructions,
-                                adds_as_modification, timestamp_sleep,
-                                FALSE, ctx, &ra_session, pool);
+          svn_pool_clear(iterpool);
+
+          err = update_internal(result_rev, timestamp_sleep, conflicted_paths,
+                                &ra_session, missing_parent,
+                                anchor_abspath, &peg_revision, svn_depth_empty,
+                                FALSE, ignore_externals,
+                                allow_unver_obstructions, adds_as_modification,
+                                FALSE, ctx, pool, iterpool);
           if (err)
             goto cleanup;
           anchor_abspath = missing_parent;
@@ -621,6 +634,8 @@ svn_client__update_internal(svn_revnum_t
           peg_revision.kind = svn_opt_revision_number;
           peg_revision.value.number = *result_rev;
         }
+
+      svn_pool_destroy(iterpool);
     }
   else
     {
@@ -630,16 +645,17 @@ svn_client__update_internal(svn_revnum_t
       anchor_abspath = lockroot_abspath;
     }
 
-  err = update_internal(result_rev, conflicted_paths,
+  err = update_internal(result_rev, timestamp_sleep, conflicted_paths,
+                        &ra_session,
                         local_abspath, anchor_abspath,
                         &peg_revision, depth, depth_is_sticky,
                         ignore_externals, allow_unver_obstructions,
-                        adds_as_modification, timestamp_sleep,
-                        TRUE, ctx, &ra_session, pool);
+                        adds_as_modification,
+                        TRUE, ctx, pool, pool);
 
   /* Give the conflict resolver callback the opportunity to
    * resolve any conflicts that were raised. */
-  if (! err && ctx->conflict_func2)
+  if (! err && ctx->conflict_func2 && apr_hash_count(conflicted_paths))
     {
       err = svn_client__resolve_conflicts(NULL, conflicted_paths, ctx, pool);
     }
@@ -703,14 +719,13 @@ svn_client_update4(apr_array_header_t **
       err = svn_dirent_get_absolute(&local_abspath, path, iterpool);
       if (err)
         goto cleanup;
-      err = svn_client__update_internal(&result_rev, local_abspath,
+      err = svn_client__update_internal(&result_rev, &sleep, local_abspath,
                                         revision, depth, depth_is_sticky,
                                         ignore_externals,
                                         allow_unver_obstructions,
                                         adds_as_modification,
                                         make_parents,
-                                        FALSE, &sleep,
-                                        ctx,
+                                        FALSE, NULL, ctx,
                                         iterpool);
 
       if (err)
@@ -730,7 +745,7 @@ svn_client_update4(apr_array_header_t **
               notify = svn_wc_create_notify(path,
                                             svn_wc_notify_skip,
                                             iterpool);
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
+              ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
             }
         }
       else

Modified: subversion/branches/authzperf/subversion/libsvn_client/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/upgrade.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/upgrade.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/upgrade.c Sat Jan  3 14:00:41 2015
@@ -82,6 +82,14 @@ fetch_repos_info(const char **repos_root
   return SVN_NO_ERROR;
 }
 
+/* Forward definition. Upgrades svn:externals properties in the working copy
+   LOCAL_ABSPATH to the WC-NG  storage.
+ */
+static svn_error_t *
+upgrade_externals_from_properties(svn_client_ctx_t *ctx,
+                                  const char *local_abspath,
+                                  apr_pool_t *scratch_pool);
+
 svn_error_t *
 svn_client_upgrade(const char *path,
                    svn_client_ctx_t *ctx,
@@ -89,10 +97,6 @@ svn_client_upgrade(const char *path,
 {
   const char *local_abspath;
   apr_hash_t *externals;
-  apr_hash_index_t *hi;
-  apr_pool_t *iterpool;
-  apr_pool_t *iterpool2;
-  svn_opt_revision_t rev = {svn_opt_revision_unspecified, {0}};
   struct repos_info_baton info_baton;
 
   info_baton.state_pool = scratch_pool;
@@ -111,6 +115,80 @@ svn_client_upgrade(const char *path,
                          ctx->notify_func2, ctx->notify_baton2,
                          scratch_pool));
 
+  SVN_ERR(svn_wc__externals_defined_below(&externals,
+                                          ctx->wc_ctx, local_abspath,
+                                          scratch_pool, scratch_pool));
+
+  if (apr_hash_count(externals) > 0)
+    {
+      apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+      apr_hash_index_t *hi;
+
+      /* We are upgrading from >= 1.7. No need to upgrade from
+         svn:externals properties. And by that avoiding the removal
+         of recorded externals information (issue #4519)
+
+         Only directory externals need an explicit upgrade */
+      for (hi = apr_hash_first(scratch_pool, externals);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          const char *ext_abspath;
+          svn_node_kind_t kind;
+
+          svn_pool_clear(iterpool);
+
+          ext_abspath = apr_hash_this_key(hi);
+
+          SVN_ERR(svn_wc__read_external_info(&kind, NULL, NULL, NULL, NULL,
+                                             ctx->wc_ctx, local_abspath,
+                                             ext_abspath, FALSE,
+                                             iterpool, iterpool));
+
+          if (kind == svn_node_dir)
+            {
+              svn_error_t *err = svn_client_upgrade(ext_abspath, ctx, iterpool);
+
+              if (err)
+                {
+                  svn_wc_notify_t *notify =
+                            svn_wc_create_notify(ext_abspath,
+                                                 svn_wc_notify_failed_external,
+                                                 iterpool);
+                  notify->err = err;
+                  ctx->notify_func2(ctx->notify_baton2,
+                                    notify, iterpool);
+                  svn_error_clear(err);
+                  /* Next external node, please... */
+                }
+            }
+        }
+
+      svn_pool_destroy(iterpool);
+    }
+  else
+    {
+      /* Upgrading from <= 1.6, or no svn:properties defined.
+         (There is no way to detect the difference from libsvn_client :( ) */
+
+      SVN_ERR(upgrade_externals_from_properties(ctx, local_abspath,
+                                                scratch_pool));
+    }
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+upgrade_externals_from_properties(svn_client_ctx_t *ctx,
+                                  const char *local_abspath,
+                                  apr_pool_t *scratch_pool)
+{
+  apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
+  apr_pool_t *iterpool2;
+  apr_hash_t *externals;
+  svn_opt_revision_t rev = {svn_opt_revision_unspecified, {0}};
+  struct repos_info_baton info_baton;
+
   /* Now it's time to upgrade the externals too. We do it after the wc
      upgrade to avoid that errors in the externals causes the wc upgrade to
      fail. Thanks to caching the performance penalty of walking the wc a
@@ -163,7 +241,7 @@ svn_client_upgrade(const char *path,
                                     iterpool);
       if (!err)
         err = svn_wc_parse_externals_description3(
-                  &externals_p, svn_dirent_dirname(path, iterpool),
+                  &externals_p, svn_dirent_dirname(local_abspath, iterpool),
                   external_desc->data, FALSE, iterpool);
       if (err)
         {

Modified: subversion/branches/authzperf/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_client/util.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_client/util.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_client/util.c Sat Jan  3 14:00:41 2015
@@ -138,7 +138,12 @@ svn_client__pathrev_fspath(const svn_cli
 svn_client_commit_item3_t *
 svn_client_commit_item3_create(apr_pool_t *pool)
 {
-  return apr_pcalloc(pool, sizeof(svn_client_commit_item3_t));
+  svn_client_commit_item3_t *item = apr_pcalloc(pool, sizeof(*item));
+
+  item->revision = SVN_INVALID_REVNUM;
+  item->copyfrom_rev = SVN_INVALID_REVNUM;
+
+  return item;
 }
 
 svn_client_commit_item3_t *
@@ -195,7 +200,6 @@ svn_client__wc_node_get_base(svn_client_
                                 NULL,
                                 wc_ctx, wc_abspath,
                                 TRUE /* ignore_enoent */,
-                                TRUE /* show_hidden */,
                                 result_pool, scratch_pool));
   if ((*base_p)->repos_root_url && relpath)
     {

Modified: subversion/branches/authzperf/subversion/libsvn_delta/debug_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_delta/debug_editor.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_delta/debug_editor.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_delta/debug_editor.c Sat Jan  3 14:00:41 2015
@@ -346,8 +346,8 @@ change_file_prop(void *file_baton,
   struct edit_baton *eb = fb->edit_baton;
 
   SVN_ERR(write_indent(eb, pool));
-  SVN_ERR(svn_stream_printf(eb->out, pool, "change_file_prop : %s\n",
-                            name));
+  SVN_ERR(svn_stream_printf(eb->out, pool, "change_file_prop : %s -> %s\n",
+                            name, value ? value->data : "<deleted>"));
 
   SVN_ERR(eb->wrapped_editor->change_file_prop(fb->wrapped_file_baton,
                                                name,
@@ -367,7 +367,8 @@ change_dir_prop(void *dir_baton,
   struct edit_baton *eb = db->edit_baton;
 
   SVN_ERR(write_indent(eb, pool));
-  SVN_ERR(svn_stream_printf(eb->out, pool, "change_dir_prop : %s\n", name));
+  SVN_ERR(svn_stream_printf(eb->out, pool, "change_dir_prop : %s -> %s\n",
+                            name, value ? value->data : "<deleted>"));
 
   SVN_ERR(eb->wrapped_editor->change_dir_prop(db->wrapped_dir_baton,
                                               name,

Modified: subversion/branches/authzperf/subversion/libsvn_delta/path_driver.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_delta/path_driver.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_delta/path_driver.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_delta/path_driver.c Sat Jan  3 14:00:41 2015
@@ -187,7 +187,7 @@ svn_delta_path_driver2(const svn_delta_e
      driving the editor. */
   for (; i < paths->nelts; i++)
     {
-      const char *pdir, *bname;
+      const char *pdir;
       const char *common = "";
       size_t common_len;
 
@@ -224,9 +224,10 @@ svn_delta_path_driver2(const svn_delta_e
       /*** Step C - Open any directories between the common ancestor
            and the parent of the current path. ***/
       if (*path == '/')
-        svn_fspath__split(&pdir, &bname, path, iterpool);
+        pdir = svn_fspath__dirname(path, iterpool);
       else
-        svn_relpath_split(&pdir, &bname, path, iterpool);
+        pdir = svn_relpath_dirname(path, iterpool);
+
       if (strlen(pdir) > common_len)
         {
           const char *piece = pdir + common_len + 1;

Modified: subversion/branches/authzperf/subversion/libsvn_delta/text_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_delta/text_delta.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_delta/text_delta.c Sat Jan  3 14:00:41 2015
@@ -637,13 +637,17 @@ patterning_copy(char *target, const char
   const apr_size_t overlap = target - source;
   while (len > overlap)
     {
-      target = memcpy(target, source, overlap);
+      memcpy(target, source, overlap);
+      target += overlap;
       len -= overlap;
     }
 
   /* Copy any remaining source pattern. */
   if (len)
-    target = memcpy(target, source, len);
+    {
+      memcpy(target, source, len);
+      target += len;
+    }
 
   return target;
 }
@@ -656,6 +660,11 @@ svn_txdelta_apply_instructions(svn_txdel
   const svn_txdelta_op_t *op;
   apr_size_t tpos = 0;
 
+  /* Nothing to do for empty buffers.
+   * This check allows for NULL TBUF in that case. */
+  if (*tlen == 0)
+    return;
+
   for (op = window->ops; op < window->ops + window->num_ops; op++)
     {
       const apr_size_t buf_len = (op->length < *tlen - tpos

Modified: subversion/branches/authzperf/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_diff/diff_file.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_diff/diff_file.c Sat Jan  3 14:00:41 2015
@@ -544,7 +544,6 @@ find_identical_suffix(apr_off_t *suffix_
   int suffix_lines_to_keep = SUFFIX_LINES_TO_KEEP;
   svn_boolean_t is_match;
   apr_off_t lines = 0;
-  svn_boolean_t had_cr;
   svn_boolean_t had_nl;
   apr_size_t i;
 
@@ -685,7 +684,6 @@ find_identical_suffix(apr_off_t *suffix_
 
           /* We skipped some bytes, so there are no closing EOLs */
           had_nl = FALSE;
-          had_cr = FALSE;
         }
 
       /* The > min_curp[i] check leaves at least one final byte for checking
@@ -712,7 +710,7 @@ find_identical_suffix(apr_off_t *suffix_
      one file reaches its end. */
   do
     {
-      had_cr = FALSE;
+      svn_boolean_t had_cr = FALSE;
       while (!is_one_at_eof(file_for_suffix, file_len)
              && *file_for_suffix[0].curp != '\n'
              && *file_for_suffix[0].curp != '\r')

Modified: subversion/branches/authzperf/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs/fs-loader.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs/fs-loader.c Sat Jan  3 14:00:41 2015
@@ -558,6 +558,13 @@ svn_fs_upgrade2(const char *path,
   return SVN_NO_ERROR;
 }
 
+/* A warning handling function that does not abort on errors,
+   but just lets them be returned normally.  */
+static void
+verify_fs_warning_func(void *baton, svn_error_t *err)
+{
+}
+
 svn_error_t *
 svn_fs_verify(const char *path,
               apr_hash_t *fs_config,
@@ -574,6 +581,7 @@ svn_fs_verify(const char *path,
 
   SVN_ERR(fs_library_vtable(&vtable, path, pool));
   fs = fs_new(fs_config, pool);
+  svn_fs_set_warning_func(fs, verify_fs_warning_func, NULL);
 
   SVN_ERR(vtable->verify_fs(fs, path, start, end,
                             notify_func, notify_baton,

Modified: subversion/branches/authzperf/subversion/libsvn_fs_base/bdb/changes-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_base/bdb/changes-table.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_base/bdb/changes-table.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_base/bdb/changes-table.c Sat Jan  3 14:00:41 2015
@@ -121,12 +121,32 @@ svn_fs_bdb__changes_delete(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
+/* Return a deep FS API type copy of SOURCE in internal format and allocate
+ * the result in RESULT_POOL.
+ */
+static svn_fs_path_change2_t *
+change_to_fs_change(const change_t *change,
+                    apr_pool_t *result_pool)
+{
+  svn_fs_path_change2_t *result = svn_fs__path_change_create_internal(
+                                    svn_fs_base__id_copy(change->noderev_id,
+                                                         result_pool),
+                                    change->kind,
+                                    result_pool);
+  result->text_mod = change->text_mod;
+  result->prop_mod = change->prop_mod;
+  result->node_kind = svn_node_unknown;
+  result->copyfrom_known = FALSE;
+
+  return result;
+}
 
 /* Merge the internal-use-only CHANGE into a hash of public-FS
    svn_fs_path_change2_t CHANGES, collapsing multiple changes into a
    single succinct change per path. */
 static svn_error_t *
 fold_change(apr_hash_t *changes,
+            apr_hash_t *deletions,
             const change_t *change)
 {
   apr_pool_t *pool = apr_hash_pool_get(changes);
@@ -185,7 +205,7 @@ fold_change(apr_hash_t *changes,
         case svn_fs_path_change_reset:
           /* A reset here will simply remove the path change from the
              hash. */
-          old_change = NULL;
+          new_change = NULL;
           break;
 
         case svn_fs_path_change_delete:
@@ -194,14 +214,21 @@ fold_change(apr_hash_t *changes,
               /* If the path was introduced in this transaction via an
                  add, and we are deleting it, just remove the path
                  altogether. */
-              old_change = NULL;
+              new_change = NULL;
+            }
+          else if (old_change->change_kind == svn_fs_path_change_replace)
+            {
+              /* A deleting a 'replace' restore the original deletion. */
+              new_change = svn_hash_gets(deletions, path);
+              SVN_ERR_ASSERT(new_change);
             }
           else
             {
               /* A deletion overrules all previous changes. */
-              old_change->change_kind = svn_fs_path_change_delete;
-              old_change->text_mod = change->text_mod;
-              old_change->prop_mod = change->prop_mod;
+              new_change = old_change;
+              new_change->change_kind = svn_fs_path_change_delete;
+              new_change->text_mod = change->text_mod;
+              new_change->prop_mod = change->prop_mod;
             }
           break;
 
@@ -209,38 +236,33 @@ fold_change(apr_hash_t *changes,
         case svn_fs_path_change_replace:
           /* An add at this point must be following a previous delete,
              so treat it just like a replace. */
-          old_change->change_kind = svn_fs_path_change_replace;
-          old_change->node_rev_id = svn_fs_base__id_copy(change->noderev_id,
-                                                         pool);
-          old_change->text_mod = change->text_mod;
-          old_change->prop_mod = change->prop_mod;
+
+          new_change = change_to_fs_change(change, pool);
+          new_change->change_kind = svn_fs_path_change_replace;
+
+          /* Remember the original deletion.
+           * Make sure to allocate the hash key in a durable pool. */
+          svn_hash_sets(deletions,
+                        apr_pstrdup(apr_hash_pool_get(deletions), path),
+                        old_change);
           break;
 
         case svn_fs_path_change_modify:
         default:
+          new_change = old_change;
           if (change->text_mod)
-            old_change->text_mod = TRUE;
+            new_change->text_mod = TRUE;
           if (change->prop_mod)
-            old_change->prop_mod = TRUE;
+            new_change->prop_mod = TRUE;
           break;
         }
-
-      /* Point our new_change to our (possibly modified) old_change. */
-      new_change = old_change;
     }
   else
     {
       /* This change is new to the hash, so make a new public change
          structure from the internal one (in the hash's pool), and dup
          the path into the hash's pool, too. */
-      new_change = svn_fs__path_change_create_internal(
-                       svn_fs_base__id_copy(change->noderev_id, pool),
-                       change->kind,
-                       pool);
-      new_change->text_mod = change->text_mod;
-      new_change->prop_mod = change->prop_mod;
-      new_change->node_kind = svn_node_unknown;
-      new_change->copyfrom_known = FALSE;
+      new_change = change_to_fs_change(change, pool);
       path = apr_pstrdup(pool, change->path);
     }
 
@@ -265,6 +287,8 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
   svn_error_t *err = SVN_NO_ERROR;
   apr_hash_t *changes = apr_hash_make(pool);
   apr_pool_t *subpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_hash_t *deletions = apr_hash_make(subpool);
 
   /* Get a cursor on the first record matching KEY, and then loop over
      the records, adding them to the return array. */
@@ -286,11 +310,11 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
       svn_skel_t *result_skel;
 
       /* Clear the per-iteration subpool. */
-      svn_pool_clear(subpool);
+      svn_pool_clear(iterpool);
 
       /* RESULT now contains a change record associated with KEY.  We
          need to parse that skel into an change_t structure ...  */
-      result_skel = svn_skel__parse(result.data, result.size, subpool);
+      result_skel = svn_skel__parse(result.data, result.size, iterpool);
       if (! result_skel)
         {
           err = svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
@@ -298,12 +322,12 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
                                   key);
           goto cleanup;
         }
-      err = svn_fs_base__parse_change_skel(&change, result_skel, subpool);
+      err = svn_fs_base__parse_change_skel(&change, result_skel, iterpool);
       if (err)
         goto cleanup;
 
       /* ... and merge it with our return hash.  */
-      err = fold_change(changes, change);
+      err = fold_change(changes, deletions, change);
       if (err)
         goto cleanup;
 
@@ -319,7 +343,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
         {
           apr_hash_index_t *hi;
 
-          for (hi = apr_hash_first(subpool, changes);
+          for (hi = apr_hash_first(iterpool, changes);
                hi;
                hi = apr_hash_next(hi))
             {
@@ -347,6 +371,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
     }
 
   /* Destroy the per-iteration subpool. */
+  svn_pool_destroy(iterpool);
   svn_pool_destroy(subpool);
 
   /* If there are no (more) change records for this KEY, we're

Modified: subversion/branches/authzperf/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_base/fs.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_base/fs.c Sat Jan  3 14:00:41 2015
@@ -1084,7 +1084,7 @@ svn_fs_base__clean_logs(const char *live
 
   {  /* Process unused logs from live area */
     int idx;
-    apr_pool_t *sub_pool = svn_pool_create(pool);
+    apr_pool_t *subpool = svn_pool_create(pool);
 
     /* Process log files. */
     for (idx = 0; idx < logfiles->nelts; idx++)
@@ -1093,9 +1093,9 @@ svn_fs_base__clean_logs(const char *live
         const char *live_log_path;
         const char *backup_log_path;
 
-        svn_pool_clear(sub_pool);
-        live_log_path = svn_dirent_join(live_path, log_file, sub_pool);
-        backup_log_path = svn_dirent_join(backup_path, log_file, sub_pool);
+        svn_pool_clear(subpool);
+        live_log_path = svn_dirent_join(live_path, log_file, subpool);
+        backup_log_path = svn_dirent_join(backup_path, log_file, subpool);
 
         { /* Compare files. No point in using MD5 and wasting CPU cycles as we
              got full copies of both logs */
@@ -1112,17 +1112,17 @@ svn_fs_base__clean_logs(const char *live
             SVN_ERR(svn_io_files_contents_same_p(&files_match,
                                                  live_log_path,
                                                  backup_log_path,
-                                                 sub_pool));
+                                                 subpool));
 
           /* If log files do not match, go to the next log file. */
           if (!files_match)
             continue;
         }
 
-        SVN_ERR(svn_io_remove_file2(live_log_path, FALSE, sub_pool));
+        SVN_ERR(svn_io_remove_file2(live_log_path, FALSE, subpool));
       }
 
-    svn_pool_destroy(sub_pool);
+    svn_pool_destroy(subpool);
   }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/authzperf/subversion/libsvn_fs_base/reps-strings.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_fs_base/reps-strings.c?rev=1649205&r1=1649204&r2=1649205&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_fs_base/reps-strings.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_fs_base/reps-strings.c Sat Jan  3 14:00:41 2015
@@ -920,7 +920,7 @@ txn_body_read_rep(void *baton, trail_t *
                                            args->rb->md5_checksum)))
                 return svn_error_create(SVN_ERR_FS_CORRUPT,
                         svn_checksum_mismatch_err(rep->md5_checksum,
-                             args->rb->sha1_checksum, trail->pool,
+                             args->rb->md5_checksum, trail->pool,
                              _("MD5 checksum mismatch on representation '%s'"),
                              args->rb->rep_key),
                         NULL);