subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1547044 [1/2] - in /subversion/branches/fsfs-ucsnorm: ./ subversion/include/ subversion/include/private/ subversion/libsvn_fs/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_util/ subversion/libsvn_fs_x/ subversio...
Date Mon, 02 Dec 2013 14:55:10 GMT
Author: brane
Date: Mon Dec  2 14:55:09 2013
New Revision: 1547044

URL: http://svn.apache.org/r1547044
Log:
On the fsfs-ucsnorm branch: Synced with trunk@1547043.

Added:
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/checksum.h
      - copied unchanged from r1547043, subversion/trunk/subversion/libsvn_subr/checksum.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/fnv1a.c
      - copied unchanged from r1547043, subversion/trunk/subversion/libsvn_subr/fnv1a.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/fnv1a.h
      - copied unchanged from r1547043, subversion/trunk/subversion/libsvn_subr/fnv1a.h
Removed:
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/md5.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sha1.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sha1.h
Modified:
    subversion/branches/fsfs-ucsnorm/   (props changed)
    subversion/branches/fsfs-ucsnorm/build.conf
    subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_fs_util.h
    subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_io_private.h
    subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_subr_private.h
    subversion/branches/fsfs-ucsnorm/subversion/include/svn_checksum.h
    subversion/branches/fsfs-ucsnorm/subversion/include/svn_repos.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs/fs-loader.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/recovery.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/revprops.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_util/fs-util.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/cached_data.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs_x.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/checksum.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_file.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_impl.h
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_win.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/md5.c
    subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c
    subversion/branches/fsfs-ucsnorm/subversion/svnadmin/svnadmin.c
    subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py
    subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py
    subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py
    subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c
    subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/checksum-test.c
    subversion/branches/fsfs-ucsnorm/subversion/tests/svn_test_fs.c
    subversion/branches/fsfs-ucsnorm/subversion/tests/svn_test_main.c
    subversion/branches/fsfs-ucsnorm/tools/client-side/bash_completion

Propchange: subversion/branches/fsfs-ucsnorm/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1546599-1547043
  Merged /subversion/branches/log-addressing:r1511324,1511346,1511363-1511364,1515049,1515088,1516315,1516322,1516665,1532410,1533539,1533543,1533816,1533819,1535668,1545968

Modified: subversion/branches/fsfs-ucsnorm/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/build.conf?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/build.conf (original)
+++ subversion/branches/fsfs-ucsnorm/build.conf Mon Dec  2 14:55:09 2013
@@ -837,7 +837,7 @@ path = subversion/tests/libsvn_fs
 sources = fs-test.c
 install = test
 libs = libsvn_test libsvn_fs libsvn_delta
-       libsvn_subr aprutil apriconv apr
+       libsvn_fs_util libsvn_subr aprutil apriconv apr
 
 # ----------------------------------------------------------------------------
 # Tests for libsvn_repos

Modified: subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_fs_util.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_fs_util.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_fs_util.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_fs_util.h Mon Dec  2 14:55:09 2013
@@ -210,6 +210,17 @@ svn_fs__append_to_merged_froms(svn_merge
                                const char *rel_path,
                                apr_pool_t *pool);
 
+/* Given the FS creation options in CONFIG, return the oldest version that
+   we shall be compatible with in *COMPATIBLE_VERSION.  The patch level
+   is always set to 0 and the tag to "".   Allocate the result in POOL.
+
+   Note that the result will always be compatible to the current tool
+   version, i.e. will be a version number not more recent than this tool. */
+svn_error_t *
+svn_fs__compatible_version(svn_version_t **compatible_version,
+                           apr_hash_t *config,
+                           apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_io_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_io_private.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_io_private.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_io_private.h Mon Dec  2 14:55:09 2013
@@ -44,6 +44,15 @@ extern "C" {
 #define SVN__APR_FINFO_MASK_OUT (0)
 #endif
 
+/* 90% of the lines we encounter will be less than this many chars.
+ *
+ * Line-based functions like svn_stream_readline should fetch data in
+ * blocks no longer than this.  Although using a larger prefetch size is
+ * not illegal and must not break any functionality, it may be
+ * significantly less efficient in certain situations.
+ */
+#define SVN__LINE_CHUNK_SIZE 80
+
 
 /** Set @a *executable TRUE if @a file_info is executable for the
  * user, FALSE otherwise.

Modified: subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_subr_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_subr_private.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_subr_private.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/include/private/svn_subr_private.h Mon Dec  2 14:55:09 2013
@@ -221,6 +221,13 @@ svn_stream__from_spillbuf(svn_spillbuf_t
 
 /** @} */
 
+/*----------------------------------------------------*/
+
+/**
+ * @defgroup svn_checksum_private Checksumming helper APIs
+ * @{
+ */
+
 /**
  * Internal function for creating a MD5 checksum from a binary digest.
  *
@@ -240,6 +247,51 @@ svn_checksum_t *
 svn_checksum__from_digest_sha1(const unsigned char *digest,
                                apr_pool_t *result_pool);
 
+/**
+ * Internal function for creating a 32 bit FNV-1a checksum from a binary
+ * digest.
+ *
+ * @since New in 1.9
+ */
+svn_checksum_t *
+svn_checksum__from_digest_fnv1a_32(const unsigned char *digest,
+                                   apr_pool_t *result_pool);
+
+/**
+ * Internal function for creating a modified 32 bit FNV-1a checksum from
+ * a binary digest.
+ *
+ * @since New in 1.9
+ */
+svn_checksum_t *
+svn_checksum__from_digest_fnv1a_32x4(const unsigned char *digest,
+                                     apr_pool_t *result_pool);
+
+
+/**
+ * Return a 32 bit FNV-1a checksum for the first @a len bytes in @a input.
+ * The representation is in Big Endian.
+ *
+ * @since New in 1.9
+ */
+apr_uint32_t
+svn__fnv1a_32(const void *input, apr_size_t len);
+
+/**
+ * Return a 32 bit modified FNV-1a checksum for the first @a len bytes in
+ * @a input.  The representation is in Big Endian.
+ * 
+ * @note This is a proprietary checksumming algorithm based FNV-1a with
+ *       approximately the same strength.  It is up to 4 times faster
+ *       than plain FNV-1a for longer data blocks.
+ *
+ * @since New in 1.9
+ */
+apr_uint32_t
+svn__fnv1a_32x4(const void *input, apr_size_t len);
+
+/** @} */
+
 
 /**
  * @defgroup svn_hash_support Hash table serialization support

Modified: subversion/branches/fsfs-ucsnorm/subversion/include/svn_checksum.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/include/svn_checksum.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/include/svn_checksum.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/include/svn_checksum.h Mon Dec  2 14:55:09 2013
@@ -48,7 +48,17 @@ typedef enum svn_checksum_kind_t
   svn_checksum_md5,
 
   /** The checksum is (or should be set to) a SHA1 checksum. */
-  svn_checksum_sha1
+  svn_checksum_sha1,
+
+  /** The checksum is (or should be set to) a FNV-1a 32 bit checksum,
+   * in big endian byte order.
+   * @since New in 1.9. */
+  svn_checksum_fnv1a_32,
+
+  /** The checksum is (or should be set to) a modified FNV-1a 32 bit,
+   * in big endian byte order.
+   * @since New in 1.9. */
+  svn_checksum_fnv1a_32x4
 } svn_checksum_kind_t;
 
 /**

Modified: subversion/branches/fsfs-ucsnorm/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/include/svn_repos.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/include/svn_repos.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/include/svn_repos.h Mon Dec  2 14:55:09 2013
@@ -2694,11 +2694,11 @@ svn_repos_info_format(int *repos_format,
  * not notified. Finally, return an error if there were any failures during
  * verification, or SVN_NO_ERROR if there were no failures.
  *
- * If @a check_ucs_norm is @c TRUE, verify that all path names in the
- * repository and in svn:mergeinfo entries are normaized to Unicode
- * Normalization Form C, and report any name collisions within the
- * same directory or svn:mergeinfo property where the names differ only
- * in character representation, but are otherwise identical.
+ * If @a check_normalization is @c TRUE, verify that all path names in
+ * the repository and in @c svn:mergeinfo entries are normaized to
+ * Unicode Normalization Form C, and report any name collisions within
+ * the same directory or svn:mergeinfo property where the names differ
+ * only in character representation, but are otherwise identical.
  *
  * @since New in 1.9.
  */
@@ -2707,7 +2707,7 @@ svn_repos_verify_fs3(svn_repos_t *repos,
                      svn_revnum_t start_rev,
                      svn_revnum_t end_rev,
                      svn_boolean_t keep_going,
-                     svn_boolean_t check_ucs_norm,
+                     svn_boolean_t check_normalization,
                      svn_repos_notify_func_t notify_func,
                      void *notify_baton,
                      svn_cancel_func_t cancel,
@@ -2716,7 +2716,7 @@ svn_repos_verify_fs3(svn_repos_t *repos,
 
 /**
  * Like svn_repos_verify_fs3(), but with @a keep_going and
- * @a check_ucs_norm set to @c FALSE.
+ * @a check_normalization set to @c FALSE.
  *
  * @since New in 1.7.
  * @deprecated Provided for backward compatibility with the 1.8 API.

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs/fs-loader.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs/fs-loader.c Mon Dec  2 14:55:09 2013
@@ -63,8 +63,8 @@
 
 /* A pool common to all FS objects.  See the documentation on the
    open/create functions in fs-loader.h and for svn_fs_initialize(). */
-static apr_pool_t *common_pool;
-static svn_mutex__t *common_pool_lock;
+static apr_pool_t *common_pool = NULL;
+static svn_mutex__t *common_pool_lock = NULL;
 static svn_atomic_t common_pool_initialized = FALSE;
 
 
@@ -372,6 +372,9 @@ write_fs_type(const char *path, const ch
 static apr_status_t uninit(void *data)
 {
   common_pool = NULL;
+  common_pool_lock = NULL;
+  common_pool_initialized = 0;
+
   return APR_SUCCESS;
 }
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.c Mon Dec  2 14:55:09 2013
@@ -741,12 +741,27 @@ base_create(svn_fs_t *fs,
   /* See if compatibility with older versions was explicitly requested. */
   if (fs->config)
     {
-      if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE))
-        format = 1;
-      else if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE))
-        format = 2;
-      else if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE))
-        format = 3;
+      svn_version_t *compatible_version;
+      SVN_ERR(svn_fs__compatible_version(&compatible_version, fs->config,
+                                         pool));
+
+      /* select format number */
+      switch(compatible_version->minor)
+        {
+          case 0:
+          case 1:
+          case 2:
+          case 3: format = 1;
+                  break;
+
+          case 4: format = 2;
+                  break;
+
+          case 5: format = 3;
+                  break;
+
+          default:format = SVN_FS_BASE__FORMAT_NUMBER;
+        }
     }
 
   /* Create the environment and databases. */

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_base/fs.h Mon Dec  2 14:55:09 2013
@@ -43,7 +43,11 @@ extern "C" {
    repository format number, and independent of any other FS back
    ends.  See the SVN_FS_BASE__MIN_*_FORMAT defines to get a sense of
    what changes and features were added in which versions of this
-   back-end's format.  */
+   back-end's format.
+
+   Note: If you bump this, please update the switch statement in
+         base_create() as well.
+ */
 #define SVN_FS_BASE__FORMAT_NUMBER                4
 
 /* Minimum format number that supports representation sharing.  This

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/cached_data.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/cached_data.c Mon Dec  2 14:55:09 2013
@@ -2014,9 +2014,6 @@ svn_fs_fs__get_proplist(apr_hash_t **pro
   return SVN_NO_ERROR;
 }
 
-/* Fetch the list of change in revision REV in FS and return it in *CHANGES.
- * Allocate the result in POOL.
- */
 svn_error_t *
 svn_fs_fs__get_changes(apr_array_header_t **changes,
                        svn_fs_t *fs,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/fs_fs.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/fs_fs.c Mon Dec  2 14:55:09 2013
@@ -42,7 +42,6 @@
 
 #include "private/svn_fs_util.h"
 #include "private/svn_string_private.h"
-#include "private/svn_subr_private.h"
 #include "../libsvn_fs/fs-loader.h"
 
 /* The default maximum number of files per directory to store in the
@@ -1027,14 +1026,36 @@ svn_fs_fs__create(svn_fs_t *fs,
   /* See if compatibility with older versions was explicitly requested. */
   if (fs->config)
     {
-      if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE))
-        format = 1;
-      else if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE))
-        format = 2;
-      else if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE))
-        format = 3;
-      else if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE))
-        format = 4;
+      svn_version_t *compatible_version;
+      SVN_ERR(svn_fs__compatible_version(&compatible_version, fs->config,
+                                         pool));
+
+      /* select format number */
+      switch(compatible_version->minor)
+        {
+          case 0: return svn_error_create(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+                 _("FSFS is not compatible with Subversion prior to 1.1"));
+
+          case 1:
+          case 2:
+          case 3: format = 1;
+                  break;
+
+          case 4: format = 2;
+                  break;
+
+          case 5: format = 3;
+                  break;
+
+          case 6:
+          case 7: format = 4;
+                  break;
+
+          case 8: format = 6;
+                  break;
+
+          default:format = SVN_FS_FS__FORMAT_NUMBER;
+        }
     }
   ffd->format = format;
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/recovery.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/recovery.c Mon Dec  2 14:55:09 2013
@@ -54,10 +54,9 @@ recover_get_largest_revision(svn_fs_t *f
     {
       svn_error_t *err;
       apr_file_t *file;
-
-      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, right, iterpool);
       svn_pool_clear(iterpool);
 
+      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, right, iterpool);
       if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
         {
           svn_error_clear(err);
@@ -78,10 +77,9 @@ recover_get_largest_revision(svn_fs_t *f
       svn_revnum_t probe = left + ((right - left) / 2);
       svn_error_t *err;
       apr_file_t *file;
-
-      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, probe, iterpool);
       svn_pool_clear(iterpool);
 
+      err = svn_fs_fs__open_pack_or_rev_file(&file, fs, probe, iterpool);
       if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
         {
           svn_error_clear(err);

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/revprops.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/revprops.c Mon Dec  2 14:55:09 2013
@@ -72,6 +72,8 @@ svn_fs_fs__upgrade_pack_revprops(svn_fs_
   /* first, pack all revprops shards to match the packed revision shards */
   for (shard = 0; shard < first_unpacked_shard; ++shard)
     {
+      svn_pool_clear(iterpool);
+
       revprops_pack_file_dir = svn_dirent_join(revsprops_dir,
                    apr_psprintf(iterpool,
                                 "%" APR_INT64_T_FMT PATH_EXT_PACKED_SHARD,
@@ -91,8 +93,6 @@ svn_fs_fs__upgrade_pack_revprops(svn_fs_
       if (notify_func)
         SVN_ERR(notify_func(notify_baton, shard,
                             svn_fs_upgrade_pack_revprops, iterpool));
-
-      svn_pool_clear(iterpool);
     }
 
   svn_pool_destroy(iterpool);
@@ -121,6 +121,8 @@ svn_fs_fs__upgrade_cleanup_pack_revprops
   /* delete the non-packed revprops shards afterwards */
   for (shard = 0; shard < first_unpacked_shard; ++shard)
     {
+      svn_pool_clear(iterpool);
+
       revprops_shard_path = svn_dirent_join(revsprops_dir,
                        apr_psprintf(iterpool, "%" APR_INT64_T_FMT, shard),
                        iterpool);
@@ -132,8 +134,6 @@ svn_fs_fs__upgrade_cleanup_pack_revprops
       if (notify_func)
         SVN_ERR(notify_func(notify_baton, shard,
                             svn_fs_upgrade_cleanup_revprops, iterpool));
-
-      svn_pool_clear(iterpool);
     }
 
   svn_pool_destroy(iterpool);
@@ -819,6 +819,7 @@ parse_packed_revprops(svn_fs_t *fs,
       svn_string_t serialized;
       apr_hash_t *properties;
       svn_revnum_t revision = (svn_revnum_t)(first_rev + i);
+      svn_pool_clear(iterpool);
 
       /* read & check the serialized size */
       SVN_ERR(svn_fs_fs__read_number_from_stream(&size, NULL, stream,
@@ -854,8 +855,6 @@ parse_packed_revprops(svn_fs_t *fs,
       revprops->total_size += serialized.len;
 
       offset += serialized.len;
-
-      svn_pool_clear(iterpool);
     }
 
   return SVN_NO_ERROR;
@@ -898,6 +897,7 @@ read_pack_revprop(packed_revprops_t **re
        ++i)
     {
       const char *file_path;
+      svn_pool_clear(iterpool);
 
       /* there might have been concurrent writes.
        * Re-read the manifest and the pack file.
@@ -919,8 +919,6 @@ read_pack_revprop(packed_revprops_t **re
        */
       if (missing && has_revprop_cache(fs, pool))
         SVN_ERR(read_revprop_generation(&result->generation, fs, pool));
-
-      svn_pool_clear(iterpool);
     }
 
   /* the file content should be available now */
@@ -1081,8 +1079,9 @@ switch_to_new_revprop(svn_fs_t *fs,
       for (i = 0; i < files_to_delete->nelts; ++i)
         {
           const char *path = APR_ARRAY_IDX(files_to_delete, i, const char*);
-          SVN_ERR(svn_io_remove_file2(path, TRUE, iterpool));
+
           svn_pool_clear(iterpool);
+          SVN_ERR(svn_io_remove_file2(path, TRUE, iterpool));
         }
 
       svn_pool_destroy(iterpool);
@@ -1113,6 +1112,11 @@ serialize_revprops_header(svn_stream_t *
   /* the sizes array */
   for (i = start; i < end; ++i)
     {
+      /* Non-standard pool usage.
+       *
+       * We only allocate a few bytes each iteration -- even with a
+       * million iterations we would still be in good shape memory-wise.
+       */
       apr_off_t size = APR_ARRAY_IDX(sizes, i, apr_off_t);
       SVN_ERR(svn_stream_printf(stream, iterpool, "%" APR_OFF_T_FMT "\n",
                                 size));
@@ -1121,7 +1125,7 @@ serialize_revprops_header(svn_stream_t *
   /* the double newline char indicates the end of the header */
   SVN_ERR(svn_stream_printf(stream, iterpool, "\n"));
 
-  svn_pool_clear(iterpool);
+  svn_pool_destroy(iterpool);
   return SVN_NO_ERROR;
 }
 
@@ -1739,14 +1743,16 @@ svn_fs_fs__delete_revprops_shard(const c
       /* delete all files except the one for revision 0 */
       for (i = 1; i < max_files_per_dir; ++i)
         {
-          const char *path = svn_dirent_join(shard_path,
-                                       apr_psprintf(iterpool, "%d", i),
-                                       iterpool);
+          const char *path;
+          svn_pool_clear(iterpool);
+
+          path = svn_dirent_join(shard_path,
+                                 apr_psprintf(iterpool, "%d", i),
+                                 iterpool);
           if (cancel_func)
             SVN_ERR((*cancel_func)(cancel_baton));
 
           SVN_ERR(svn_io_remove_file2(path, TRUE, iterpool));
-          svn_pool_clear(iterpool);
         }
 
       svn_pool_destroy(iterpool);

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/transaction.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_fs/transaction.c Mon Dec  2 14:55:09 2013
@@ -779,6 +779,9 @@ process_changes(apr_hash_t *changed_path
 
   for (i = 0; i < changes->nelts; ++i)
     {
+      /* The ITERPOOL will be cleared at the end of this function
+       * since it is only used rarely and for a single hash iterator.
+       */
       change_t *change = APR_ARRAY_IDX(changes, i, change_t *);
 
       SVN_ERR(fold_change(changed_paths, change));
@@ -2935,7 +2938,7 @@ verify_moves(svn_fs_t *fs,
 {
   apr_hash_t *source_paths = apr_hash_make(pool);
   svn_revnum_t revision;
-  apr_pool_t *iter_pool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(pool);
   apr_hash_index_t *hi;
   int i;
   apr_array_header_t *moves
@@ -3018,8 +3021,8 @@ verify_moves(svn_fs_t *fs,
       apr_array_header_t *changes;
       change_t **changes_p;
 
-      svn_pool_clear(iter_pool);
-      svn_fs_fs__get_changes(&changes, fs, revision, iter_pool);
+      svn_pool_clear(iterpool);
+      svn_fs_fs__get_changes(&changes, fs, revision, iterpool);
 
       changes_p = (change_t **)&changes->elts;
       for (i = 0; i < changes->nelts; ++i)
@@ -3053,7 +3056,7 @@ verify_moves(svn_fs_t *fs,
         }
     }
 
-  svn_pool_destroy(iter_pool);
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_util/fs-util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_util/fs-util.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_util/fs-util.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_util/fs-util.c Mon Dec  2 14:55:09 2013
@@ -31,9 +31,11 @@
 #include "svn_fs.h"
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
+#include "svn_version.h"
 
 #include "private/svn_fs_util.h"
 #include "private/svn_fspath.h"
+#include "private/svn_subr_private.h"
 #include "../libsvn_fs/fs-loader.h"
 
 /* Return TRUE, if PATH of PATH_LEN > 0 chars starts with a '/' and does
@@ -221,3 +223,65 @@ svn_fs__append_to_merged_froms(svn_merge
 
   return SVN_NO_ERROR;
 }
+
+/* Set the version info in *VERSION to COMPAT_MAJOR and COMPAT_MINOR, if
+   the current value refers to a newer version than that.
+ */
+static void
+add_compatility(svn_version_t *version,
+                int compat_major,
+                int compat_minor)
+{
+  if (   version->major > compat_major
+      || (version->major == compat_major && version->minor > compat_minor))
+    {
+      version->major = compat_major;
+      version->minor = compat_minor;
+    }
+}
+
+svn_error_t *
+svn_fs__compatible_version(svn_version_t **compatible_version,
+                           apr_hash_t *config,
+                           apr_pool_t *pool)
+{
+  svn_version_t *version;
+  const char *compatible;
+
+  /* set compatible version according to generic option.
+     Make sure, we are always compatible to the current SVN version
+     (or older). */
+  compatible = svn_hash_gets(config, SVN_FS_CONFIG_COMPATIBLE_VERSION);
+  if (compatible)
+    {
+      SVN_ERR(svn_version__parse_version_string(&version,
+                                                compatible, pool));
+      add_compatility(version,
+                      svn_subr_version()->major,
+                      svn_subr_version()->minor);
+    }
+  else
+    {
+      version = apr_pmemdup(pool, svn_subr_version(), sizeof(*version));
+    }
+
+  /* specific options take precedence.
+     Let the lowest version compatibility requirement win */
+  if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE))
+    add_compatility(version, 1, 3);
+  else if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE))
+    add_compatility(version, 1, 4);
+  else if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE))
+    add_compatility(version, 1, 5);
+  else if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE))
+    add_compatility(version, 1, 7);
+
+  /* we ignored the patch level and tag so far.
+   * Give them a defined value. */
+  version->patch = 0;
+  version->tag = "";
+
+  /* done here */
+  *compatible_version = version;
+  return SVN_NO_ERROR;
+}

Propchange: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/branches/log-addressing/subversion/libsvn_fs_x:r1511324
  Merged /subversion/trunk/subversion/libsvn_fs_x:r1546599-1547043

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/cached_data.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/cached_data.c Mon Dec  2 14:55:09 2013
@@ -2302,9 +2302,6 @@ svn_fs_x__get_proplist(apr_hash_t **prop
 
 
 
-/* Fetch the list of change in revision REV in FS and return it in *CHANGES.
- * Allocate the result in POOL.
- */
 svn_error_t *
 svn_fs_x__get_changes(apr_array_header_t **changes,
                       svn_fs_t *fs,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs.h Mon Dec  2 14:55:09 2013
@@ -114,7 +114,11 @@ extern "C" {
 
 /* The format number of this filesystem.
    This is independent of the repository format number, and
-   independent of any other FS back ends. */
+   independent of any other FS back ends.
+
+   Note: If you bump this, please update the switch statement in
+         svn_fs_x__create() as well.
+ */
 #define SVN_FS_X__FORMAT_NUMBER   1
 
 /* Private FSX-specific data shared between all svn_txn_t objects that

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs_x.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/fs_x.c Mon Dec  2 14:55:09 2013
@@ -785,19 +785,25 @@ svn_fs_x__create(svn_fs_t *fs,
   if (fs->config)
     {
       svn_version_t *compatible_version;
-      const char *compatible;
-      compatible = svn_hash_gets(fs->config, SVN_FS_CONFIG_COMPATIBLE_VERSION);
-      if (compatible)
-        SVN_ERR(svn_version__parse_version_string(&compatible_version,
-                                                  compatible, pool));
-      if (svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE)
-          || svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE)
-          || svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE)
-          || svn_hash_gets(fs->config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE)
-          || (compatible && compatible_version->major == SVN_VER_MAJOR
-              && compatible_version->minor <= 8))
-        return svn_error_create(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
-                 _("FSX is not compatible with Subversion prior to 1.9"));
+      SVN_ERR(svn_fs__compatible_version(&compatible_version, fs->config,
+                                         pool));
+
+      /* select format number */
+      switch(compatible_version->minor)
+        {
+          case 0:
+          case 1:
+          case 2:
+          case 3:
+          case 4:
+          case 5:
+          case 6:
+          case 7:
+          case 8: return svn_error_create(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+                  _("FSX is not compatible with Subversion prior to 1.9"));
+
+          default:format = SVN_FS_X__FORMAT_NUMBER;
+        }
     }
   ffd->format = format;
   ffd->max_files_per_dir = SVN_FS_X_DEFAULT_MAX_FILES_PER_DIR;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_fs_x/transaction.c Mon Dec  2 14:55:09 2013
@@ -2852,23 +2852,27 @@ verify_locks(svn_fs_t *fs,
 
 /* If CHANGE is move, verify that there is no other move with the same
    copy-from path in SOURCE_PATHS already (parent or sub-node moves are fine).
-   Add the source path to SOURCE_PATHS after successful verification. */
+   Add the source path to SOURCE_PATHS after successful verification.
+   Allocate the hashed strings in POOL. */
 static svn_error_t *
 check_for_duplicate_move_source(apr_hash_t *source_paths,
-                                change_t *change)
+                                svn_fs_path_change2_t *change,
+                                apr_pool_t *pool)
 {
-  if (   change->info.change_kind == svn_fs_path_change_move
-      || change->info.change_kind == svn_fs_path_change_movereplace)
-    if (change->info.copyfrom_path)
+  if (   change->change_kind == svn_fs_path_change_move
+      || change->change_kind == svn_fs_path_change_movereplace)
+    if (change->copyfrom_path)
       {
-        if (apr_hash_get(source_paths, change->info.copyfrom_path,
-                         APR_HASH_KEY_STRING))
+        apr_size_t len = strlen(change->copyfrom_path);
+        if (apr_hash_get(source_paths, change->copyfrom_path, len))
           return svn_error_createf(SVN_ERR_FS_AMBIGUOUS_MOVE, NULL,
                       _("Path '%s' has been moved to more than one target"),
-                                   change->info.copyfrom_path);
+                                   change->copyfrom_path);
 
-        apr_hash_set(source_paths, change->info.copyfrom_path,
-                     APR_HASH_KEY_STRING, change->info.copyfrom_path);
+        apr_hash_set(source_paths,
+                     apr_pstrmemdup(pool, change->copyfrom_path, len),
+                     len,
+                     change->copyfrom_path);
       }
 
   return SVN_NO_ERROR;
@@ -2887,7 +2891,7 @@ verify_moves(svn_fs_t *fs,
 {
   apr_hash_t *source_paths = apr_hash_make(pool);
   svn_revnum_t revision;
-  apr_pool_t *iter_pool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(pool);
   apr_hash_index_t *hi;
   int i;
   apr_array_header_t *moves
@@ -2901,12 +2905,12 @@ verify_moves(svn_fs_t *fs,
     {
       const char *path;
       apr_ssize_t len;
-      change_t *change;
+      svn_fs_path_change2_t *change;
       apr_hash_this(hi, (const void**)&path, &len, (void**)&change);
 
-      if (   change->info.copyfrom_path
-          && (   change->info.change_kind == svn_fs_path_change_move
-              || change->info.change_kind == svn_fs_path_change_movereplace))
+      if (   change->copyfrom_path
+          && (   change->change_kind == svn_fs_path_change_move
+              || change->change_kind == svn_fs_path_change_movereplace))
         {
           svn_sort__item_t *item = apr_array_push(moves);
           item->key = path;
@@ -2914,9 +2918,9 @@ verify_moves(svn_fs_t *fs,
           item->value = change;
         }
 
-      if (   change->info.change_kind == svn_fs_path_change_delete
-          || change->info.change_kind == svn_fs_path_change_replace
-          || change->info.change_kind == svn_fs_path_change_movereplace)
+      if (   change->change_kind == svn_fs_path_change_delete
+          || change->change_kind == svn_fs_path_change_replace
+          || change->change_kind == svn_fs_path_change_movereplace)
         APR_ARRAY_PUSH(deletions, const char *) = path;
     }
 
@@ -2947,10 +2951,9 @@ verify_moves(svn_fs_t *fs,
                                        deleted_path);
           if (relpath)
             {
-              change_t *closed_move = closest_move_item->value;
+              svn_fs_path_change2_t *closed_move = closest_move_item->value;
               APR_ARRAY_IDX(deletions, i, const char*)
-                = svn_dirent_join(closed_move->info.copyfrom_path, relpath,
-                                  pool);
+                = svn_dirent_join(closed_move->copyfrom_path, relpath, pool);
             }
         }
     }
@@ -2963,46 +2966,50 @@ verify_moves(svn_fs_t *fs,
 
   for (i = 0; moves->nelts; ++i)
     SVN_ERR(check_for_duplicate_move_source (source_paths,
-                          APR_ARRAY_IDX(moves, i, svn_sort__item_t).value));
+                          APR_ARRAY_IDX(moves, i, svn_sort__item_t).value,
+                          pool));
 
   for (revision = txn_id->revision + 1; revision <= old_rev; ++revision)
     {
       apr_array_header_t *changes;
       change_t **changes_p;
 
-      svn_pool_clear(iter_pool);
-      svn_fs_x__get_changes(&changes, fs, revision, iter_pool);
+      svn_pool_clear(iterpool);
+      svn_fs_x__get_changes(&changes, fs, revision, iterpool);
 
       changes_p = (change_t **)&changes->elts;
       for (i = 0; i < changes->nelts; ++i)
-        SVN_ERR(check_for_duplicate_move_source(source_paths, changes_p[i]));
+        SVN_ERR(check_for_duplicate_move_source(source_paths,
+                                                &changes_p[i]->info,
+                                                pool));
     }
 
   /* The move source paths must been deleted in this txn. */
 
   for (i = 0; i < moves->nelts; ++i)
     {
-      change_t *change = APR_ARRAY_IDX(moves, i, svn_sort__item_t).value;
+      svn_fs_path_change2_t *change
+        = APR_ARRAY_IDX(moves, i, svn_sort__item_t).value;
 
       /* there must be a deletion of move's copy-from path
          (or any of its parents) */
 
       int closest_deletion_idx
-        = svn_sort__bsearch_lower_bound(change->info.copyfrom_path, deletions,
+        = svn_sort__bsearch_lower_bound(change->copyfrom_path, deletions,
                                         svn_sort_compare_paths);
       if (closest_deletion_idx < deletions->nelts)
         {
           const char *closest_deleted_path
             = APR_ARRAY_IDX(deletions, closest_deletion_idx, const char *);
           if (!svn_dirent_is_ancestor(closest_deleted_path,
-                                      change->info.copyfrom_path))
+                                      change->copyfrom_path))
             return svn_error_createf(SVN_ERR_FS_INCOMPLETE_MOVE, NULL,
                         _("Path '%s' has been moved without being deleted"),
-                                     change->info.copyfrom_path);
+                                     change->copyfrom_path);
         }
     }
 
-  svn_pool_destroy(iter_pool);
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_repos/dump.c Mon Dec  2 14:55:09 2013
@@ -382,7 +382,7 @@ struct edit_baton
   svn_boolean_t verify;
 
   /* True if checking UCS normalization during a verify. */
-  svn_boolean_t check_ucs_norm;
+  svn_boolean_t check_normalization;
 
   /* The first revision dumped in this dumpstream. */
   svn_revnum_t oldest_dumped_rev;
@@ -1155,7 +1155,7 @@ dump_node(struct edit_baton *eb,
       /* If we're checking UCS normalization, also parse any changed
          mergeinfo and warn about denormalized paths and name
          collisions there. */
-      if (eb->verify && eb->check_ucs_norm && eb->notify_func)
+      if (eb->verify && eb->check_normalization && eb->notify_func)
         {
           /* N.B.: This hash lookup happens only once; the conditions
              for verifying historic mergeinfo references and checking
@@ -1372,7 +1372,7 @@ add_directory(const char *path,
 
   /* Check for UCS normalization and name clashes, but only if this is
      actually a new name in the parent, not a replacement. */
-  if (!val && eb->verify && eb->check_ucs_norm && eb->notify_func)
+  if (!val && eb->verify && eb->check_normalization && eb->notify_func)
     {
       pb->check_name_collision = TRUE;
       SVN_ERR(check_path_normalization(
@@ -1481,7 +1481,7 @@ add_file(const char *path,
 
   /* Check for UCS normalization and name clashes, but only if this is
      actually a new name in the parent, not a replacement. */
-  if (!val && eb->verify && eb->check_ucs_norm && eb->notify_func)
+  if (!val && eb->verify && eb->check_normalization && eb->notify_func)
     {
       pb->check_name_collision = TRUE;
       SVN_ERR(check_path_normalization(
@@ -1656,7 +1656,7 @@ get_dump_editor(const svn_delta_editor_t
                 svn_revnum_t oldest_dumped_rev,
                 svn_boolean_t use_deltas,
                 svn_boolean_t verify,
-                svn_boolean_t check_ucs_norm,
+                svn_boolean_t check_normalization,
                 svn_cache__t *verified_dirents_cache,
                 apr_pool_t *pool)
 {
@@ -1680,7 +1680,7 @@ get_dump_editor(const svn_delta_editor_t
   eb->current_rev = to_rev;
   eb->use_deltas = use_deltas;
   eb->verify = verify;
-  eb->check_ucs_norm = check_ucs_norm;
+  eb->check_normalization = check_normalization;
   eb->found_old_reference = found_old_reference;
   eb->found_old_mergeinfo = found_old_mergeinfo;
   eb->verified_dirents_cache = verified_dirents_cache;
@@ -2163,7 +2163,7 @@ verify_one_revision(svn_fs_t *fs,
                     svn_repos_notify_func_t notify_func,
                     void *notify_baton,
                     svn_revnum_t start_rev,
-                    svn_boolean_t check_ucs_norm,
+                    svn_boolean_t check_normalization,
                     svn_cancel_func_t cancel_func,
                     void *cancel_baton,
                     svn_cache__t *verified_dirents_cache,
@@ -2185,7 +2185,7 @@ verify_one_revision(svn_fs_t *fs,
                           notify_func, notify_baton,
                           start_rev,
                           FALSE, TRUE, /* use_deltas, verify */
-                          check_ucs_norm,
+                          check_normalization,
                           verified_dirents_cache,
                           scratch_pool));
   SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
@@ -2263,7 +2263,7 @@ svn_repos_verify_fs3(svn_repos_t *repos,
                      svn_revnum_t start_rev,
                      svn_revnum_t end_rev,
                      svn_boolean_t keep_going,
-                     svn_boolean_t check_ucs_norm,
+                     svn_boolean_t check_normalization,
                      svn_repos_notify_func_t notify_func,
                      void *notify_baton,
                      svn_cancel_func_t cancel_func,
@@ -2359,7 +2359,7 @@ svn_repos_verify_fs3(svn_repos_t *repos,
 
       /* Wrapper function to catch the possible errors. */
       err = verify_one_revision(fs, rev, notify_func, notify_baton,
-                                start_rev, check_ucs_norm,
+                                start_rev, check_normalization,
                                 cancel_func, cancel_baton,
                                 verified_dirents_cache, iterpool);
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c Mon Dec  2 14:55:09 2013
@@ -27,7 +27,6 @@
 
 #include "svn_pools.h"
 #include "svn_checksum.h"
-#include "md5.h"
 #include "svn_private_config.h"
 #include "cache.h"
 #include "svn_string.h"

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/checksum.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/checksum.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/checksum.c Mon Dec  2 14:55:09 2013
@@ -21,7 +21,6 @@
  * ====================================================================
  */
 
-
 #include <ctype.h>
 
 #include <apr_md5.h>
@@ -30,9 +29,10 @@
 #include "svn_checksum.h"
 #include "svn_error.h"
 #include "svn_ctype.h"
+#include "svn_sorts.h"
 
-#include "sha1.h"
-#include "md5.h"
+#include "checksum.h"
+#include "fnv1a.h"
 
 #include "private/svn_subr_private.h"
 
@@ -40,17 +40,109 @@
 
 
 
+/* The MD5 digest for the empty string. */
+static const unsigned char md5_empty_string_digest_array[] = {
+  0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
+  0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e
+};
+
+/* The SHA1 digest for the empty string. */
+static const unsigned char sha1_empty_string_digest_array[] = {
+  0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55,
+  0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09
+};
+
+/* The FNV-1a digest for the empty string. */
+static const unsigned char fnv1a_32_empty_string_digest_array[] = {
+  0x81, 0x1c, 0x9d, 0xc5
+};
+
+/* The FNV-1a digest for the empty string. */
+static const unsigned char fnv1a_32x4_empty_string_digest_array[] = {
+  0xcd, 0x6d, 0x9a, 0x85
+};
+
+/* Digests for an empty string, indexed by checksum type */
+static const unsigned char * empty_string_digests[] = {
+  md5_empty_string_digest_array,
+  sha1_empty_string_digest_array,
+  fnv1a_32_empty_string_digest_array,
+  fnv1a_32x4_empty_string_digest_array
+};
+
+/* Digest sizes in bytes, indexed by checksum type */
+static const apr_size_t digest_sizes[] = {
+  APR_MD5_DIGESTSIZE,
+  APR_SHA1_DIGESTSIZE,
+  sizeof(apr_uint32_t),
+  sizeof(apr_uint32_t)
+};
+
 /* Returns the digest size of it's argument. */
-#define DIGESTSIZE(k) ((k) == svn_checksum_md5 ? APR_MD5_DIGESTSIZE : \
-                       (k) == svn_checksum_sha1 ? APR_SHA1_DIGESTSIZE : 0)
+#define DIGESTSIZE(k) \
+  (((k) < svn_checksum_md5 || (k) > svn_checksum_fnv1a_32x4) ? 0 : digest_sizes[k])
+
+/* Largest supported digest size */
+#define MAX_DIGESTSIZE (MAX(APR_MD5_DIGESTSIZE,APR_SHA1_DIGESTSIZE))
+
+const unsigned char *
+svn__empty_string_digest(svn_checksum_kind_t kind)
+{
+  return empty_string_digests[kind];
+}
 
+const char *
+svn__digest_to_cstring_display(const unsigned char digest[],
+                               apr_size_t digest_size,
+                               apr_pool_t *pool)
+{
+  static const char *hex = "0123456789abcdef";
+  char *str = apr_palloc(pool, (digest_size * 2) + 1);
+  int i;
+
+  for (i = 0; i < digest_size; i++)
+    {
+      str[i*2]   = hex[digest[i] >> 4];
+      str[i*2+1] = hex[digest[i] & 0x0f];
+    }
+  str[i*2] = '\0';
+
+  return str;
+}
+
+
+const char *
+svn__digest_to_cstring(const unsigned char digest[],
+                       apr_size_t digest_size,
+                       apr_pool_t *pool)
+{
+  static const unsigned char zeros_digest[MAX_DIGESTSIZE] = { 0 };
+
+  if (memcmp(digest, zeros_digest, digest_size) != 0)
+    return svn__digest_to_cstring_display(digest, digest_size, pool);
+  else
+    return NULL;
+}
+
+
+svn_boolean_t
+svn__digests_match(const unsigned char d1[],
+                   const unsigned char d2[],
+                   apr_size_t digest_size)
+{
+  static const unsigned char zeros[MAX_DIGESTSIZE] = { 0 };
+
+  return ((memcmp(d1, d2, digest_size) == 0)
+          || (memcmp(d2, zeros, digest_size) == 0)
+          || (memcmp(d1, zeros, digest_size) == 0));
+}
 
 /* Check to see if KIND is something we recognize.  If not, return
  * SVN_ERR_BAD_CHECKSUM_KIND */
 static svn_error_t *
 validate_kind(svn_checksum_kind_t kind)
 {
-  if (kind == svn_checksum_md5 || kind == svn_checksum_sha1)
+  if (kind >= svn_checksum_md5 && kind <= svn_checksum_fnv1a_32x4)
     return SVN_NO_ERROR;
   else
     return svn_error_create(SVN_ERR_BAD_CHECKSUM_KIND, NULL, NULL);
@@ -93,11 +185,12 @@ svn_checksum_create(svn_checksum_kind_t 
   switch (kind)
     {
       case svn_checksum_md5:
-        digest_size = APR_MD5_DIGESTSIZE;
-        break;
       case svn_checksum_sha1:
-        digest_size = APR_SHA1_DIGESTSIZE;
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        digest_size = digest_sizes[kind];
         break;
+
       default:
         return NULL;
     }
@@ -123,6 +216,22 @@ svn_checksum__from_digest_sha1(const uns
                          result_pool);
 }
 
+svn_checksum_t *
+svn_checksum__from_digest_fnv1a_32(const unsigned char *digest,
+                                   apr_pool_t *result_pool)
+{
+  return checksum_create(svn_checksum_fnv1a_32, sizeof(digest), digest,
+                         result_pool);
+}
+
+svn_checksum_t *
+svn_checksum__from_digest_fnv1a_32x4(const unsigned char *digest,
+                                     apr_pool_t *result_pool)
+{
+  return checksum_create(svn_checksum_fnv1a_32x4, sizeof(digest), digest,
+                         result_pool);
+}
+
 svn_error_t *
 svn_checksum_clear(svn_checksum_t *checksum)
 {
@@ -145,9 +254,13 @@ svn_checksum_match(const svn_checksum_t 
   switch (checksum1->kind)
     {
       case svn_checksum_md5:
-        return svn_md5__digests_match(checksum1->digest, checksum2->digest);
       case svn_checksum_sha1:
-        return svn_sha1__digests_match(checksum1->digest, checksum2->digest);
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        return svn__digests_match(checksum1->digest,
+                                  checksum2->digest,
+                                  digest_sizes[checksum1->kind]);
+
       default:
         /* We really shouldn't get here, but if we do... */
         return FALSE;
@@ -161,9 +274,13 @@ svn_checksum_to_cstring_display(const sv
   switch (checksum->kind)
     {
       case svn_checksum_md5:
-        return svn_md5__digest_to_cstring_display(checksum->digest, pool);
       case svn_checksum_sha1:
-        return svn_sha1__digest_to_cstring_display(checksum->digest, pool);
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        return svn__digest_to_cstring_display(checksum->digest,
+                                              digest_sizes[checksum->kind],
+                                              pool);
+
       default:
         /* We really shouldn't get here, but if we do... */
         return NULL;
@@ -180,9 +297,13 @@ svn_checksum_to_cstring(const svn_checks
   switch (checksum->kind)
     {
       case svn_checksum_md5:
-        return svn_md5__digest_to_cstring(checksum->digest, pool);
       case svn_checksum_sha1:
-        return svn_sha1__digest_to_cstring(checksum->digest, pool);
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        return svn__digest_to_cstring(checksum->digest,
+                                      digest_sizes[checksum->kind],
+                                      pool);
+
       default:
         /* We really shouldn't get here, but if we do... */
         return NULL;
@@ -197,8 +318,8 @@ svn_checksum_serialize(const svn_checksu
 {
   const char *ckind_str;
 
-  SVN_ERR_ASSERT_NO_RETURN(checksum->kind == svn_checksum_md5
-                           || checksum->kind == svn_checksum_sha1);
+  SVN_ERR_ASSERT_NO_RETURN(checksum->kind >= svn_checksum_md5
+                           || checksum->kind <= svn_checksum_fnv1a_32x4);
   ckind_str = (checksum->kind == svn_checksum_md5 ? "$md5 $" : "$sha1$");
   return apr_pstrcat(result_pool,
                      ckind_str,
@@ -302,11 +423,14 @@ svn_checksum_dup(const svn_checksum_t *c
   switch (checksum->kind)
     {
       case svn_checksum_md5:
-        return svn_checksum__from_digest_md5(checksum->digest, pool);
-        break;
       case svn_checksum_sha1:
-        return svn_checksum__from_digest_sha1(checksum->digest, pool);
-        break;
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        return checksum_create(checksum->kind,
+                               digest_sizes[checksum->kind],
+                               checksum->digest,
+                               pool);
+
       default:
         SVN_ERR_MALFUNCTION_NO_RETURN();
         break;
@@ -337,6 +461,14 @@ svn_checksum(svn_checksum_t **checksum,
         apr_sha1_final((unsigned char *)(*checksum)->digest, &sha1_ctx);
         break;
 
+      case svn_checksum_fnv1a_32:
+        *(apr_uint32_t *)(*checksum)->digest = svn__fnv1a_32(data, len);
+        break;
+
+      case svn_checksum_fnv1a_32x4:
+        *(apr_uint32_t *)(*checksum)->digest = svn__fnv1a_32x4(data, len);
+        break;
+
       default:
         /* We really shouldn't get here, but if we do... */
         return svn_error_create(SVN_ERR_BAD_CHECKSUM_KIND, NULL, NULL);
@@ -353,12 +485,13 @@ svn_checksum_empty_checksum(svn_checksum
   switch (kind)
     {
       case svn_checksum_md5:
-        return svn_checksum__from_digest_md5(svn_md5__empty_string_digest(),
-                                             pool);
-
       case svn_checksum_sha1:
-        return svn_checksum__from_digest_sha1(svn_sha1__empty_string_digest(),
-                                              pool);
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        return checksum_create(kind,
+                               digest_sizes[kind],
+                               empty_string_digests[kind],
+                               pool);
 
       default:
         /* We really shouldn't get here, but if we do... */
@@ -391,6 +524,14 @@ svn_checksum_ctx_create(svn_checksum_kin
         apr_sha1_init(ctx->apr_ctx);
         break;
 
+      case svn_checksum_fnv1a_32:
+        ctx->apr_ctx = svn_fnv1a_32__context_create(pool);
+        break;
+
+      case svn_checksum_fnv1a_32x4:
+        ctx->apr_ctx = svn_fnv1a_32x4__context_create(pool);
+        break;
+
       default:
         SVN_ERR_MALFUNCTION_NO_RETURN();
     }
@@ -413,6 +554,14 @@ svn_checksum_update(svn_checksum_ctx_t *
         apr_sha1_update(ctx->apr_ctx, data, (unsigned int)len);
         break;
 
+      case svn_checksum_fnv1a_32:
+        svn_fnv1a_32__update(ctx->apr_ctx, data, len);
+        break;
+
+      case svn_checksum_fnv1a_32x4:
+        svn_fnv1a_32x4__update(ctx->apr_ctx, data, len);
+        break;
+
       default:
         /* We really shouldn't get here, but if we do... */
         return svn_error_create(SVN_ERR_BAD_CHECKSUM_KIND, NULL, NULL);
@@ -438,6 +587,16 @@ svn_checksum_final(svn_checksum_t **chec
         apr_sha1_final((unsigned char *)(*checksum)->digest, ctx->apr_ctx);
         break;
 
+      case svn_checksum_fnv1a_32:
+        *(apr_uint32_t *)(*checksum)->digest
+          = svn_fnv1a_32__finalize(ctx->apr_ctx);
+        break;
+
+      case svn_checksum_fnv1a_32x4:
+        *(apr_uint32_t *)(*checksum)->digest
+          = svn_fnv1a_32x4__finalize(ctx->apr_ctx);
+        break;
+
       default:
         /* We really shouldn't get here, but if we do... */
         return svn_error_create(SVN_ERR_BAD_CHECKSUM_KIND, NULL, NULL);
@@ -486,12 +645,12 @@ svn_checksum_is_empty_checksum(svn_check
   switch (checksum->kind)
     {
       case svn_checksum_md5:
-        return svn_md5__digests_match(checksum->digest,
-                                      svn_md5__empty_string_digest());
-
       case svn_checksum_sha1:
-        return svn_sha1__digests_match(checksum->digest,
-                                       svn_sha1__empty_string_digest());
+      case svn_checksum_fnv1a_32:
+      case svn_checksum_fnv1a_32x4:
+        return svn__digests_match(checksum->digest,
+                                  svn__empty_string_digest(checksum->kind),
+                                  digest_sizes[checksum->kind]);
 
       default:
         /* We really shouldn't get here, but if we do... */

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_file.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_file.c Mon Dec  2 14:55:09 2013
@@ -412,7 +412,7 @@ svn_config__sys_config_path(const char *
 #ifdef WIN32
   {
     const char *folder;
-    SVN_ERR(svn_config__win_config_path(&folder, TRUE, pool));
+    SVN_ERR(svn_config__win_config_path(&folder, TRUE, pool, pool));
     *path_p = svn_dirent_join_many(pool, folder,
                                    SVN_CONFIG__SUBDIRECTORY, fname,
                                    SVN_VA_NULL);
@@ -1370,7 +1370,11 @@ svn_config_get_user_config_path(const ch
 #ifdef WIN32
   {
     const char *folder;
-    SVN_ERR(svn_config__win_config_path(&folder, FALSE, pool));
+    SVN_ERR(svn_config__win_config_path(&folder, FALSE, pool, pool));
+
+    if (! folder)
+      return SVN_NO_ERROR;
+
     *path = svn_dirent_join_many(pool, folder,
                                  SVN_CONFIG__SUBDIRECTORY, fname, SVN_VA_NULL);
   }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_impl.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_impl.h?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_impl.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_impl.h Mon Dec  2 14:55:09 2013
@@ -96,8 +96,9 @@ svn_error_t *svn_config__parse_stream(sv
 #ifdef WIN32
 /* Get the common or user-specific AppData folder */
 svn_error_t *svn_config__win_config_path(const char **folder,
-                                         int system_path,
-                                         apr_pool_t *pool);
+                                         svn_boolean_t system_path,
+                                         apr_pool_t *result_pool,
+                                         apr_pool_t *scratch_pool);
 
 /* Read sections and options from the Windows Registry. */
 svn_error_t *svn_config__parse_registry(svn_config_t *cfg,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_win.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_win.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_win.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/config_win.c Mon Dec  2 14:55:09 2013
@@ -46,9 +46,13 @@
 #include "svn_utf.h"
 #include "private/svn_utf_private.h"
 
+#include "config_impl.h"
+
 svn_error_t *
-svn_config__win_config_path(const char **folder, int system_path,
-                            apr_pool_t *result_pool)
+svn_config__win_config_path(const char **folder,
+                            svn_boolean_t system_path,
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
 {
   /* ### Adding CSIDL_FLAG_CREATE here, because those folders really
      must exist.  I'm not too sure about the SHGFP_TYPE_CURRENT
@@ -57,6 +61,30 @@ svn_config__win_config_path(const char *
                      | CSIDL_FLAG_CREATE);
 
   WCHAR folder_ucs2[MAX_PATH];
+  const char *folder_utf8;
+
+  if (! system_path)
+    {
+      HKEY hkey_tmp;
+
+      /* Verify if we actually have a *per user* profile to read from */
+      if (ERROR_SUCCESS == RegOpenCurrentUser(KEY_SET_VALUE, &hkey_tmp))
+        RegCloseKey(hkey_tmp); /* We have a profile */
+      else
+        {
+          /* The user is not properly logged in. (Most likely we are running
+             in a service process). In this case Windows will return a default
+             read only 'roaming profile' directory, which we assume to be
+             writable. We will then spend many seconds trying to create a
+             configuration and then fail, because we are not allowed to write
+             there, but the retry loop in io.c doesn't know that.
+
+             We just answer that there is no user configuration directory. */
+
+          *folder = NULL;
+          return SVN_NO_ERROR;
+        }
+    }
 
   if (S_OK != SHGetFolderPathW(NULL, csidl, NULL, SHGFP_TYPE_CURRENT,
                                folder_ucs2))
@@ -65,16 +93,17 @@ svn_config__win_config_path(const char *
                            ? "Can't determine the system config path"
                            : "Can't determine the user's config path"));
 
-  return svn_error_trace(svn_utf__win32_utf16_to_utf8(folder, folder_ucs2,
-                                                      NULL, result_pool));
+  SVN_ERR(svn_utf__win32_utf16_to_utf8(&folder_utf8, folder_ucs2,
+                                       NULL, scratch_pool));
+  *folder = svn_dirent_internal_style(folder_utf8, result_pool);
+
+  return SVN_NO_ERROR;
 }
 
 
-#include "config_impl.h"
 
-/* ### These constants are insanely large, but (a) we want to avoid
-   reallocating strings if possible, and (b) the realloc logic might
-   not actually work -- you never know with Win32 ... */
+/* ### These constants are insanely large, but we want to avoid
+   reallocating strings if possible. */
 #define SVN_REG_DEFAULT_NAME_SIZE  2048
 #define SVN_REG_DEFAULT_VALUE_SIZE 8192
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/md5.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/md5.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/md5.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/md5.c Mon Dec  2 14:55:09 2013
@@ -23,88 +23,36 @@
 
 
 #include <apr_md5.h>
-#include "md5.h"
+
+#include "svn_checksum.h"
 #include "svn_md5.h"
+#include "checksum.h"
 
 
 
-/* The MD5 digest for the empty string. */
-static const unsigned char svn_md5__empty_string_digest_array[] = {
-  0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
-  0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e
-};
-
-const unsigned char *
-svn_md5__empty_string_digest(void)
-{
-  return svn_md5__empty_string_digest_array;
-}
-
-
-const char *
-svn_md5__digest_to_cstring_display(const unsigned char digest[],
-                                   apr_pool_t *pool)
-{
-  static const char *hex = "0123456789abcdef";
-  char *str = apr_palloc(pool, (APR_MD5_DIGESTSIZE * 2) + 1);
-  int i;
-
-  for (i = 0; i < APR_MD5_DIGESTSIZE; i++)
-    {
-      str[i*2]   = hex[digest[i] >> 4];
-      str[i*2+1] = hex[digest[i] & 0x0f];
-    }
-  str[i*2] = '\0';
-
-  return str;
-}
-
-
-const char *
-svn_md5__digest_to_cstring(const unsigned char digest[], apr_pool_t *pool)
-{
-  static const unsigned char zeros_digest[APR_MD5_DIGESTSIZE] = { 0 };
-
-  if (memcmp(digest, zeros_digest, APR_MD5_DIGESTSIZE) != 0)
-    return svn_md5__digest_to_cstring_display(digest, pool);
-  else
-    return NULL;
-}
-
-
-svn_boolean_t
-svn_md5__digests_match(const unsigned char d1[], const unsigned char d2[])
-{
-  static const unsigned char zeros[APR_MD5_DIGESTSIZE] = { 0 };
-
-  return ((memcmp(d1, zeros, APR_MD5_DIGESTSIZE) == 0)
-          || (memcmp(d2, zeros, APR_MD5_DIGESTSIZE) == 0)
-          || (memcmp(d1, d2, APR_MD5_DIGESTSIZE) == 0));
-}
-
 /* These are all deprecated, and just wrap the internal functions defined
    above. */
 const unsigned char *
 svn_md5_empty_string_digest(void)
 {
-  return svn_md5__empty_string_digest();
+  return svn__empty_string_digest(svn_checksum_md5);
 }
 
 const char *
 svn_md5_digest_to_cstring_display(const unsigned char digest[],
                                   apr_pool_t *pool)
 {
-  return svn_md5__digest_to_cstring_display(digest, pool);
+  return svn__digest_to_cstring_display(digest, APR_MD5_DIGESTSIZE, pool);
 }
 
 const char *
 svn_md5_digest_to_cstring(const unsigned char digest[], apr_pool_t *pool)
 {
-  return svn_md5__digest_to_cstring(digest, pool);
+  return svn__digest_to_cstring(digest, APR_MD5_DIGESTSIZE, pool);
 }
 
 svn_boolean_t
 svn_md5_digests_match(const unsigned char d1[], const unsigned char d2[])
 {
-  return svn_md5__digests_match(d1, d2);
+  return svn__digests_match(d1, d2, APR_MD5_DIGESTSIZE);
 }

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c Mon Dec  2 14:55:09 2013
@@ -259,11 +259,6 @@ svn_stream_printf_from_utf8(svn_stream_t
   return svn_error_trace(svn_stream_puts(stream, translated));
 }
 
-/* Size that 90% of the lines we encounter will be not longer than.
-   used by stream_readline_bytewise() and stream_readline_chunky().
- */
-#define LINE_CHUNK_SIZE 80
-
 /* Guts of svn_stream_readline().
  * Returns the line read from STREAM in *STRINGBUF, and indicates
  * end-of-file in *EOF.  If DETECT_EOL is TRUE, the end-of-line indicator
@@ -286,7 +281,7 @@ stream_readline_bytewise(svn_stringbuf_t
      optimize for the 90% case.  90% of the time, we can avoid the
      stringbuf ever having to realloc() itself if we start it out at
      80 chars.  */
-  str = svn_stringbuf_create_ensure(LINE_CHUNK_SIZE, pool);
+  str = svn_stringbuf_create_ensure(SVN__LINE_CHUNK_SIZE, pool);
 
   /* Read into STR up to and including the next EOL sequence. */
   match = eol;
@@ -330,7 +325,7 @@ stream_readline_chunky(svn_stringbuf_t *
    * larger value because filling the buffer from the stream takes
    * time as well.
    */
-  char buffer[LINE_CHUNK_SIZE+1];
+  char buffer[SVN__LINE_CHUNK_SIZE+1];
 
   /* variables */
   svn_stream_mark_t *mark;
@@ -347,7 +342,7 @@ stream_readline_chunky(svn_stringbuf_t *
   SVN_ERR(svn_stream_mark(stream, &mark, pool));
 
   /* Read the first chunk. */
-  numbytes = LINE_CHUNK_SIZE;
+  numbytes = SVN__LINE_CHUNK_SIZE;
   SVN_ERR(svn_stream_read(stream, buffer, &numbytes));
   buffer[numbytes] = '\0';
 
@@ -359,7 +354,7 @@ stream_readline_chunky(svn_stringbuf_t *
       *stringbuf = svn_stringbuf_ncreate(buffer, eol_pos - buffer, pool);
       total_parsed = eol_pos - buffer + eol_len;
     }
-  else if (numbytes < LINE_CHUNK_SIZE)
+  else if (numbytes < SVN__LINE_CHUNK_SIZE)
     {
       /* We hit EOF but not EOL.
        */
@@ -371,7 +366,7 @@ stream_readline_chunky(svn_stringbuf_t *
     {
       /* A larger buffer for the string is needed. */
       svn_stringbuf_t *str;
-      str = svn_stringbuf_create_ensure(2*LINE_CHUNK_SIZE, pool);
+      str = svn_stringbuf_create_ensure(2*SVN__LINE_CHUNK_SIZE, pool);
       svn_stringbuf_appendbytes(str, buffer, numbytes);
       *stringbuf = str;
 
@@ -381,8 +376,8 @@ stream_readline_chunky(svn_stringbuf_t *
       {
         /* Append the next chunk to the string read so far.
          */
-        svn_stringbuf_ensure(str, str->len + LINE_CHUNK_SIZE);
-        numbytes = LINE_CHUNK_SIZE;
+        svn_stringbuf_ensure(str, str->len + SVN__LINE_CHUNK_SIZE);
+        numbytes = SVN__LINE_CHUNK_SIZE;
         SVN_ERR(svn_stream_read(stream, str->data + str->len, &numbytes));
         str->len += numbytes;
         str->data[str->len] = '\0';
@@ -393,7 +388,7 @@ stream_readline_chunky(svn_stringbuf_t *
          */
         eol_pos = strstr(str->data + str->len - numbytes - (eol_len-1), eol);
 
-        if ((numbytes < LINE_CHUNK_SIZE) && (eol_pos == NULL))
+        if ((numbytes < SVN__LINE_CHUNK_SIZE) && (eol_pos == NULL))
         {
           /* We hit EOF instead of EOL. */
           *eof = TRUE;

Modified: subversion/branches/fsfs-ucsnorm/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/svnadmin/svnadmin.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/svnadmin/svnadmin.c Mon Dec  2 14:55:09 2013
@@ -198,7 +198,7 @@ enum svnadmin__cmdline_options_t
     svnadmin__pre_1_5_compatible,
     svnadmin__pre_1_6_compatible,
     svnadmin__compatible_version,
-    svnadmin__check_ucs_normalization
+    svnadmin__check_normalization
   };
 
 /* Option codes and descriptions.
@@ -303,7 +303,7 @@ static const apr_getopt_option_t options
 
     {"file", 'F', 1, N_("read repository paths from file ARG")},
 
-    {"check-ucs-normalization", svnadmin__check_ucs_normalization, 0,
+    {"check-normalization", svnadmin__check_normalization, 0,
      N_("report paths in the filesystem and mergeinfo\n"
         "                             that are not normalized to Unicode Normalization\n"
         "                             Form C, and any names within the same directory\n"
@@ -504,7 +504,7 @@ static const svn_opt_subcommand_desc2_t 
    ("usage: svnadmin verify REPOS_PATH\n\n"
     "Verify the data stored in the repository.\n"),
    {'t', 'r', 'q', svnadmin__keep_going, 'M',
-    svnadmin__check_ucs_normalization} },
+    svnadmin__check_normalization} },
 
   { NULL, NULL, {0}, NULL, {0} }
 };
@@ -533,7 +533,7 @@ struct svnadmin_opt_state
   svn_boolean_t bypass_hooks;                       /* --bypass-hooks */
   svn_boolean_t wait;                               /* --wait */
   svn_boolean_t keep_going;                         /* --keep-going */
-  svn_boolean_t check_ucs_norm;                     /* --check-ucs-normalization */
+  svn_boolean_t check_normalization;                /* --check-normalization */
   svn_boolean_t bypass_prop_validation;             /* --bypass-prop-validation */
   enum svn_repos_load_uuid uuid_action;             /* --ignore-uuid,
                                                        --force-uuid */
@@ -720,7 +720,8 @@ subcommand_create(apr_getopt_t *os, void
                                  opt_state->compatible_version->patch,
                                  opt_state->compatible_version->tag
                                  ? "-" : "",
-                                 opt_state->compatible_version->tag));
+                                 opt_state->compatible_version->tag
+                                 ? opt_state->compatible_version->tag : ""));
     }
 
   if (opt_state->compatible_version)
@@ -1751,7 +1752,7 @@ subcommand_verify(apr_getopt_t *os, void
 
   verify_err = svn_repos_verify_fs3(repos, lower, upper,
                                     opt_state->keep_going,
-                                    opt_state->check_ucs_norm,
+                                    opt_state->check_normalization,
                                     !opt_state->quiet
                                     ? repos_notify_handler : NULL,
                                     &notify_baton, check_cancel,
@@ -2429,8 +2430,8 @@ sub_main(int *exit_code, int argc, const
       case svnadmin__keep_going:
         opt_state.keep_going = TRUE;
         break;
-      case svnadmin__check_ucs_normalization:
-        opt_state.check_ucs_norm = TRUE;
+      case svnadmin__check_normalization:
+        opt_state.check_normalization = TRUE;
         break;
       case svnadmin__fs_type:
         SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool));

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/log_tests.py Mon Dec  2 14:55:09 2013
@@ -2545,6 +2545,7 @@ def verify_move_log(sbox, flag, has_move
       raise SVNLogParseError("Replace of '/trunk/D' with '/trunk/C' expected, %s of %s found" % paths[1])
 
 @Issue(4355)
+@SkipUnless(server_has_auto_move)
 def log_auto_move(sbox):
   "test --auto-moves flag"
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py Mon Dec  2 14:55:09 2013
@@ -2077,7 +2077,7 @@ def verify_denormalized_names(sbox):
   load_dumpstream(sbox, open(dumpfile_location).read())
 
   exit_code, output, errput = svntest.main.run_svnadmin(
-    "verify", "--check-ucs-normalization", sbox.repo_dir)
+    "verify", "--check-normalization", sbox.repo_dir)
 
   expected_output_regex_list = [
     ".*Verified revision 0.",
@@ -2108,6 +2108,9 @@ def verify_denormalized_names(sbox):
   if not svntest.main.is_fs_type_bdb():
     expected_output_regex_list.insert(0, ".*Verifying repository metadata")
 
+    if svntest.main.is_fs_log_addressing():
+      expected_output_regex_list.insert(0, ".* Verifying metadata at revision 0 ...")
+
   exp_out = svntest.verify.RegexListOutput(expected_output_regex_list)
   exp_err = svntest.verify.ExpectedOutput([])
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/main.py Mon Dec  2 14:55:09 2013
@@ -1336,6 +1336,9 @@ def is_fs_type_fsx():
 def is_fs_type_bdb():
   return options.fs_type == 'bdb'
 
+def is_fs_log_addressing():
+  return is_fs_type_fsx()
+
 def is_os_windows():
   return os.name == 'nt'
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_fs/fs-test.c Mon Dec  2 14:55:09 2013
@@ -38,6 +38,7 @@
 #include "svn_props.h"
 #include "svn_version.h"
 
+#include "private/svn_fs_util.h"
 #include "private/svn_fs_private.h"
 
 #include "../svn_test_fs.h"
@@ -5144,6 +5145,60 @@ commit_timestamp(const svn_test_opts_t *
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_compat_version(const svn_test_opts_t *opts,
+                    apr_pool_t *pool)
+{
+  svn_version_t *compatible_version;
+  apr_hash_t *config = apr_hash_make(pool);
+  
+  svn_version_t vcurrent = {SVN_VER_MAJOR, SVN_VER_MINOR, 0, ""};
+  svn_version_t v1_2_0 = {1, 2, 0, ""};
+  svn_version_t v1_3_0 = {1, 3, 0, ""};
+  svn_version_t v1_5_0 = {1, 5, 0, ""};
+
+  /* no version specified -> default to the current one */
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &vcurrent));
+
+  /* test specific compat option */
+  svn_hash_sets(config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE, "1");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &v1_5_0));
+
+  /* test precedence amongst compat options */
+  svn_hash_sets(config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE, "1");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &v1_5_0));
+
+  svn_hash_sets(config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE, "1");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &v1_3_0));
+
+  /* precedence should work with the generic option as well */
+  svn_hash_sets(config, SVN_FS_CONFIG_COMPATIBLE_VERSION, "1.4.17-??");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &v1_3_0));
+
+  svn_hash_sets(config, SVN_FS_CONFIG_COMPATIBLE_VERSION, "1.2.3-no!");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &v1_2_0));
+
+  /* test generic option alone */
+  config = apr_hash_make(pool);
+  svn_hash_sets(config, SVN_FS_CONFIG_COMPATIBLE_VERSION, "1.2.3-no!");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &v1_2_0));
+
+  /* out of range values should be caped by the current tool version */
+  svn_hash_sets(config, SVN_FS_CONFIG_COMPATIBLE_VERSION, "2.3.4-x");
+  SVN_ERR(svn_fs__compatible_version(&compatible_version, config, pool));
+  SVN_TEST_ASSERT(svn_ver_equal(compatible_version, &vcurrent));
+
+  return SVN_NO_ERROR;
+}
+
+
 /* ------------------------------------------------------------------------ */
 
 /* The test table.  */
@@ -5234,5 +5289,7 @@ struct svn_test_descriptor_t test_funcs[
                        "test svn_fs_info_format"),
     SVN_TEST_OPTS_PASS(commit_timestamp,
                        "commit timestamp"),
+    SVN_TEST_OPTS_PASS(test_compat_version,
+                       "test svn_fs__compatible_version"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/checksum-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/checksum-test.c?rev=1547044&r1=1547043&r2=1547044&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/checksum-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/checksum-test.c Mon Dec  2 14:55:09 2013
@@ -31,34 +31,44 @@
 
 #include "../svn_test.h"
 
+/* Verify that DIGEST of checksum type KIND can be parsed and
+ * converted back to a string matching DIGEST.  NAME will be used
+ * to identify the type of checksum in error messages.
+ */
 static svn_error_t *
-test_checksum_parse(apr_pool_t *pool)
+checksum_parse_kind(const char *digest,
+                    svn_checksum_kind_t kind,
+                    const char *name,
+                    apr_pool_t *pool)
 {
-  const char *md5_digest = "8518b76f7a45fe4de2d0955085b41f98";
-  const char *sha1_digest = "74d82379bcc6771454377db03b912c2b62704139";
   const char *checksum_display;
   svn_checksum_t *checksum;
 
-  SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, md5_digest, pool));
+  SVN_ERR(svn_checksum_parse_hex(&checksum, kind, digest, pool));
   checksum_display = svn_checksum_to_cstring_display(checksum, pool);
 
-  if (strcmp(checksum_display, md5_digest) != 0)
+  if (strcmp(checksum_display, digest) != 0)
     return svn_error_createf
       (SVN_ERR_CHECKSUM_MISMATCH, NULL,
-       "verify-checksum: md5 checksum mismatch:\n"
+       "verify-checksum: %s checksum mismatch:\n"
        "   expected:  %s\n"
-       "     actual:  %s\n", md5_digest, checksum_display);
+       "     actual:  %s\n", name, digest, checksum_display);
 
-  SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, sha1_digest,
-                                 pool));
-  checksum_display = svn_checksum_to_cstring_display(checksum, pool);
+  return SVN_NO_ERROR;
+}
 
-  if (strcmp(checksum_display, sha1_digest) != 0)
-    return svn_error_createf
-      (SVN_ERR_CHECKSUM_MISMATCH, NULL,
-       "verify-checksum: sha1 checksum mismatch:\n"
-       "   expected:  %s\n"
-       "     actual:  %s\n", sha1_digest, checksum_display);
+static svn_error_t *
+test_checksum_parse(apr_pool_t *pool)
+{
+  SVN_ERR(checksum_parse_kind("8518b76f7a45fe4de2d0955085b41f98",
+                              svn_checksum_md5, "md5", pool));
+  SVN_ERR(checksum_parse_kind("74d82379bcc6771454377db03b912c2b62704139",
+                              svn_checksum_sha1, "sha1", pool));
+  SVN_ERR(checksum_parse_kind("deadbeef",
+                              svn_checksum_fnv1a_32, "fnv-1a", pool));
+  SVN_ERR(checksum_parse_kind("cafeaffe",
+                              svn_checksum_fnv1a_32x4,
+                              "modified fnv-1a", pool));
 
   return SVN_NO_ERROR;
 }
@@ -66,20 +76,18 @@ test_checksum_parse(apr_pool_t *pool)
 static svn_error_t *
 test_checksum_empty(apr_pool_t *pool)
 {
-  svn_checksum_t *checksum;
-  char data = '\0';
-
-  checksum = svn_checksum_empty_checksum(svn_checksum_md5, pool);
-  SVN_TEST_ASSERT(svn_checksum_is_empty_checksum(checksum));
-
-  checksum = svn_checksum_empty_checksum(svn_checksum_sha1, pool);
-  SVN_TEST_ASSERT(svn_checksum_is_empty_checksum(checksum));
+  svn_checksum_kind_t kind;
+  for (kind = svn_checksum_md5; kind <= svn_checksum_fnv1a_32x4; ++kind)
+    {
+      svn_checksum_t *checksum;
+      char data = '\0';
 
-  SVN_ERR(svn_checksum(&checksum, svn_checksum_md5, &data, 0, pool));
-  SVN_TEST_ASSERT(svn_checksum_is_empty_checksum(checksum));
+      checksum = svn_checksum_empty_checksum(kind, pool);
+      SVN_TEST_ASSERT(svn_checksum_is_empty_checksum(checksum));
 
-  SVN_ERR(svn_checksum(&checksum, svn_checksum_sha1, &data, 0, pool));
-  SVN_TEST_ASSERT(svn_checksum_is_empty_checksum(checksum));
+      SVN_ERR(svn_checksum(&checksum, kind, &data, 0, pool));
+      SVN_TEST_ASSERT(svn_checksum_is_empty_checksum(checksum));
+    }
 
   return SVN_NO_ERROR;
 }
@@ -116,44 +124,81 @@ test_pseudo_md5(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+/* Verify that "zero" checksums work properly for the given checksum KIND.
+ */
 static svn_error_t *
-zero_match(apr_pool_t *pool)
+zero_match_kind(svn_checksum_kind_t kind, apr_pool_t *pool)
 {
-  svn_checksum_t *zero_md5;
-  svn_checksum_t *zero_sha1;
-  svn_checksum_t *A_md5;
-  svn_checksum_t *B_md5;
-  svn_checksum_t *A_sha1;
-  svn_checksum_t *B_sha1;
-
-
-  zero_md5 = svn_checksum_create(svn_checksum_md5, pool);
-  SVN_ERR(svn_checksum_clear(zero_md5));
-  SVN_ERR(svn_checksum(&A_md5, svn_checksum_md5, "A", 1, pool));
-  SVN_ERR(svn_checksum(&B_md5, svn_checksum_md5, "B", 1, pool));
-
-  zero_sha1 = svn_checksum_create(svn_checksum_sha1, pool);
-  SVN_ERR(svn_checksum_clear(zero_sha1));
-  SVN_ERR(svn_checksum(&A_sha1, svn_checksum_sha1, "A", 1, pool));
-  SVN_ERR(svn_checksum(&B_sha1, svn_checksum_sha1, "B", 1, pool));
+  svn_checksum_t *zero;
+  svn_checksum_t *A;
+  svn_checksum_t *B;
+
+  zero = svn_checksum_create(kind, pool);
+  SVN_ERR(svn_checksum_clear(zero));
+  SVN_ERR(svn_checksum(&A, kind, "A", 1, pool));
+  SVN_ERR(svn_checksum(&B, kind, "B", 1, pool));
 
   /* Different non-zero don't match. */
-  SVN_TEST_ASSERT(!svn_checksum_match(A_md5, B_md5));
-  SVN_TEST_ASSERT(!svn_checksum_match(A_sha1, B_sha1));
-  SVN_TEST_ASSERT(!svn_checksum_match(A_md5, A_sha1));
-  SVN_TEST_ASSERT(!svn_checksum_match(A_md5, B_sha1));
+  SVN_TEST_ASSERT(!svn_checksum_match(A, B));
 
   /* Zero matches anything of the same kind. */
-  SVN_TEST_ASSERT(svn_checksum_match(A_md5, zero_md5));
-  SVN_TEST_ASSERT(svn_checksum_match(zero_md5, B_md5));
-  SVN_TEST_ASSERT(svn_checksum_match(A_sha1, zero_sha1));
-  SVN_TEST_ASSERT(svn_checksum_match(zero_sha1, B_sha1));
-
-  /* Zero doesn't match anything of a different kind... */
-  SVN_TEST_ASSERT(!svn_checksum_match(zero_md5, A_sha1));
-  SVN_TEST_ASSERT(!svn_checksum_match(zero_sha1, A_md5));
-  /* ...even another zero. */
-  SVN_TEST_ASSERT(!svn_checksum_match(zero_md5, zero_sha1));
+  SVN_TEST_ASSERT(svn_checksum_match(A, zero));
+  SVN_TEST_ASSERT(svn_checksum_match(zero, B));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+zero_match(apr_pool_t *pool)
+{
+  svn_checksum_kind_t kind;
+  for (kind = svn_checksum_md5; kind <= svn_checksum_fnv1a_32x4; ++kind)
+    SVN_ERR(zero_match_kind(kind, pool));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+zero_cross_match(apr_pool_t *pool)
+{
+  svn_checksum_kind_t i_kind;
+  svn_checksum_kind_t k_kind;
+
+  for (i_kind = svn_checksum_md5;
+       i_kind <= svn_checksum_fnv1a_32x4;
+       ++i_kind)
+    {
+      svn_checksum_t *i_zero;
+      svn_checksum_t *i_A;
+    
+      i_zero = svn_checksum_create(i_kind, pool);
+      SVN_ERR(svn_checksum_clear(i_zero));
+      SVN_ERR(svn_checksum(&i_A, i_kind, "A", 1, pool));
+
+      for (k_kind = svn_checksum_md5;
+           k_kind <= svn_checksum_fnv1a_32x4;
+           ++k_kind)
+        {
+          svn_checksum_t *k_zero;
+          svn_checksum_t *k_A;
+          if (i_kind == k_kind)
+            continue;
+
+          k_zero = svn_checksum_create(k_kind, pool);
+          SVN_ERR(svn_checksum_clear(k_zero));
+          SVN_ERR(svn_checksum(&k_A, k_kind, "A", 1, pool));
+
+          /* Different non-zero don't match. */
+          SVN_TEST_ASSERT(!svn_checksum_match(i_A, k_A));
+
+          /* Zero doesn't match anything of a different kind... */
+          SVN_TEST_ASSERT(!svn_checksum_match(i_zero, k_A));
+          SVN_TEST_ASSERT(!svn_checksum_match(i_A, k_zero));
+
+          /* ...even another zero. */
+          SVN_TEST_ASSERT(!svn_checksum_match(i_zero, k_zero));
+        }
+    }
 
   return SVN_NO_ERROR;
 }
@@ -256,5 +301,7 @@ struct svn_test_descriptor_t test_funcs[
                    "zero checksum matching"),
     SVN_TEST_OPTS_PASS(zlib_expansion_test,
                        "zlib expansion test (zlib regression)"),
+    SVN_TEST_PASS2(zero_cross_match,
+                   "zero checksum cross-type matching"),
     SVN_TEST_NULL
   };



Mime
View raw message