You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/01/06 20:15:49 UTC

svn commit: r1056015 [3/8] - in /subversion/branches/performance: ./ build/ build/ac-macros/ build/generator/ contrib/client-side/svnmerge/ contrib/server-side/ contrib/server-side/mod_dontdothat/ contrib/server-side/svnstsw/src/ notes/commit-access-te...

Modified: subversion/branches/performance/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_repos.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_repos.h (original)
+++ subversion/branches/performance/subversion/include/svn_repos.h Thu Jan  6 19:15:40 2011
@@ -107,7 +107,7 @@ typedef svn_error_t *(*svn_repos_authz_f
  *
  * @since New in 1.3.
  */
-typedef enum
+typedef enum svn_repos_authz_access_t
 {
   /** No access. */
   svn_authz_none = 0,
@@ -2010,7 +2010,7 @@ svn_repos_fs_get_locks2(apr_hash_t **loc
                         void *authz_read_baton,
                         apr_pool_t *pool);
 
-/** 
+/**
  * Similar to svn_repos_fs_get_locks2(), but with @a depth always
  * passed as svn_depth_infinity.
  *
@@ -2235,20 +2235,20 @@ svn_repos_fs_change_txn_props(svn_fs_txn
 /* ---------------------------------------------------------------*/
 
 /**
- * @defgroup svn_repos_inspection Data structures and editor things for
+ * @defgroup svn_repos_inspection Data structures and editor things for \
  * repository inspection.
  * @{
  *
- * As it turns out, the svn_repos_dir_delta2() interface can be
- * extremely useful for examining the repository, or more exactly,
- * changes to the repository.  svn_repos_dir_delta2() allows for
- * differences between two trees to be described using an editor.
- *
- * By using the editor obtained from svn_repos_node_editor() with
- * svn_repos_dir_delta2(), the description of how to transform one tree
- * into another can be used to build an in-memory linked-list tree,
- * which each node representing a repository node that was changed as a
- * result of having svn_repos_dir_delta2() drive that editor.
+ * As it turns out, the svn_repos_replay2(), svn_repos_dir_delta2() and
+ * svn_repos_begin_report2() interfaces can be extremely useful for
+ * examining the repository, or more exactly, changes to the repository.
+ * These drivers allows for differences between two trees to be
+ * described using an editor.
+ *
+ * By using the editor obtained from svn_repos_node_editor() with one of
+ * the drivers mentioned above, the description of how to transform one
+ * tree into another can be used to build an in-memory linked-list tree,
+ * which each node representing a repository node that was changed.
  */
 
 /** A node in the repository. */
@@ -2288,9 +2288,13 @@ typedef struct svn_repos_node_t
 
 
 /** Set @a *editor and @a *edit_baton to an editor that, when driven by
- * svn_repos_dir_delta2(), builds an <tt>svn_repos_node_t *</tt> tree
- * representing the delta from @a base_root to @a root in @a repos's
- * filesystem.
+ * a driver such as svn_repos_replay2(), builds an <tt>svn_repos_node_t *</tt>
+ * tree representing the delta from @a base_root to @a root in @a
+ * repos's filesystem.
+ *
+ * The editor can also be driven by svn_repos_dir_delta2() or
+ * svn_repos_begin_report2(), but unless you have special needs,
+ * svn_repos_replay2() is preferred.
  *
  * Invoke svn_repos_node_from_baton() on @a edit_baton to obtain the root
  * node afterwards.
@@ -2310,10 +2314,9 @@ svn_repos_node_editor(const svn_delta_ed
                       apr_pool_t *node_pool,
                       apr_pool_t *pool);
 
-/** Return the root node of the linked-list tree generated by driving
- * the editor created by svn_repos_node_editor() with
- * svn_repos_dir_delta2(), which is stored in @a edit_baton.  This is
- * only really useful if used *after* the editor drive is completed.
+/** Return the root node of the linked-list tree generated by driving the
+ * editor (associated with @a edit_baton) created by svn_repos_node_editor().
+ * This is only really useful if used *after* the editor drive is completed.
  */
 svn_repos_node_t *
 svn_repos_node_from_baton(void *edit_baton);
@@ -2972,7 +2975,7 @@ svn_repos_authz_check_access(svn_authz_t
  *
  * @since New in 1.5.
  */
-typedef enum
+typedef enum svn_repos_revision_access_level_t
 {
   svn_repos_revision_access_none,
   svn_repos_revision_access_partial,

Modified: subversion/branches/performance/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_string.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_string.h (original)
+++ subversion/branches/performance/subversion/include/svn_string.h Thu Jan  6 19:15:40 2011
@@ -411,7 +411,7 @@ svn_cstring_casecmp(const char *str1, co
  * Parse the C string @a str into a 64 bit number, and return it in @a *n.
  * Assume that the number is represented in base @a base.
  * Raise an error if conversion fails (e.g. due to overflow), or if the
- * converted number is smaller than @a minval or larger than @a maxval. 
+ * converted number is smaller than @a minval or larger than @a maxval.
  *
  * @since New in 1.7.
  */
@@ -444,7 +444,7 @@ svn_cstring_atoi(int *n, const char *str
  * Parse the C string @a str into an unsigned 64 bit number, and return
  * it in @a *n. Assume that the number is represented in base @a base.
  * Raise an error if conversion fails (e.g. due to overflow), or if the
- * converted number is smaller than @a minval or larger than @a maxval. 
+ * converted number is smaller than @a minval or larger than @a maxval.
  *
  * @since New in 1.7.
  */

Modified: subversion/branches/performance/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_types.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_types.h (original)
+++ subversion/branches/performance/subversion/include/svn_types.h Thu Jan  6 19:15:40 2011
@@ -62,6 +62,24 @@ extern "C" {
 # endif
 #endif
 
+
+/** Indicate whether the current platform supports unaligned data access.
+ *
+ * On the majority of machines running SVN (x86 / x64), unaligned access
+ * is much cheaper than repeated aligned access. Define this macro to 1
+ * on those machines.
+ * Unaligned access on other machines (e.g. IA64) will trigger memory
+ * acccess faults or simply misbehave.
+ *
+ * @since New in 1.7.
+ */
+#ifndef SVN_UNALIGNED_ACCESS_IS_OK
+# if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
+#  define SVN_UNALIGNED_ACCESS_IS_OK 1
+# else
+#  define SVN_UNALIGNED_ACCESS_IS_OK 0
+# endif
+#endif
 
 
 /** Subversion error object.
@@ -169,7 +187,7 @@ svn__apr_hash_index_val(const apr_hash_i
 /** @} */
 
 /** The various types of nodes in the Subversion filesystem. */
-typedef enum
+typedef enum svn_node_kind_t
 {
   /** absent */
   svn_node_none,
@@ -211,7 +229,7 @@ svn_node_kind_from_word(const char *word
  * not a valid value.
  *
  * @since New in 1.7. */
-typedef enum
+typedef enum svn_tristate_t
 {
   svn_tristate_false = 2,
   svn_tristate_true,
@@ -364,7 +382,7 @@ enum svn_recurse_kind
  *
  * @since New in 1.5.
  */
-typedef enum
+typedef enum svn_depth_t
 {
   /* The order of these depths is important: the higher the number,
      the deeper it descends.  This allows us to compare two depths

Modified: subversion/branches/performance/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_wc.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_wc.h (original)
+++ subversion/branches/performance/subversion/include/svn_wc.h Thu Jan  6 19:15:40 2011
@@ -3400,7 +3400,7 @@ typedef struct svn_wc_status3_t
   /** The URL of the repository */
   const char *repos_root_url;
 
-  /** The in-repository path relative to the repository root. 
+  /** The in-repository path relative to the repository root.
    * Use svn_path_url_component2() to join this value to the
    * repos_root_url to get the full URL.
    */
@@ -5277,7 +5277,7 @@ svn_wc_get_update_editor4(const svn_delt
 
 /** Similar to svn_wc_get_update_editor4, but uses access batons and relative
  * path instead of a working copy context-abspath pair and
- * svn_wc_traversal_info_t instead of an externals callback.  Also, 
+ * svn_wc_traversal_info_t instead of an externals callback.  Also,
  * @a fetch_func and @a fetch_baton are ignored.
  *
  * If @a ti is non-NULL, record traversal info in @a ti, for use by
@@ -5580,7 +5580,7 @@ svn_wc_get_pristine_props(apr_hash_t **p
                           const char *local_abspath,
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool);
-                          
+
 
 /** Set @a *value to the value of property @a name for @a local_abspath,
  * allocating @a *value in @a result_pool.  If no such prop, set @a *value

Modified: subversion/branches/performance/subversion/libsvn_auth_kwallet/kwallet.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_auth_kwallet/kwallet.cpp?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_auth_kwallet/kwallet.cpp (original)
+++ subversion/branches/performance/subversion/libsvn_auth_kwallet/kwallet.cpp Thu Jan  6 19:15:40 2011
@@ -120,7 +120,7 @@ get_wid(void)
     {
       apr_int64_t wid_env;
       svn_error_t *err;
-      
+
       err = svn_cstring_atoi64(&wid_env, wid_env_string);
       if (err)
         svn_error_clear(err);

Modified: subversion/branches/performance/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/add.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/add.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/add.c Thu Jan  6 19:15:40 2011
@@ -57,7 +57,7 @@
 /* This structure is used as baton for enumerating the config entries
    in the auto-props section.
 */
-typedef struct
+typedef struct auto_props_baton_t
 {
   /* the file name for which properties are searched */
   const char *filename;

Modified: subversion/branches/performance/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/cleanup.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/cleanup.c Thu Jan  6 19:15:40 2011
@@ -174,7 +174,7 @@ svn_client_upgrade(const char *path,
 
           item = APR_ARRAY_IDX(externals_p, i, svn_wc_external_item2_t*);
 
-          external_path = svn_dirent_join(externals_parent, item->target_dir, 
+          external_path = svn_dirent_join(externals_parent, item->target_dir,
                                           iterpool);
 
           SVN_ERR(svn_dirent_get_absolute(&external_abspath, external_path,

Modified: subversion/branches/performance/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/client.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/client.h (original)
+++ subversion/branches/performance/subversion/libsvn_client/client.h Thu Jan  6 19:15:40 2011
@@ -502,7 +502,7 @@ svn_client__update_internal(svn_revnum_t
    This structure is used by svn_client__checkout_internal() to save
    one or more round-trips if the client already gathered some of this
    information.  Not all the fields need to be filled in.  */
-typedef struct
+typedef struct svn_client__ra_session_from_path_results
 {
   /* The repository root URL.  A NULL value means the root URL is
      unknown.*/
@@ -688,7 +688,7 @@ svn_client__get_diff_summarize_editor(co
    various helper functions may need.  Not every copy function uses every
    field.
 */
-typedef struct
+typedef struct svn_client__copy_pair_t
 {
     /* The absolute source path or url. */
     const char *src_abspath_or_url;

Modified: subversion/branches/performance/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/commit_util.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/commit_util.c Thu Jan  6 19:15:40 2011
@@ -394,6 +394,7 @@ harvest_committables(apr_hash_t *committ
   const char *cf_relpath = NULL;
   svn_revnum_t entry_rev, cf_rev = SVN_INVALID_REVNUM;
   const svn_string_t *propval;
+  svn_boolean_t matches_changelists;
   svn_boolean_t is_special;
   svn_boolean_t is_file_external;
   svn_boolean_t is_added;
@@ -442,6 +443,17 @@ harvest_committables(apr_hash_t *committ
          svn_dirent_local_style(local_abspath, scratch_pool));
     }
 
+  /* Save the result for reuse. */
+  matches_changelists = svn_wc__changelist_match(ctx->wc_ctx, local_abspath,
+                                                 changelists, scratch_pool);
+
+  /* Early exit. */
+  if (working_kind != svn_node_dir && working_kind != svn_node_none
+      && ! matches_changelists)
+    {
+      return SVN_NO_ERROR;
+    }
+
   /* Verify that the node's type has not changed before attempting to
      commit. */
   SVN_ERR(svn_wc_prop_get2(&propval, ctx->wc_ctx, local_abspath,
@@ -466,8 +478,7 @@ harvest_committables(apr_hash_t *committ
 
   /* If ENTRY is in our changelist, then examine it for conflicts. We
      need to bail out if any conflicts exist.  */
-  if (svn_wc__changelist_match(ctx->wc_ctx, local_abspath, changelists,
-                               scratch_pool))
+  if (matches_changelists)
     {
       svn_boolean_t tc, pc, treec;
 

Modified: subversion/branches/performance/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/copy.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/copy.c Thu Jan  6 19:15:40 2011
@@ -513,7 +513,7 @@ verify_wc_srcs_and_dsts(const apr_array_
 
 
 /* Path-specific state used as part of path_driver_cb_baton. */
-typedef struct
+typedef struct path_driver_info_t
 {
   const char *src_url;
   const char *src_path;
@@ -824,7 +824,7 @@ repos_to_repos_copy(const apr_array_head
      *and* destinations might be an optimization when the user is
      authorized to access all that stuff, but could cause the
      operation to fail altogether otherwise.  See issue #3242.  */
-  SVN_ERR(get_copy_pair_ancestors(copy_pairs, NULL, &top_url_dst, &top_url_all, 
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, NULL, &top_url_dst, &top_url_all,
                                   pool));
   top_url = is_move ? top_url_all : top_url_dst;
 
@@ -1629,7 +1629,7 @@ repos_to_wc_copy_locked(const apr_array_
          ### simplify the conditions? */
 
       /* Hidden by client exclusion */
-      SVN_ERR(svn_wc__node_get_depth(&node_depth, ctx->wc_ctx, 
+      SVN_ERR(svn_wc__node_get_depth(&node_depth, ctx->wc_ctx,
                                      pair->dst_abspath_or_url, iterpool));
       if (node_depth == svn_depth_exclude)
         {
@@ -1661,7 +1661,7 @@ repos_to_wc_copy_locked(const apr_array_
           SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, ctx->wc_ctx,
                                                  pair->dst_abspath_or_url,
                                                  iterpool));
-          SVN_ERR(svn_wc__node_is_status_present(&is_present, 
+          SVN_ERR(svn_wc__node_is_status_present(&is_present,
                                                  ctx->wc_ctx,
                                                  pair->dst_abspath_or_url,
                                                  iterpool));
@@ -1953,7 +1953,7 @@ try_copy(const apr_array_header_t *sourc
               src_basename = svn_dirent_basename(pair->src_abspath_or_url,
                                                  iterpool);
             }
-            
+
           pair->src_op_revision = *source->revision;
           pair->src_peg_revision = *source->peg_revision;
 

Modified: subversion/branches/performance/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/delete.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/delete.c Thu Jan  6 19:15:40 2011
@@ -230,7 +230,7 @@ delete_urls(const apr_array_header_t *pa
                                 &kind, subpool));
       if (kind == svn_node_none)
         return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
-                                 "URL '%s' does not exist", item_url);
+                                 _("URL '%s' does not exist"), item_url);
     }
   svn_pool_destroy(subpool);
 

Modified: subversion/branches/performance/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/deprecated.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/deprecated.c Thu Jan  6 19:15:40 2011
@@ -1835,7 +1835,7 @@ svn_client_update(svn_revnum_t *result_r
 {
   apr_array_header_t *paths = apr_array_make(pool, 1, sizeof(const char *));
   apr_array_header_t *result_revs;
-  
+
   APR_ARRAY_PUSH(paths, const char *) = path;
 
   SVN_ERR(svn_client_update2(&result_revs, paths, revision, recurse, FALSE,
@@ -1890,7 +1890,7 @@ svn_client_checkout2(svn_revnum_t *resul
                      apr_pool_t *pool)
 {
   return svn_error_return(svn_client_checkout3(result_rev, URL, path,
-                                        peg_revision, revision, 
+                                        peg_revision, revision,
                                         SVN_DEPTH_INFINITY_OR_FILES(recurse),
                                         ignore_externals, FALSE, ctx, pool));
 }

Modified: subversion/branches/performance/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/diff.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/diff.c Thu Jan  6 19:15:40 2011
@@ -367,7 +367,7 @@ diff_label(const char *path,
  * PATH2 to the stream OS using HEADER_ENCODING.
  * All allocations are done in RESULT_POOL. */
 static svn_error_t *
-print_git_diff_header_added(svn_stream_t *os, const char *header_encoding, 
+print_git_diff_header_added(svn_stream_t *os, const char *header_encoding,
                             const char *path1, const char *path2,
                             apr_pool_t *result_pool)
 {
@@ -383,7 +383,7 @@ print_git_diff_header_added(svn_stream_t
  * PATH2 to the stream OS using HEADER_ENCODING.
  * All allocations are done in RESULT_POOL. */
 static svn_error_t *
-print_git_diff_header_deleted(svn_stream_t *os, const char *header_encoding, 
+print_git_diff_header_deleted(svn_stream_t *os, const char *header_encoding,
                               const char *path1, const char *path2,
                               apr_pool_t *result_pool)
 {
@@ -399,7 +399,7 @@ print_git_diff_header_deleted(svn_stream
 /* Print a git diff header for a copy from COPYFROM_PATH to PATH to the stream
  * OS using HEADER_ENCODING. All allocations are done in RESULT_POOL. */
 static svn_error_t *
-print_git_diff_header_copied(svn_stream_t *os, const char *header_encoding, 
+print_git_diff_header_copied(svn_stream_t *os, const char *header_encoding,
                              const char *copyfrom_path, const char *path,
                              apr_pool_t *result_pool)
 {
@@ -425,7 +425,7 @@ print_git_diff_header_renamed(svn_stream
                                       "diff --git a/%s b/%s%s",
                                       copyfrom_path, path, APR_EOL_STR));
   SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
-                                      "rename from %s%s", copyfrom_path, 
+                                      "rename from %s%s", copyfrom_path,
                                       APR_EOL_STR));
   SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
                                       "rename to %s%s", path, APR_EOL_STR));
@@ -436,7 +436,7 @@ print_git_diff_header_renamed(svn_stream
  * PATH2 to the stream OS using HEADER_ENCODING.
  * All allocations are done in RESULT_POOL. */
 static svn_error_t *
-print_git_diff_header_modified(svn_stream_t *os, const char *header_encoding, 
+print_git_diff_header_modified(svn_stream_t *os, const char *header_encoding,
                                const char *path1, const char *path2,
                                apr_pool_t *result_pool)
 {
@@ -531,12 +531,12 @@ print_git_diff_header(svn_stream_t *os,
    passed to svn_client_diff5, which is probably stdout.
 
    ### FIXME needs proper docstring
-   
+
    If USE_GIT_DIFF_FORMAT is TRUE, pring git diff headers, which always
    show paths relative to the repository root. RA_SESSION and WC_CTX are
    needed to normalize paths relative the repository root, and are ignored
    if USE_GIT_DIFF_FORMAT is FALSE.
-   
+
    WC_ROOT_ABSPATH is the absolute path to the root directory of a working
    copy involved in a repos-wc diff, and may be NULL. */
 static svn_error_t *
@@ -595,8 +595,8 @@ display_prop_diffs(const apr_array_heade
        * ### diff_content_changed() does not! */
 
       SVN_ERR(file_printf_from_utf8(file, encoding,
-                                    "Index: %s" APR_EOL_STR 
-                                    "%s" APR_EOL_STR, 
+                                    "Index: %s" APR_EOL_STR
+                                    "%s" APR_EOL_STR,
                                     path, equal_string));
 
       if (use_git_diff_format)
@@ -778,7 +778,7 @@ struct diff_cmd_baton {
    * directory of the working copy involved in the diff. */
   const char *wc_root_abspath;
 
-  /* A hashtable using the visited paths as keys. 
+  /* A hashtable using the visited paths as keys.
    * ### This is needed for us to know if we need to print a diff header for
    * ### a path that has property changes. */
   apr_hash_t *visited_paths;
@@ -1137,7 +1137,7 @@ diff_file_deleted_with_diff(const char *
 
   if (tmpfile1)
     SVN_ERR(diff_content_changed(path,
-                                 tmpfile1, tmpfile2, diff_cmd_baton->revnum1, 
+                                 tmpfile1, tmpfile2, diff_cmd_baton->revnum1,
                                  diff_cmd_baton->revnum2,
                                  mimetype1, mimetype2,
                                  svn_diff_op_deleted, NULL, diff_baton));
@@ -1371,7 +1371,7 @@ find_wc_root(const char *local_abspath, 
  *  and REVISION2 are local. If PEG_REVISION is not unspecified, ensure that
  *  at least one of the two revisions is non-local.
  *  If PATH1 can only be found in the repository, set *IS_REPOS1 to TRUE.
- *  If PATH2 can only be found in the repository, set *IS_REPOS2 to TRUE. */ 
+ *  If PATH2 can only be found in the repository, set *IS_REPOS2 to TRUE. */
 static svn_error_t *
 check_paths(svn_boolean_t *is_repos1,
             svn_boolean_t *is_repos2,
@@ -2072,7 +2072,7 @@ set_up_diff_cmd_and_options(struct diff_
                             apr_hash_t *config, apr_pool_t *pool)
 {
   const char *diff_cmd = NULL;
- 
+
   /* See if there is a diff command and/or diff arguments. */
   if (config)
     {
@@ -2092,7 +2092,7 @@ set_up_diff_cmd_and_options(struct diff_
 
   if (options == NULL)
     options = apr_array_make(pool, 0, sizeof(const char *));
- 
+
   if (diff_cmd)
     SVN_ERR(svn_path_cstring_to_utf8(&diff_cmd_baton->diff_cmd, diff_cmd,
                                      pool));
@@ -2264,7 +2264,7 @@ svn_client_diff_peg5(const apr_array_hea
   diff_cmd_baton.orig_path_1 = path;
   diff_cmd_baton.orig_path_2 = path;
 
-  SVN_ERR(set_up_diff_cmd_and_options(&diff_cmd_baton, options, 
+  SVN_ERR(set_up_diff_cmd_and_options(&diff_cmd_baton, options,
                                       ctx->config, pool));
   diff_cmd_baton.pool = pool;
   diff_cmd_baton.outfile = outfile;

Modified: subversion/branches/performance/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/export.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/export.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/export.c Thu Jan  6 19:15:40 2011
@@ -111,7 +111,7 @@ append_basename_if_dir(const char **appe
   if (local_kind == svn_node_dir)
     {
       const char *basename2; /* _2 because it shadows basename() */
-      
+
       if (is_uri)
         basename2 = svn_path_uri_decode(svn_uri_basename(basename_of, NULL), pool);
       else
@@ -161,10 +161,10 @@ copy_one_versioned_file(const char *from
       /* Only export 'added' files when the revision is WORKING. This is not
          WORKING, so skip the 'added' files, since they didn't exist
          in the BASE revision and don't have an associated text-base.
-         
+
          'replaced' files are technically the same as 'added' files.
          ### TODO: Handle replaced nodes properly.
-         ###       svn_opt_revision_base refers to the "new" 
+         ###       svn_opt_revision_base refers to the "new"
          ###       base of the node. That means, if a node is locally
          ###       replaced, export skips this node, as if it was locally
          ###       added, because svn_opt_revision_base refers to the base
@@ -268,7 +268,7 @@ copy_one_versioned_file(const char *from
           suffix = "";
         }
 
-      SVN_ERR(svn_wc__node_get_url(&url, wc_ctx, from_abspath, 
+      SVN_ERR(svn_wc__node_get_url(&url, wc_ctx, from_abspath,
                                    scratch_pool, scratch_pool));
 
       SVN_ERR(svn_subst_build_keywords2
@@ -330,7 +330,7 @@ copy_versioned_files(const char *from,
   const char *to_abspath;
   svn_node_kind_t from_kind;
   svn_depth_t node_depth;
-  
+
   SVN_ERR(svn_dirent_get_absolute(&from_abspath, from, pool));
   SVN_ERR(svn_dirent_get_absolute(&to_abspath, to, pool));
 
@@ -1042,12 +1042,12 @@ svn_client_export5(svn_revnum_t *result_
             }
           else
             {
-              SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url, 
+              SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url,
                                              TRUE, pool));
               eb->root_path = to_path;
             }
 
-          
+
           /* Since you cannot actually root an editor at a file, we
            * manually drive a few functions of our editor. */
 

Modified: subversion/branches/performance/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/externals.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/externals.c Thu Jan  6 19:15:40 2011
@@ -279,7 +279,7 @@ switch_dir_external(const char *path,
       /* Buh-bye, old and busted ... */
       SVN_ERR(svn_wc__acquire_write_lock(NULL, ctx->wc_ctx, local_abspath,
                                          FALSE, pool, pool));
-      
+
       SVN_ERR(relegate_dir_external(&baton, pool, pool));
     }
   else
@@ -858,7 +858,7 @@ handle_external_item_change(const void *
             SVN_ERR(svn_client_export4(NULL, new_item->url, local_abspath,
                                        &(new_item->peg_revision),
                                        &(new_item->revision),
-                                       TRUE, FALSE, svn_depth_infinity, 
+                                       TRUE, FALSE, svn_depth_infinity,
                                        ib->native_eol,
                                        ib->ctx, ib->iter_pool));
           else

Modified: subversion/branches/performance/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/locking_commands.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/locking_commands.c Thu Jan  6 19:15:40 2011
@@ -191,18 +191,15 @@ organize_lock_targets(const char **commo
 
   /* Get the common parent and all paths */
   if (url_mode)
-    {
-      SVN_ERR(svn_uri_condense_targets(common_parent_url, &rel_targets,
-                                       targets, TRUE, pool, pool));
-    }
+    SVN_ERR(svn_uri_condense_targets(common_parent_url, &rel_targets,
+                                     targets, TRUE, pool, pool));
   else
-    {
-      SVN_ERR(svn_dirent_condense_targets(common_parent_url, &rel_targets,
-                                          targets, TRUE, pool, pool));
-    }
+    SVN_ERR(svn_dirent_condense_targets(common_parent_url, &rel_targets,
+                                        targets, TRUE, pool, pool));
 
-  /* svn_path_condense_targets leaves paths empty if TARGETS only had
-     1 member, so we special case that. */
+  /* svn_uri_condense_targets and svn_dirent_condense_targets leaves
+     URLs/paths empty if TARGETS only had 1 member, so we special case
+     that. */
   if (apr_is_empty_array(rel_targets))
     {
       const char *parent, *base;
@@ -273,8 +270,8 @@ organize_lock_targets(const char **commo
       SVN_ERR(svn_uri_condense_targets(&common_url, &rel_urls, urls,
                                        FALSE, pool, pool));
 
-      /* svn_path_condense_targets leaves paths empty if TARGETS only had
-         1 member, so we special case that (again). */
+      /* svn_uri_condense_targets leaves URLs empty if TARGETS only
+         had 1 member, so we special case that (again). */
       if (apr_is_empty_array(rel_urls))
         {
           const char *base_name = svn_uri_basename(common_url, pool);

Modified: subversion/branches/performance/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/log.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/log.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/log.c Thu Jan  6 19:15:40 2011
@@ -45,7 +45,7 @@
 /*** Getting misc. information ***/
 
 /* The baton for use with copyfrom_info_receiver(). */
-typedef struct
+typedef struct copyfrom_info_t
 {
   svn_boolean_t is_first;
   const char *path;
@@ -148,7 +148,7 @@ svn_client__get_copy_source(const char *
 
 /* compatibility with pre-1.5 servers, which send only author/date/log
  *revprops in log entries */
-typedef struct
+typedef struct pre_15_receiver_baton_t
 {
   svn_client_ctx_t *ctx;
   /* ra session for retrieving revprops from old servers */
@@ -244,7 +244,7 @@ pre_15_receiver(void *baton, svn_log_ent
 }
 
 /* limit receiver */
-typedef struct
+typedef struct limit_receiver_baton_t
 {
   int limit;
   svn_log_entry_receiver_t receiver;

Modified: subversion/branches/performance/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/merge.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/merge.c Thu Jan  6 19:15:40 2011
@@ -1213,7 +1213,7 @@ merge_props_changed(const char *local_di
 }
 
 /* Contains any state collected while resolving conflicts. */
-typedef struct
+typedef struct conflict_resolver_baton_t
 {
   /* The wrapped callback and baton. */
   svn_wc_conflict_resolver_func_t wrapped_func;
@@ -1759,7 +1759,7 @@ merge_file_added(const char *local_dir_a
           SVN_ERR(svn_wc_read_kind(&wc_kind, merge_b->ctx->wc_ctx,
                                    mine_abspath, FALSE, subpool));
 
-          if ((wc_kind != svn_node_none) 
+          if ((wc_kind != svn_node_none)
               && dry_run_deleted_p(merge_b, mine_abspath))
             *content_state = svn_wc_notify_state_changed;
           else
@@ -2492,7 +2492,7 @@ merge_dir_opened(const char *local_dir_a
       svn_pool_destroy(subpool);
       return SVN_NO_ERROR;
     }
-   
+
   /* Find out if this path is deleted. */
   err = svn_wc__node_is_status_deleted(&is_deleted, merge_b->ctx->wc_ctx,
                                        local_abspath, subpool);
@@ -2591,7 +2591,7 @@ merge_callbacks =
 
 
 /* Contains any state collected while receiving path notifications. */
-typedef struct
+typedef struct notification_receiver_baton_t
 {
   /* The wrapped callback and baton. */
   svn_wc_notify_func2_t wrapped_func;
@@ -3335,7 +3335,7 @@ get_invalid_inherited_mergeinfo(svn_merg
   svn_revnum_t base_revision;
   svn_boolean_t validate_inherited_mergeinfo;
 
-  /* Our starting assumptions. */ 
+  /* Our starting assumptions. */
   *invalid_inherited_mergeinfo = NULL;
   *validated = TRUE;
 
@@ -3444,12 +3444,9 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
      removing any self-referential mergeinfo. */
   if (recorded_mergeinfo)
     {
-      /* ### FIXME: There's probably an RA session we could/should be
-         ### using here instead of having this function possibly spawn
-         ### yet another one.  */
       SVN_ERR(svn_client__get_wc_or_repos_mergeinfo(recorded_mergeinfo,
                                                     &inherited, FALSE,
-                                                    inherit, NULL,
+                                                    inherit, ra_session,
                                                     target_abspath,
                                                     ctx, scratch_pool));
       if (indirect)
@@ -3546,7 +3543,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
           /* Return RA_SESSION back to where it was when we were called. */
          SVN_ERR(svn_client__ensure_ra_session_url(&session_url,
                                                    ra_session, session_url,
-                                                   scratch_pool)); 
+                                                   scratch_pool));
         }
     } /*if (implicit_mergeinfo) */
 
@@ -4321,7 +4318,7 @@ populate_remaining_ranges(apr_array_head
                  CHILDREN_WITH_MERGEINFO, see the global comment
                  'THE CHILDREN_WITH_MERGEINFO ARRAY'. */
               SVN_ERR_ASSERT(parent);
- 
+
               child_inherits_implicit = (parent && !child->switched);
               SVN_ERR(ensure_implicit_mergeinfo(parent, child,
                                                 child_inherits_implicit,
@@ -5495,7 +5492,7 @@ record_missing_subtree_roots(const char 
   if (kind == svn_node_dir)
     {
       /* If SUBTREE_DIRENTS is empty LOCAL_ABSPATH is merge target. */
-      if (apr_hash_count(subtree_dirents) == 0 
+      if (apr_hash_count(subtree_dirents) == 0
           || apr_hash_get(subtree_dirents,
                           svn_dirent_dirname(local_abspath,
                                              scratch_pool),
@@ -5525,7 +5522,7 @@ record_missing_subtree_roots(const char 
               apr_hash_set(subtree_dirents,
                            apr_pstrdup(result_pool, local_abspath),
                            APR_HASH_KEY_STRING, dirents);
-            }      
+            }
         }
     }
   else /* kind != svn_node_dir */
@@ -8256,9 +8253,9 @@ do_directory_merge(svn_mergeinfo_catalog
          NOTIFY_B->CHILDREN_WITH_MERGEINFO to find the oldest starting
          revision that actually needs to be merged (for reverse merges this is
          the youngest starting revision).
-         
+
          We'll do this twice, right now for the start of the mergeinfo we will
-         ultimately record to describe this merge and then later for the 
+         ultimately record to describe this merge and then later for the
          start of the actual editor drive. */
       new_range_start = get_most_inclusive_start_rev(
         notify_b->children_with_mergeinfo, is_rollback);
@@ -8934,7 +8931,7 @@ merge_cousins_and_supplement_mergeinfo(c
      calculated.  (We know that each tong in our fork of our merge
      source history tree has an ancestral relationship with the common
      ancestral, so we force ancestral=TRUE here.)
-     
+
      Issue #3648: We don't actually perform these two record-only merges
      on the WC at first, but rather see what each would do and store that
      in two mergeinfo catalogs.  We then merge the catalogs together and
@@ -10256,7 +10253,7 @@ calculate_left_hand_side(const char **ur
 
       youngest_rev.kind = svn_opt_revision_number;
       youngest_rev.value.number = youngest_merged_rev;
-      
+
       unspecified_rev.kind = svn_opt_revision_unspecified;
 
       *rev_left = youngest_rev.value.number;
@@ -10634,7 +10631,7 @@ merge_peg_locked(const char *source,
   svn_node_kind_t target_kind;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(target_abspath));
-  
+
   /* Make sure the target is really there. */
   SVN_ERR(svn_io_check_path(target_abspath, &target_kind, scratch_pool));
   if (target_kind == svn_node_none)

Modified: subversion/branches/performance/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/mergeinfo.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/performance/subversion/libsvn_client/mergeinfo.h Thu Jan  6 19:15:40 2011
@@ -207,9 +207,10 @@ svn_client__get_repos_mergeinfo_catalog(
    target has no info of its own.
 
    If no mergeinfo can be obtained from the WC or REPOS_ONLY is TRUE,
-   get it from the repository.  RA_SESSION should be an open RA
-   session pointing at TARGET_WCPATH's URL, or NULL, in which case this
-   function will open its own temporary session.
+   get it from the repository.  If the repository is contacted for mergeinfo
+   and RA_SESSION does not point to TARGET_WCPATH's URL, then it is
+   temporarily reparented.  If RA_SESSION is NULL, then a temporary session
+   is opened as needed.
 
    Store any mergeinfo obtained for TARGET_WCPATH in
    *TARGET_MERGEINFO, if no mergeinfo is found *TARGET_MERGEINFO is

Modified: subversion/branches/performance/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/patch.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/patch.c Thu Jan  6 19:15:40 2011
@@ -124,7 +124,7 @@ typedef struct prop_patch_target_t {
   const char *patched_path;
 
   /* Represents the operation performed on the property. It can be added,
-   * deleted or modified. 
+   * deleted or modified.
    * ### Should we use flags instead since we're not using all enum values? */
   svn_diff_operation_kind_t operation;
 
@@ -476,7 +476,7 @@ init_prop_target(prop_patch_target_t **p
                  apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 {
   prop_patch_target_t *new_prop_target;
-  target_content_info_t *content_info; 
+  target_content_info_t *content_info;
   const svn_string_t *value;
   const char *patched_path;
   svn_error_t *err;
@@ -498,7 +498,7 @@ init_prop_target(prop_patch_target_t **p
   new_prop_target->operation = operation;
   new_prop_target->content_info = content_info;
 
-  err = svn_wc_prop_get2(&value, wc_ctx, local_abspath, prop_name, 
+  err = svn_wc_prop_get2(&value, wc_ctx, local_abspath, prop_name,
                          result_pool, scratch_pool);
   if (err)
     {
@@ -579,7 +579,7 @@ init_patch_target(patch_target_t **patch
                   apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 {
   patch_target_t *target;
-  target_content_info_t *content_info; 
+  target_content_info_t *content_info;
   svn_boolean_t has_prop_changes = FALSE;
   svn_boolean_t prop_changes_only = FALSE;
 
@@ -590,7 +590,7 @@ init_patch_target(patch_target_t **patch
          hi;
          hi = apr_hash_next(hi))
       {
-        svn_prop_patch_t *prop_patch = svn__apr_hash_index_val(hi); 
+        svn_prop_patch_t *prop_patch = svn__apr_hash_index_val(hi);
         if (! has_prop_changes)
           has_prop_changes = prop_patch->hunks->nelts > 0;
         else
@@ -661,7 +661,7 @@ init_patch_target(patch_target_t **patch
        * ### the target supposed to be marked with an operation after we have
        * ### determined that the changes will apply cleanly to the WC? Maybe
        * ### we should have kept the patch field in patch_target_t to be
-       * ### able to distinguish between 'what the patch says we should do' 
+       * ### able to distinguish between 'what the patch says we should do'
        * ### and 'what we can do with the given state of our WC'. */
       if (patch->operation == svn_diff_op_added)
         target->added = TRUE;
@@ -677,7 +677,7 @@ init_patch_target(patch_target_t **patch
 
       /* We always expand keywords in the patched file, but repair newlines
        * only if svn:eol-style dictates a particular style. */
-      repair_eol = (content_info->eol_style == svn_subst_eol_style_fixed 
+      repair_eol = (content_info->eol_style == svn_subst_eol_style_fixed
                     || content_info->eol_style == svn_subst_eol_style_native);
       content_info->patched = svn_subst_stream_translated(
                               patched_raw, content_info->eol_str, repair_eol,
@@ -828,7 +828,7 @@ seek_to_line(target_content_info_t *cont
  * CONTENT_INFO at its current line. Lines within FUZZ lines of the start or
  * end of HUNK will always match. If IGNORE_WHITESPACE is set, we ignore
  * whitespace when doing the matching. When this function returns, neither
- * CONTENT_INFO->CURRENT_LINE nor the file offset in the target file will 
+ * CONTENT_INFO->CURRENT_LINE nor the file offset in the target file will
  * have changed. If MATCH_MODIFIED is TRUE, match the modified hunk text,
  * rather than the original hunk text.
  * Do temporary allocations in POOL. */
@@ -948,10 +948,10 @@ match_hunk(svn_boolean_t *matched, targe
  * Call cancel CANCEL_FUNC with baton CANCEL_BATON to trigger cancellation.
  * Do all allocations in POOL. */
 static svn_error_t *
-scan_for_match(svn_linenum_t *matched_line, 
+scan_for_match(svn_linenum_t *matched_line,
                target_content_info_t *content_info,
                const svn_diff_hunk_t *hunk, svn_boolean_t match_first,
-               svn_linenum_t upper_line, int fuzz, 
+               svn_linenum_t upper_line, int fuzz,
                svn_boolean_t ignore_whitespace,
                svn_boolean_t match_modified,
                svn_cancel_func_t cancel_func, void *cancel_baton,
@@ -1050,7 +1050,7 @@ match_existing_target(svn_boolean_t *mat
                                                    iterpool, iterpool));
       /* Contract keywords. */
       SVN_ERR(svn_subst_translate_cstring2(line->data, &line_translated,
-                                           NULL, FALSE, 
+                                           NULL, FALSE,
                                            content_info->keywords,
                                            FALSE, iterpool));
       SVN_ERR(svn_subst_translate_cstring2(hunk_line->data,
@@ -1139,7 +1139,7 @@ get_hunk_info(hunk_info_t **hi, patch_ta
       else
         matched_line = 1;
     }
-  /* Same conditions apply as for the file case above. 
+  /* Same conditions apply as for the file case above.
    *
    * ### Since the hunk says the prop should be added we just assume so for
    * ### now and don't bother with storing the previous lines and such. When
@@ -1276,7 +1276,7 @@ copy_lines_to_target(target_content_info
   apr_pool_t *iterpool;
 
   iterpool = svn_pool_create(pool);
-  while ((content_info->current_line < line || line == 0) 
+  while ((content_info->current_line < line || line == 0)
          && ! content_info->eof)
     {
       const char *target_line;
@@ -1300,7 +1300,7 @@ copy_lines_to_target(target_content_info
  * and mark TARGET as having had rejects.
  * Do temporary allocations in POOL. */
 static svn_error_t *
-reject_hunk(patch_target_t *target, target_content_info_t *content_info, 
+reject_hunk(patch_target_t *target, target_content_info_t *content_info,
             const svn_diff_hunk_t *hunk, const char *prop_name,
             apr_pool_t *pool)
 {
@@ -1312,7 +1312,7 @@ reject_hunk(patch_target_t *target, targ
   if (prop_name)
     {
       const char *prop_header;
-        
+
       /* ### Print 'Added', 'Deleted' or 'Modified' instead of 'Property'.
        */
       prop_header = apr_psprintf(pool, "Property: %s\n", prop_name);
@@ -1382,7 +1382,7 @@ reject_hunk(patch_target_t *target, targ
  * a property with the given name.
  * Do temporary allocations in POOL. */
 static svn_error_t *
-apply_hunk(patch_target_t *target, target_content_info_t *content_info,  
+apply_hunk(patch_target_t *target, target_content_info_t *content_info,
            hunk_info_t *hi, const char *prop_name, apr_pool_t *pool)
 {
   svn_linenum_t lines_read;
@@ -1472,9 +1472,9 @@ apply_hunk(patch_target_t *target, targe
  * PROP_NAME must be the name of the property, else NULL.
  * Use POOL for temporary allocations. */
 static svn_error_t *
-send_hunk_notification(const hunk_info_t *hi, 
-                       const patch_target_t *target, 
-                       const char *prop_name, 
+send_hunk_notification(const hunk_info_t *hi,
+                       const patch_target_t *target,
+                       const char *prop_name,
                        const svn_client_ctx_t *ctx,
                        apr_pool_t *pool)
 {
@@ -1578,7 +1578,7 @@ send_patch_notification(const patch_targ
 
           hi = APR_ARRAY_IDX(target->content_info->hunks, i, hunk_info_t *);
 
-          SVN_ERR(send_hunk_notification(hi, target, NULL /* prop_name */, 
+          SVN_ERR(send_hunk_notification(hi, target, NULL /* prop_name */,
                                          ctx, iterpool));
         }
 
@@ -1586,8 +1586,8 @@ send_patch_notification(const patch_targ
            hash_index;
            hash_index = apr_hash_next(hash_index))
         {
-          prop_patch_target_t *prop_target; 
-          
+          prop_patch_target_t *prop_target;
+
           prop_target = svn__apr_hash_index_val(hash_index);
 
           for (i = 0; i < prop_target->content_info->hunks->nelts; i++)
@@ -1602,7 +1602,7 @@ send_patch_notification(const patch_targ
               /* Don't notify on the hunk level for added or deleted props. */
               if (prop_target->operation != svn_diff_op_added &&
                   prop_target->operation != svn_diff_op_deleted)
-                SVN_ERR(send_hunk_notification(hi, target, prop_target->name, 
+                SVN_ERR(send_hunk_notification(hi, target, prop_target->name,
                                                ctx, iterpool));
             }
         }
@@ -1706,7 +1706,7 @@ apply_one_patch(patch_target_t **patch_t
         continue;
       else if (hi->rejected)
         SVN_ERR(reject_hunk(target, target->content_info, hi->hunk,
-                            NULL /* prop_name */, 
+                            NULL /* prop_name */,
                             iterpool));
       else
         SVN_ERR(apply_hunk(target, target->content_info, hi,
@@ -1735,7 +1735,7 @@ apply_one_patch(patch_target_t **patch_t
       svn_prop_patch_t *prop_patch;
       const char *prop_name;
       prop_patch_target_t *prop_target;
-        
+
       prop_name = svn__apr_hash_index_key(hash_index);
       prop_patch = svn__apr_hash_index_val(hash_index);
 
@@ -1743,7 +1743,7 @@ apply_one_patch(patch_target_t **patch_t
         target->is_special = TRUE;
 
       /* We'll store matched hunks in prop_content_info. */
-      prop_target = apr_hash_get(target->prop_targets, prop_name, 
+      prop_target = apr_hash_get(target->prop_targets, prop_name,
                                  APR_HASH_KEY_STRING);
 
       for (i = 0; i < prop_patch->hunks->nelts; i++)
@@ -1763,7 +1763,7 @@ apply_one_patch(patch_target_t **patch_t
            * If no match is found initially, try with fuzz. */
           do
             {
-              SVN_ERR(get_hunk_info(&hi, target, prop_target->content_info, 
+              SVN_ERR(get_hunk_info(&hi, target, prop_target->content_info,
                                     hunk, fuzz,
                                     ignore_whitespace,
                                     TRUE /* is_prop_hunk */,
@@ -1792,7 +1792,7 @@ apply_one_patch(patch_target_t **patch_t
 
           svn_pool_clear(iterpool);
 
-          hi = APR_ARRAY_IDX(prop_target->content_info->hunks, i, 
+          hi = APR_ARRAY_IDX(prop_target->content_info->hunks, i,
                              hunk_info_t *);
           if (hi->already_applied)
             continue;
@@ -1801,7 +1801,7 @@ apply_one_patch(patch_target_t **patch_t
                                 prop_target->name,
                                 iterpool));
           else
-            SVN_ERR(apply_hunk(target, prop_target->content_info, hi, 
+            SVN_ERR(apply_hunk(target, prop_target->content_info, hi,
                                prop_target->name,
                                iterpool));
         }
@@ -1810,7 +1810,7 @@ apply_one_patch(patch_target_t **patch_t
           {
             /* Copy any remaining lines to target. */
             SVN_ERR(copy_lines_to_target(prop_target->content_info, 0,
-                                         prop_target->patched_path, 
+                                         prop_target->patched_path,
                                          scratch_pool));
             if (! prop_target->content_info->eof)
               {
@@ -1883,7 +1883,7 @@ apply_one_patch(patch_target_t **patch_t
            * Report this as skipped if it didn't exist, unless in the special
            * case of adding an empty file which has properties set on it or
            * adding an empty file with a 'git diff' */
-          if (target->kind_on_disk == svn_node_none 
+          if (target->kind_on_disk == svn_node_none
               && ! target->has_prop_changes
               && ! target->added)
             target->skipped = TRUE;
@@ -2093,7 +2093,7 @@ install_patched_target(patch_target_t *t
             {
               const char *parent_abspath;
               svn_boolean_t is_deleted;
-              
+
               parent_abspath = svn_dirent_dirname(target->local_abspath,
                                                   pool);
               SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, ctx->wc_ctx,
@@ -2123,11 +2123,11 @@ install_patched_target(patch_target_t *t
 
               patched_stream = svn_stream_from_aprfile2(file, FALSE /* disown */,
                                                 pool);
-              SVN_ERR(svn_subst_create_specialfile(&stream, 
+              SVN_ERR(svn_subst_create_specialfile(&stream,
                                                    target->local_abspath,
                                                    pool, pool));
-              SVN_ERR(svn_stream_copy3(patched_stream, stream, 
-                                       NULL, /* cancel_func */ 
+              SVN_ERR(svn_stream_copy3(patched_stream, stream,
+                                       NULL, /* cancel_func */
                                        NULL, /* cancel_baton */
                                        pool));
             }
@@ -2160,7 +2160,7 @@ install_patched_target(patch_target_t *t
 }
 
 /* Write out rejected hunks, if any, to TARGET->REJECT_PATH. If DRY_RUN is
- * TRUE, don't modify the working copy.  
+ * TRUE, don't modify the working copy.
  * Do temporary allocations in POOL.
  */
 static svn_error_t *
@@ -2199,7 +2199,7 @@ install_patched_prop_targets(patch_targe
        hi;
        hi = apr_hash_next(hi))
     {
-      prop_patch_target_t *prop_target = svn__apr_hash_index_val(hi); 
+      prop_patch_target_t *prop_target = svn__apr_hash_index_val(hi);
       apr_file_t *file;
       svn_stream_t *patched_stream;
       svn_stringbuf_t *line;
@@ -2216,7 +2216,7 @@ install_patched_prop_targets(patch_targe
         {
           if (! dry_run)
             SVN_ERR(svn_wc_prop_set4(ctx->wc_ctx, target->local_abspath,
-                                     prop_target->name, NULL, 
+                                     prop_target->name, NULL,
                                      TRUE /* skip_checks */,
                                      NULL, NULL, /* suppress notification */
                                      iterpool));
@@ -2259,7 +2259,7 @@ install_patched_prop_targets(patch_targe
        *
        * ### How can we tell whether the patch really wanted to create
        * ### an empty directory? */
-      if (! target->has_text_changes 
+      if (! target->has_text_changes
           && target->kind_on_disk == svn_node_none
           && ! target->added)
         {
@@ -2358,7 +2358,7 @@ find_existing_children(void *baton,
       && status->node_status != svn_wc_status_deleted
       && strcmp(abspath, btn->parent_path))
     {
-      APR_ARRAY_PUSH(btn->existing_targets, 
+      APR_ARRAY_PUSH(btn->existing_targets,
                      const char *) = apr_pstrdup(btn->result_pool,
                                                  abspath);
     }
@@ -2373,7 +2373,7 @@ find_existing_children(void *baton,
  * Do temporary allocations in SCRATCH_POOL. */
 static svn_error_t *
 check_dir_empty(svn_boolean_t *empty, const char *local_abspath,
-                svn_wc_context_t *wc_ctx, 
+                svn_wc_context_t *wc_ctx,
                 apr_array_header_t *deleted_targets,
                 apr_array_header_t *deleted_abspath_list,
                 apr_pool_t *scratch_pool)
@@ -2392,7 +2392,7 @@ check_dir_empty(svn_boolean_t *empty, co
     }
 
   /* Find existing children of the directory. */
-  btn.existing_targets = apr_array_make(scratch_pool, 0, 
+  btn.existing_targets = apr_array_make(scratch_pool, 0,
                                         sizeof(patch_target_t *));
   btn.parent_path = local_abspath;
   btn.result_pool = scratch_pool;
@@ -2603,7 +2603,7 @@ delete_empty_dirs(apr_array_header_t *ta
 }
 
 /* Baton for apply_patches(). */
-typedef struct {
+typedef struct apply_patches_baton_t {
   /* The path to the patch file. */
   const char *patch_abspath;
 
@@ -2690,15 +2690,15 @@ apply_patches(void *baton,
 
               if (! target->skipped)
                 {
-                  if (target->has_text_changes 
-                      || target->added 
+                  if (target->has_text_changes
+                      || target->added
                       || target->deleted)
                     SVN_ERR(install_patched_target(target, btn->abs_wc_path,
                                                    btn->ctx, btn->dry_run,
                                                    iterpool));
 
                   if (target->has_prop_changes)
-                    SVN_ERR(install_patched_prop_targets(target, btn->ctx, 
+                    SVN_ERR(install_patched_prop_targets(target, btn->ctx,
                                                          btn->dry_run,
                                                          iterpool));
 

Modified: subversion/branches/performance/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/prop_commands.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/prop_commands.c Thu Jan  6 19:15:40 2011
@@ -492,7 +492,7 @@ check_and_set_revprop(svn_revnum_t *set_
         }
     }
 
-  SVN_ERR(svn_ra_change_rev_prop2(ra_session, *set_rev, propname, 
+  SVN_ERR(svn_ra_change_rev_prop2(ra_session, *set_rev, propname,
                                   NULL, propval, pool));
 
   return SVN_NO_ERROR;
@@ -550,7 +550,7 @@ svn_client_revprop_set2(const char *prop
       	old_value_p = &original_propval;
 
       /* The actual RA call. */
-      SVN_ERR(svn_ra_change_rev_prop2(ra_session, *set_rev, propname, 
+      SVN_ERR(svn_ra_change_rev_prop2(ra_session, *set_rev, propname,
                                       old_value_p, propval, pool));
     }
   else

Modified: subversion/branches/performance/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/ra.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/ra.c Thu Jan  6 19:15:40 2011
@@ -44,7 +44,7 @@
 
 /* This is the baton that we pass svn_ra_open3(), and is associated with
    the callback table we provide to RA. */
-typedef struct
+typedef struct callback_baton_t
 {
   /* Holds the directory that corresponds to the REPOS_URL at svn_ra_open3()
      time. When callbacks specify a relative path, they are joined with
@@ -364,8 +364,8 @@ svn_client__open_ra_session_internal(svn
           /* Notify the user that a redirect is being followed. */
           if (ctx->notify_func2 != NULL)
             {
-              svn_wc_notify_t *notify = 
-                svn_wc_create_notify_url(corrected, 
+              svn_wc_notify_t *notify =
+                svn_wc_create_notify_url(corrected,
                                          svn_wc_notify_url_redirect, pool);
               (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
             }

Modified: subversion/branches/performance/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/relocate.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/relocate.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/relocate.c Thu Jan  6 19:15:40 2011
@@ -157,7 +157,7 @@ relocate_externals(const char *local_abs
         APR_ARRAY_IDX(ext_desc, i, svn_wc_external_item2_t *);
       const char *target_repos_root_url;
       const char *target_abspath;
-      
+
       svn_pool_clear(iterpool);
 
       /* If this external isn't pulled in via a relative URL, ignore
@@ -270,7 +270,7 @@ svn_client_relocate2(const char *wcroot_
         SVN_ERR(relocate_externals(this_abspath, ext_desc, old_repos_root_url,
                                    new_repos_root_url, ctx, iterpool));
     }
-    
+
   svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;

Modified: subversion/branches/performance/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/repos_diff.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/repos_diff.c Thu Jan  6 19:15:40 2011
@@ -39,6 +39,7 @@
 #include "svn_path.h"
 #include "svn_io.h"
 #include "svn_props.h"
+#include "svn_private_config.h"
 
 #include "client.h"
 
@@ -375,7 +376,7 @@ get_dir_abspath(const char **local_dir_a
         *local_dir_abspath = local_abspath;
       else if (!lenient)
         return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
-                                 "'%s' is not a versioned directory",
+                                 _("'%s' is not a versioned directory"),
                                  svn_dirent_local_style(local_abspath, pool));
     }
 
@@ -489,7 +490,7 @@ diff_deleted_dir(const char *dir,
                           revision,
                           SVN_DIRENT_KIND,
                           pool));
-  
+
   for (hi = apr_hash_first(pool, dirents); hi;
        hi = apr_hash_next(hi))
     {
@@ -511,7 +512,7 @@ diff_deleted_dir(const char *dir,
           SVN_ERR(get_file_from_ra(b, revision));
 
           SVN_ERR(get_empty_file(b->edit_baton, &(b->path_end_revision)));
-      
+
           get_file_mime_types(&mimetype1, &mimetype2, b);
 
           SVN_ERR(eb->diff_callbacks->file_deleted(
@@ -523,7 +524,7 @@ diff_deleted_dir(const char *dir,
                                 b->edit_baton->diff_cmd_baton,
                                 iterpool));
         }
- 
+
       if (dirent->kind == svn_node_dir)
         SVN_ERR(diff_deleted_dir(path,
                                  revision,
@@ -595,7 +596,7 @@ delete_entry(const char *path,
                     (local_dir_abspath, &state, &tree_conflicted,
                      svn_dirent_join(eb->target, path, pool),
                      eb->diff_cmd_baton, pool));
- 
+
             if (eb->walk_deleted_repos_dirs)
               {
                 /* A workaround for issue 2333.  The "old" dir will be

Modified: subversion/branches/performance/subversion/libsvn_client/repos_diff_summarize.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/repos_diff_summarize.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/repos_diff_summarize.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/repos_diff_summarize.c Thu Jan  6 19:15:40 2011
@@ -176,7 +176,7 @@ diff_deleted_dir(const char *dir,
                           revision,
                           SVN_DIRENT_KIND,
                           pool));
-  
+
   for (hi = apr_hash_first(pool, dirents); hi;
        hi = apr_hash_next(hi))
     {

Modified: subversion/branches/performance/subversion/libsvn_client/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/revert.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/revert.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/revert.c Thu Jan  6 19:15:40 2011
@@ -133,7 +133,7 @@ svn_client_revert2(const apr_array_heade
         return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
                                  _("'%s' is not a local path"), path);
     }
-  
+
   cfg = ctx->config ? apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
                                    APR_HASH_KEY_STRING) : NULL;
 

Modified: subversion/branches/performance/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_client/update.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_client/update.c (original)
+++ subversion/branches/performance/subversion/libsvn_client/update.c Thu Jan  6 19:15:40 2011
@@ -307,7 +307,7 @@ svn_client__update_internal(svn_revnum_t
     {
       int i;
       const char *parent_abspath = local_abspath;
-      apr_array_header_t *missing_parents = 
+      apr_array_header_t *missing_parents =
         apr_array_make(pool, 4, sizeof(const char *));
 
       while (1)

Modified: subversion/branches/performance/subversion/libsvn_delta/compose_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_delta/compose_delta.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_delta/compose_delta.c (original)
+++ subversion/branches/performance/subversion/libsvn_delta/compose_delta.c Thu Jan  6 19:15:40 2011
@@ -160,7 +160,7 @@ create_offset_index(const svn_txdelta_wi
 }
 
 /* Find the index of the delta op thet defines that data at OFFSET in
-   NDX. HINT is an arbitrary positin within NDX and doesn't even need 
+   NDX. HINT is an arbitrary positin within NDX and doesn't even need
    to be valid. To effectively speed up the search, use the last result
    as hint because most lookups come as a sequence of decreasing values
    for OFFSET and they concentrate on the lower end of the array. */
@@ -198,7 +198,7 @@ search_offset_index(const offset_index_t
     {
       if (offset < ndx->offs[op])
         hi = op;
-      else 
+      else
         lo = ++op;
     }
 
@@ -630,12 +630,12 @@ build_range_list(apr_size_t offset, apr_
 /* Copy the instructions from WINDOW that define the range [OFFSET,
    LIMIT) in WINDOW's target stream to TARGET_OFFSET in the window
    represented by BUILD_BATON. HINT is a position in the instructions
-   array that helps finding the position for OFFSET. A safe default 
-   is 0. Use NDX to find the instructions in WINDOW. Allocate space 
+   array that helps finding the position for OFFSET. A safe default
+   is 0. Use NDX to find the instructions in WINDOW. Allocate space
    in BUILD_BATON from POOL. */
 
 static void
-copy_source_ops(apr_size_t offset, apr_size_t limit,  
+copy_source_ops(apr_size_t offset, apr_size_t limit,
                 apr_size_t target_offset,
                 apr_size_t hint,
                 svn_txdelta__ops_baton_t *build_baton,

Modified: subversion/branches/performance/subversion/libsvn_delta/text_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_delta/text_delta.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/branches/performance/subversion/libsvn_delta/text_delta.c Thu Jan  6 19:15:40 2011
@@ -633,11 +633,9 @@ patterning_copy(char *target, const char
 {
   const char *end = source + len;
 
-  /* On the majority of machines (x86 / x64), unaligned access is much
-   * cheaper than repeated aligned access.  Therefore, use chunky copies on
-   * these machines when feasible.
-   * For those machines, GCC, ICC and MSC will define one of the following: */
-#if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
+  /* On many machines, we can do "chunky" copies. */
+
+#if SVN_UNALIGNED_ACCESS_IS_OK
 
   if (end + sizeof(apr_uint32_t) <= target)
     {

Modified: subversion/branches/performance/subversion/libsvn_delta/xdelta.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_delta/xdelta.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_delta/xdelta.c (original)
+++ subversion/branches/performance/subversion/libsvn_delta/xdelta.c Thu Jan  6 19:15:40 2011
@@ -29,6 +29,8 @@
 
 #include "svn_delta.h"
 #include "delta.h"
+
+#include "private/svn_adler32.h"
 
 /* This is pseudo-adler32. It is adler32 without the prime modulus.
    The idea is borrowed from monotone, and is a translation of the C++
@@ -36,66 +38,57 @@
    explicit permission to use it under these terms at 8:02pm on
    Friday, February 11th, 2005.  */
 
-#define ADLER32_MASK      0x0000ffff
-#define ADLER32_CHAR_MASK 0x000000ff
-
-/* Structure to store the state of our adler32 checksum.  */
-struct adler32
-{
-  apr_uint32_t s1;
-  apr_uint32_t s2;
-  apr_uint32_t len;
-};
-
-/* Feed C into the adler32 checksum.  */
+/* Size of the blocks we compute checksums for. This was chosen out of
+   thin air.  Monotone used 64, xdelta1 used 64, rsync uses 128.
+   However, later optimizations assume it to be 256 or less.
+ */
+#define MATCH_BLOCKSIZE 64
 
-static APR_INLINE void
-adler32_in(struct adler32 *ad, const char c)
+/* Feed C_IN into the adler32 checksum and remove C_OUT at the same time.
+ * This function may (and will) only be called for characters that are
+ * MATCH_BLOCKSIZE positions apart.
+ *
+ * Please note that the lower 16 bits cannot overflow in neither direction.
+ * Therefore, we don't need to split the value into separate values for
+ * sum(char) and sum(sum(char)).
+ */
+static APR_INLINE apr_uint32_t
+adler32_replace(apr_uint32_t adler32, const char c_out, const char c_in)
 {
-  ad->s1 += ((apr_uint32_t) (c)) & ADLER32_CHAR_MASK;
-  ad->s1 &= ADLER32_MASK;
-  ad->s2 += ad->s1;
-  ad->s2 &= ADLER32_MASK;
-  ad->len++;
-}
+  adler32 -= (MATCH_BLOCKSIZE * 0x10000u * ((unsigned char) c_out));
 
-/* Remove the result of byte C from the adler32 checksum.  */
+  adler32 -= (unsigned char)c_out;
+  adler32 += (unsigned char)c_in;
 
-static APR_INLINE void
-adler32_out(struct adler32 *ad, const char c)
-{
-  ad->s1 -= ((apr_uint32_t) (c)) & ADLER32_CHAR_MASK;
-  ad->s1 &= ADLER32_MASK;
-  ad->s2 -= (ad->len * (((apr_uint32_t) c) & ADLER32_CHAR_MASK)) + 1;
-  ad->s2 &= ADLER32_MASK;
-  --ad->len;
+  return adler32 + adler32 * 0x10000;
 }
 
-/* Return the current adler32 checksum in the adler32 structure.  */
+/* Calculate an peudo-adler32 checksum for MATCH_BLOCKSIZE bytes starting
+   at DATA.  Return the checksum value.  */
 
 static APR_INLINE apr_uint32_t
-adler32_sum(const struct adler32 *ad)
+init_adler32(const char *data)
 {
-  return (ad->s2 << 16) | (ad->s1);
-}
+  const unsigned char *input = (const unsigned char *)data;
+  const unsigned char *last = input + MATCH_BLOCKSIZE;
 
-/* Initialize an adler32 checksum structure with DATA, which has length
-   DATALEN.  Return the initialized structure.  */
+  apr_uint32_t s1 = 0;
+  apr_uint32_t s2 = 0;
 
-static APR_INLINE struct adler32 *
-init_adler32(struct adler32 *ad, const char *data, apr_uint32_t datalen)
-{
-  ad->s1 = 1;
-  ad->s2 = 0;
-  ad->len = 0;
-  while (datalen--)
-    adler32_in(ad, *(data++));
-  return ad;
-}
+  for (; input < last; input += 8)
+    {
+      s1 += input[0]; s2 += s1;
+      s1 += input[1]; s2 += s1;
+      s1 += input[2]; s2 += s1;
+      s1 += input[3]; s2 += s1;
+      s1 += input[4]; s2 += s1;
+      s1 += input[5]; s2 += s1;
+      s1 += input[6]; s2 += s1;
+      s1 += input[7]; s2 += s1;
+    }
 
-/* Size of the blocks we compute checksums for. This was chosen out of
-   thin air.  Monotone used 64, xdelta1 used 64, rsync uses 128.  */
-#define MATCH_BLOCKSIZE 64
+  return s2 * 0x10000 + s1;
+}
 
 /* Information for a block of the delta source.  The length of the
    block is the smaller of MATCH_BLOCKSIZE and the difference between
@@ -111,6 +104,8 @@ struct blocks
 {
   /* The largest valid index of slots. */
   apr_size_t max;
+  /* Source buffer that the positions in SLOTS refer to. */
+  const char* data;
   /* The vector of blocks.  A pos value of (apr_size_t)-1 represents an unused
      slot. */
   struct block *slots;
@@ -127,37 +122,42 @@ static apr_size_t hash_func(apr_uint32_t
   return sum ^ (sum >> 12);
 }
 
-/* Insert a block with the checksum ADLERSUM at position POS in the source data
-   into the table BLOCKS.  Ignore duplicates. */
+/* Insert a block with the checksum ADLERSUM at position POS in the source
+   data into the table BLOCKS.  Ignore true duplicates, i.e. blocks with
+   actually the same content. */
 static void
 add_block(struct blocks *blocks, apr_uint32_t adlersum, apr_size_t pos)
 {
   apr_size_t h = hash_func(adlersum) & blocks->max;
 
   /* This will terminate, since we know that we will not fill the table. */
-  while (blocks->slots[h].pos != (apr_size_t)-1)
-    {
-      /* No duplicates! */
-      if (blocks->slots[h].adlersum == adlersum)
+  for (; blocks->slots[h].pos != (apr_size_t)-1; h = (h + 1) & blocks->max)
+    if (blocks->slots[h].adlersum == adlersum)
+      if (memcmp(blocks->data + blocks->slots[h].pos, blocks->data + pos,
+                 MATCH_BLOCKSIZE) == 0)
         return;
-      h = (h + 1) & blocks->max;
-    }
+
   blocks->slots[h].adlersum = adlersum;
   blocks->slots[h].pos = pos;
 }
 
-/* Find a block in BLOCKS with the checksum ADLERSUM, returning its position
-   in the source data.  If there is no such block, return (apr_size_t)-1. */
+/* Find a block in BLOCKS with the checksum ADLERSUM and matching the content
+   at DATA, returning its position in the source data.  If there is no such
+   block, return (apr_size_t)-1. */
 static apr_size_t
-find_block(const struct blocks *blocks, apr_uint32_t adlersum)
+find_block(const struct blocks *blocks,
+           apr_uint32_t adlersum,
+           const char* data)
 {
   apr_size_t h = hash_func(adlersum) & blocks->max;
 
-  while (blocks->slots[h].adlersum != adlersum
-         && blocks->slots[h].pos != (apr_size_t)-1)
-    h = (h + 1) & blocks->max;
+  for (; blocks->slots[h].pos != (apr_size_t)-1; h = (h + 1) & blocks->max)
+    if (blocks->slots[h].adlersum == adlersum)
+      if (memcmp(blocks->data + blocks->slots[h].pos, data,
+                 MATCH_BLOCKSIZE) == 0)
+        return blocks->slots[h].pos;
 
-  return blocks->slots[h].pos;
+  return (apr_size_t)-1;
 }
 
 /* Initialize the matches table from DATA of size DATALEN.  This goes
@@ -165,12 +165,11 @@ find_block(const struct blocks *blocks, 
    checksums it, inserting the result into the BLOCKS table.  */
 static void
 init_blocks_table(const char *data,
-                   apr_size_t datalen,
+                  apr_size_t datalen,
                   struct blocks *blocks,
-                   apr_pool_t *pool)
+                  apr_pool_t *pool)
 {
   apr_size_t i;
-  struct adler32 adler;
   apr_size_t nblocks;
   apr_size_t nslots = 1;
 
@@ -182,6 +181,7 @@ init_blocks_table(const char *data,
   /* Double the number of slots to avoid a too high load. */
   nslots *= 2;
   blocks->max = nslots - 1;
+  blocks->data = data;
   blocks->slots = apr_palloc(pool, nslots * sizeof(*(blocks->slots)));
   for (i = 0; i < nslots; ++i)
     {
@@ -190,87 +190,92 @@ init_blocks_table(const char *data,
       blocks->slots[i].pos = (apr_size_t)-1;
     }
 
-  for (i = 0; i < datalen; i += MATCH_BLOCKSIZE)
-    {
-      /* If this is the last piece, it may be blocksize large */
-      apr_uint32_t step =
-        ((i + MATCH_BLOCKSIZE) >= datalen) ? (datalen - i) : MATCH_BLOCKSIZE;
-      apr_uint32_t adlersum =
-        adler32_sum(init_adler32(&adler, data + i, step));
-      add_block(blocks, adlersum, i);
-    }
+  /* If there is an odd block at the end of the buffer, we will
+     not use that shorter block for deltification (only indirectly
+     as an extension of some previous block). */
+  for (i = 0; i + MATCH_BLOCKSIZE <= datalen; i += MATCH_BLOCKSIZE)
+    add_block(blocks, init_adler32(data + i), i);
+}
+
+/* Return the lowest position at which A and B differ. If no difference
+ * can be found in the first MAX_LEN characters, MAX_LEN will be returned.
+ */
+static apr_size_t
+match_length(const char *a, const char *b, apr_size_t max_len)
+{
+  apr_size_t pos = 0;
+
+#if SVN_UNALIGNED_ACCESS_IS_OK
+
+  /* Chunky processing is so much faster ...
+   *
+   * We can't make this work on architectures that require aligned access
+   * because A and B will probably have different alignment. So, skipping
+   * the first few chars until alignment is reached is not an option.
+   */
+  for (; pos + sizeof(apr_size_t) <= max_len; pos += sizeof(apr_size_t))
+    if (*(const apr_size_t*)(a + pos) != *(const apr_size_t*)(b + pos))
+      break;
+
+#endif
+
+  for (; pos < max_len; ++pos)
+    if (a[pos] != b[pos])
+      break;
+
+  return pos;
 }
 
 /* Try to find a match for the target data B in BLOCKS, and then
    extend the match as long as data in A and B at the match position
-   continues to match.  We set the position in a we ended up in (in
-   case we extended it backwards) in APOSP, the length of the match in
-   ALENP, and the amount to advance B in BADVANCEP.
-   *PENDING_INSERT_LENP is the length of the last insert operation that
-   has not been committed yet to the delta stream, or 0 if there is no
-   pending insert.  This is used when extending the match backwards,
-   in which case *PENDING_INSERT_LENP is adjusted, possibly
-   alleviating the need for the insert entirely.  Return TRUE if the
-   lookup found a match, regardless of length.  Return FALSE
-   otherwise.  */
-static svn_boolean_t
+   continues to match.  We set the position in A we ended up in (in
+   case we extended it backwards) in APOSP and update the correspnding
+   position within B given in BPOSP. PENDING_INSERT_START sets the
+   lower limit to BPOSP.
+   Return number of matching bytes starting at ASOP.  Return 0 if
+   no match has been found.
+ */
+static apr_size_t
 find_match(const struct blocks *blocks,
-           const struct adler32 *rolling,
+           const apr_uint32_t rolling,
            const char *a,
            apr_size_t asize,
            const char *b,
            apr_size_t bsize,
-           apr_size_t bpos,
+           apr_size_t *bposp,
            apr_size_t *aposp,
-           apr_size_t *alenp,
-           apr_size_t *badvancep,
-           apr_size_t *pending_insert_lenp)
-{
-  apr_uint32_t sum = adler32_sum(rolling);
-  apr_size_t alen, badvance, apos;
-  apr_size_t tpos, tlen;
+           apr_size_t pending_insert_start)
+{
+  apr_size_t apos, bpos = *bposp;
+  apr_size_t delta, max_delta;
 
-  tpos = find_block(blocks, sum);
+  apos = find_block(blocks, rolling, b + bpos);
 
   /* See if we have a match.  */
-  if (tpos == (apr_size_t)-1)
-    return FALSE;
-
-  tlen = ((tpos + MATCH_BLOCKSIZE) >= asize)
-    ? (asize - tpos) : MATCH_BLOCKSIZE;
+  if (apos == (apr_size_t)-1)
+    return 0;
 
-  /* Make sure it's not a false match.  */
-  if (memcmp(a + tpos, b + bpos, tlen) != 0)
-    return FALSE;
-
-  apos = tpos;
-  alen = tlen;
-  badvance = tlen;
   /* Extend the match forward as far as possible */
-  while ((apos + alen < asize)
-         && (bpos + badvance < bsize)
-         && (a[apos + alen] == b[bpos + badvance]))
+  max_delta = asize - apos - MATCH_BLOCKSIZE < bsize - bpos - MATCH_BLOCKSIZE
+            ? asize - apos - MATCH_BLOCKSIZE
+            : bsize - bpos - MATCH_BLOCKSIZE;
+  delta = match_length(a + apos + MATCH_BLOCKSIZE,
+                       b + bpos + MATCH_BLOCKSIZE,
+                       max_delta);
+
+  /* See if we can extend backwards (max MATCH_BLOCKSIZE-1 steps because A's
+     content has been sampled only every MATCH_BLOCKSIZE positions).  */
+  while (apos > 0 && bpos > pending_insert_start && a[apos-1] == b[bpos-1])
     {
-      ++alen;
-      ++badvance;
-    }
-
-  /* See if we can extend backwards into a previous insert hunk.  */
-  while (apos > 0
-         && bpos > 0
-         && a[apos - 1] == b[bpos - 1]
-         && *pending_insert_lenp > 0)
-    {
-      --(*pending_insert_lenp);
       --apos;
       --bpos;
-      ++alen;
+      ++delta;
     }
 
   *aposp = apos;
-  *alenp = alen;
-  *badvancep = badvance;
-  return TRUE;
+  *bposp = bpos;
+
+  return MATCH_BLOCKSIZE + delta;
 }
 
 
@@ -307,8 +312,8 @@ compute_delta(svn_txdelta__ops_baton_t *
               apr_pool_t *pool)
 {
   struct blocks blocks;
-  struct adler32 rolling;
-  apr_size_t sz, lo, pending_insert_start = 0, pending_insert_len = 0;
+  apr_uint32_t rolling;
+  apr_size_t lo = 0, pending_insert_start = 0;
 
   /* If the size of the target is smaller than the match blocksize, just
      insert the entire target.  */
@@ -323,52 +328,55 @@ compute_delta(svn_txdelta__ops_baton_t *
   init_blocks_table(a, asize, &blocks, pool);
 
   /* Initialize our rolling checksum.  */
-  init_adler32(&rolling, b, MATCH_BLOCKSIZE);
-  for (sz = bsize, lo = 0; lo < sz;)
+  rolling = init_adler32(b);
+  while (lo < bsize)
     {
-      apr_size_t apos = 0;
-      apr_size_t alen = 1;
-      apr_size_t badvance = 1;
-      apr_size_t next;
-      svn_boolean_t match;
+      apr_size_t matchlen = 0;
+      apr_size_t apos;
 
-      match = find_match(&blocks, &rolling, a, asize, b, bsize, lo, &apos,
-                         &alen, &badvance, &pending_insert_len);
+      if (lo + MATCH_BLOCKSIZE <= bsize)
+        matchlen = find_match(&blocks, rolling, a, asize, b, bsize,
+                              &lo, &apos, pending_insert_start);
 
       /* If we didn't find a real match, insert the byte at the target
          position into the pending insert.  */
-      if (! match)
-        ++pending_insert_len;
+      if (matchlen == 0)
+        {
+          /* move block one position forward. Short blocks at the end of
+             the buffer cannot be used as the beginning of a new match */
+          if (lo + MATCH_BLOCKSIZE < bsize)
+            rolling = adler32_replace(rolling, b[lo], b[lo+MATCH_BLOCKSIZE]);
+
+          lo++;
+        }
       else
         {
-          if (pending_insert_len > 0)
-            {
-              svn_txdelta__insert_op(build_baton, svn_txdelta_new,
-                                     0, pending_insert_len,
-                                     b + pending_insert_start, pool);
-              pending_insert_len = 0;
-            }
+          /* store the sequence of B that is between the matches */
+          if (lo - pending_insert_start > 0)
+            svn_txdelta__insert_op(build_baton, svn_txdelta_new,
+                                   0, lo - pending_insert_start,
+                                   b + pending_insert_start, pool);
+
           /* Reset the pending insert start to immediately after the
              match. */
-          pending_insert_start = lo + badvance;
+          lo += matchlen;
+          pending_insert_start = lo;
           svn_txdelta__insert_op(build_baton, svn_txdelta_source,
-                                 apos, alen, NULL, pool);
-        }
-      next = lo;
-      for (; next < lo + badvance; ++next)
-        {
-          adler32_out(&rolling, b[next]);
-          if (next + MATCH_BLOCKSIZE < bsize)
-            adler32_in(&rolling, b[next + MATCH_BLOCKSIZE]);
+                                 apos, matchlen, NULL, pool);
+
+          /* Calculate the Adler32 sum for the first block behind the match.
+           * Ignore short buffers at the end of B.
+           */
+          if (lo + MATCH_BLOCKSIZE <= bsize)
+            rolling = init_adler32(b + lo);
         }
-      lo = next;
     }
 
   /* If we still have an insert pending at the end, throw it in.  */
-  if (pending_insert_len > 0)
+  if (lo - pending_insert_start > 0)
     {
       svn_txdelta__insert_op(build_baton, svn_txdelta_new,
-                             0, pending_insert_len,
+                             0, lo - pending_insert_start,
                              b + pending_insert_start, pool);
     }
 }

Modified: subversion/branches/performance/subversion/libsvn_diff/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_diff/diff.h?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_diff/diff.h (original)
+++ subversion/branches/performance/subversion/libsvn_diff/diff.h Thu Jan  6 19:15:40 2011
@@ -128,14 +128,6 @@ svn_diff__resolve_conflict(svn_diff_t *h
                            apr_pool_t *pool);
 
 
-/*
- * Return an adler32 checksum based on CHECKSUM, updated with
- * DATA of size LEN.
- */
-apr_uint32_t
-svn_diff__adler32(apr_uint32_t checksum, const char *data, apr_off_t len);
-
-
 /* Normalize the characters pointed to by the buffer BUF (of length *LENGTHP)
  * according to the options *OPTS, starting in the state *STATEP.
  *

Modified: subversion/branches/performance/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_diff/diff_file.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/performance/subversion/libsvn_diff/diff_file.c Thu Jan  6 19:15:40 2011
@@ -46,6 +46,7 @@
 
 #include "private/svn_utf_private.h"
 #include "private/svn_eol_private.h"
+#include "private/svn_adler32.h"
 
 /* A token, i.e. a line read from a file. */
 typedef struct svn_diff__file_token_t
@@ -331,7 +332,7 @@ datasource_get_next_token(apr_uint32_t *
                                  &file->normalize_state,
                                  curp, file_baton->options);
       file_token->length += length;
-      h = svn_diff__adler32(h, curp, length);
+      h = svn__adler32(h, curp, length);
 
       curp = endp = file->buffer;
       file->chunk++;
@@ -378,7 +379,7 @@ datasource_get_next_token(apr_uint32_t *
 
       file_token->length += length;
 
-      *hash = svn_diff__adler32(h, c, length);
+      *hash = svn__adler32(h, c, length);
       *token = file_token;
     }
 
@@ -1290,7 +1291,7 @@ svn_diff_file_output_unified3(svn_stream
 /* A stream to remember *leading* context.  Note that this stream does
    *not* copy the data that it is remembering; it just saves
    *pointers! */
-typedef struct {
+typedef struct context_saver_t {
   svn_stream_t *stream;
   const char *data[SVN_DIFF__UNIFIED_CONTEXT_SIZE];
   apr_size_t len[SVN_DIFF__UNIFIED_CONTEXT_SIZE];

Modified: subversion/branches/performance/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_diff/diff_memory.c?rev=1056015&r1=1056014&r2=1056015&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/branches/performance/subversion/libsvn_diff/diff_memory.c Thu Jan  6 19:15:40 2011
@@ -34,6 +34,7 @@
 #include "svn_utf.h"
 #include "diff.h"
 #include "svn_private_config.h"
+#include "private/svn_adler32.h"
 
 typedef struct source_tokens_t
 {
@@ -128,7 +129,7 @@ datasource_get_next_token(apr_uint32_t *
 
       svn_diff__normalize_buffer(&buf, &len, &state, tok->data,
                                  mem_baton->normalization_options);
-      *hash = svn_diff__adler32(0, buf, len);
+      *hash = svn__adler32(0, buf, len);
       src->next_token++;
     }
   else
@@ -644,7 +645,7 @@ svn_diff_mem_string_output_unified(svn_s
 /* A stream to remember *leading* context.  Note that this stream does
    *not* copy the data that it is remembering; it just saves
    *pointers! */
-typedef struct {
+typedef struct context_saver_t {
   svn_stream_t *stream;
   const char *data[SVN_DIFF__UNIFIED_CONTEXT_SIZE];
   apr_size_t len[SVN_DIFF__UNIFIED_CONTEXT_SIZE];