subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1623976 [1/2] - in /subversion/branches/remove-log-addressing: ./ subversion/bindings/ctypes-python/ subversion/bindings/cxxhl/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs/ subversion/libs...
Date Wed, 10 Sep 2014 12:10:14 GMT
Author: ivan
Date: Wed Sep 10 12:10:13 2014
New Revision: 1623976

URL: http://svn.apache.org/r1623976
Log:
On remove-log-addressing branch: Merge changes from trunk.

Added:
    subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
      - copied unchanged from r1623968, subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
    subversion/branches/remove-log-addressing/tools/client-side/svn-vendor.py
      - copied unchanged from r1623968, subversion/trunk/tools/client-side/svn-vendor.py
Modified:
    subversion/branches/remove-log-addressing/   (props changed)
    subversion/branches/remove-log-addressing/CHANGES
    subversion/branches/remove-log-addressing/COMMITTERS
    subversion/branches/remove-log-addressing/build.conf
    subversion/branches/remove-log-addressing/subversion/bindings/ctypes-python/README   (props changed)
    subversion/branches/remove-log-addressing/subversion/bindings/cxxhl/README   (props changed)
    subversion/branches/remove-log-addressing/subversion/include/private/README   (props changed)
    subversion/branches/remove-log-addressing/subversion/include/private/svn_cert.h   (props changed)
    subversion/branches/remove-log-addressing/subversion/include/svn_config.h
    subversion/branches/remove-log-addressing/subversion/include/svn_error_codes.h
    subversion/branches/remove-log-addressing/subversion/include/svn_wc.h
    subversion/branches/remove-log-addressing/subversion/libsvn_client/diff_local.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.h
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/index.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/rev_file.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure-indexes
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.c
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.h
    subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/verify.c
    subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c
    subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c
    subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c
    subversion/branches/remove-log-addressing/subversion/libsvn_repos/replay.c
    subversion/branches/remove-log-addressing/subversion/libsvn_subr/bit_array.c   (props changed)
    subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c
    subversion/branches/remove-log-addressing/subversion/libsvn_subr/sorts.c
    subversion/branches/remove-log-addressing/subversion/libsvn_subr/utf8proc/README   (props changed)
    subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff.h
    subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_editor.c
    subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff_local.c
    subversion/branches/remove-log-addressing/subversion/mod_dav_svn/lock.c
    subversion/branches/remove-log-addressing/subversion/mod_dav_svn/status.c   (props changed)
    subversion/branches/remove-log-addressing/subversion/mod_dav_svn/util.c
    subversion/branches/remove-log-addressing/subversion/svnfsfs/stats-cmd.c
    subversion/branches/remove-log-addressing/subversion/svnfsfs/svnfsfs.h
    subversion/branches/remove-log-addressing/subversion/svnlook/svnlook.c
    subversion/branches/remove-log-addressing/subversion/tests/cmdline/basic_tests.py
    subversion/branches/remove-log-addressing/subversion/tests/cmdline/lock_tests.py
    subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
    subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/   (props changed)
    subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_x/fs-x-pack-test.c
    subversion/branches/remove-log-addressing/subversion/tests/libsvn_subr/bit-array-test.c   (props changed)
    subversion/branches/remove-log-addressing/subversion/tests/manual/README   (props changed)

Propchange: subversion/branches/remove-log-addressing/
------------------------------------------------------------------------------
--- svn:auto-props (added)
+++ svn:auto-props Wed Sep 10 12:10:13 2014
@@ -0,0 +1,10 @@
+*.c = svn:eol-style=native
+*.cpp = svn:eol-style=native
+*.h = svn:eol-style=native
+*.hpp = svn:eol-style=native
+*.py = svn:eol-style=native
+*.pl = svn:eol-style=native
+*.rb = svn:eol-style=native
+*.txt = svn:eol-style=native
+README = svn:eol-style=native
+BRANCH-README = svn:eol-style=native

Propchange: subversion/branches/remove-log-addressing/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1620575-1623968

Modified: subversion/branches/remove-log-addressing/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/CHANGES?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/CHANGES (original)
+++ subversion/branches/remove-log-addressing/CHANGES Wed Sep 10 12:10:13 2014
@@ -138,7 +138,6 @@ http://svn.apache.org/repos/asf/subversi
     * alow the use of libmagic to be configured via subversion configuration
       file or SVN_CONFIG_OPTION_ENABLE_MAGIC_FILE env variable (r1572916)
     * store human readable info about SSL certs in auth store (r1573625)
-    * new 'http-pipelining' configuration option for serf (r1619072)
 
   - Client-side bugfixes:
     * export: fix problem exporting symlinks on windows (r1476093)

Modified: subversion/branches/remove-log-addressing/COMMITTERS
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/COMMITTERS?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/COMMITTERS [UTF-8] (original)
+++ subversion/branches/remove-log-addressing/COMMITTERS [UTF-8] Wed Sep 10 12:10:13 2014
@@ -98,6 +98,8 @@ Commit access for specific areas:
           sage   Sage LaTorra <sagelt@gmail.com>             (Ctypes-Python b.)
           vmpn   Vladimir Berezniker <vmpn@hitechman.com>    (JavaHL bindings)
        rschupp   Roderich Schupp <roderich.schupp@gmail.com> (Swig bindings)
+        stilor   Alexey Neyman <stilor@att.net>              (Python bindings,
+                                                             svn-vendor.py)
 
   Packages:
 

Modified: subversion/branches/remove-log-addressing/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/build.conf?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/build.conf (original)
+++ subversion/branches/remove-log-addressing/build.conf Wed Sep 10 12:10:13 2014
@@ -810,6 +810,15 @@ install = test
 libs = libsvn_test libsvn_fs libsvn_fs_fs libsvn_delta
        libsvn_subr apriconv apr
 
+[fs-fs-fuzzy-test]
+description = Use fuzzying to test FSFS corruption resilience
+type = exe
+path = subversion/tests/libsvn_fs_fs
+sources = fs-fs-fuzzy-test.c
+install = sub-test
+libs = libsvn_test libsvn_fs libsvn_fs_fs libsvn_delta
+       libsvn_repos libsvn_subr apriconv apr
+
 # ----------------------------------------------------------------------------
 # Tests for libsvn_fs_x
 [fs-x-pack-test]
@@ -1464,8 +1473,8 @@ libs = svn svnadmin svndumpfilter svnloo
 type = project
 path = build/win32
 libs = __ALL__
-       fs-test fs-base-test fs-fsfs-test fs-fs-pack-test fs-x-pack-test
-       string-table-test
+       fs-test fs-base-test fs-fsfs-test fs-fs-pack-test fs-fs-fuzzy-test
+       fs-x-pack-test string-table-test
        skel-test strings-reps-test changes-test locks-test
        repos-test dump-load-test
        checksum-test compat-test config-test hashdump-test mergeinfo-test

Propchange: subversion/branches/remove-log-addressing/subversion/bindings/ctypes-python/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: subversion/branches/remove-log-addressing/subversion/bindings/cxxhl/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: subversion/branches/remove-log-addressing/subversion/include/private/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: subversion/branches/remove-log-addressing/subversion/include/private/svn_cert.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/remove-log-addressing/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/include/svn_config.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/include/svn_config.h (original)
+++ subversion/branches/remove-log-addressing/subversion/include/svn_config.h Wed Sep 10 12:10:13 2014
@@ -97,8 +97,6 @@ typedef struct svn_config_t svn_config_t
 #define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS      "http-max-connections"
 /** @since New in 1.9. */
 #define SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS     "http-chunked-requests"
-/** @since New in 1.9. */
-#define SVN_CONFIG_OPTION_HTTP_PIPELINING           "http-pipelining"
 
 /** @since New in 1.9. */
 #define SVN_CONFIG_OPTION_SERF_LOG_COMPONENTS       "serf-log-components"
@@ -193,7 +191,7 @@ typedef struct svn_config_t svn_config_t
 #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
   "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__"
 #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
-  "*.rej *~ #*# .#* .*.swp .DS_Store"
+  "*.rej *~ #*# .#* .*.swp .DS_Store [Tt]humbs.db"
 #endif
 
 #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \

Modified: subversion/branches/remove-log-addressing/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/include/svn_error_codes.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/remove-log-addressing/subversion/include/svn_error_codes.h Wed Sep 10 12:10:13 2014
@@ -856,6 +856,11 @@ SVN_ERROR_START
              SVN_ERR_FS_CATEGORY_START + 61,
              "Container capacity exceeded.")
 
+  /** @since New in 1.9. */
+  SVN_ERRDEF(SVN_ERR_FS_MALFORMED_NODEREV_ID,
+             SVN_ERR_FS_CATEGORY_START + 62,
+             "Malformed node revision ID string.")
+
   /* repos errors */
 
   SVN_ERRDEF(SVN_ERR_REPOS_LOCKED,

Modified: subversion/branches/remove-log-addressing/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/include/svn_wc.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/include/svn_wc.h (original)
+++ subversion/branches/remove-log-addressing/subversion/include/svn_wc.h Wed Sep 10 12:10:13 2014
@@ -8175,7 +8175,17 @@ typedef svn_error_t *(*svn_changelist_re
 
 
 /**
- * ### TODO: Doc string, please.
+ * Beginning at @a local_abspath, crawl to @a depth to discover every path in
+ * or under @a local_abspath which belongs to one of the changelists in @a
+ * changelist_filter (an array of <tt>const char *</tt> changelist names).
+ * If @a changelist_filter is @c NULL, discover paths with any changelist.
+ * Call @a callback_func (with @a callback_baton) each time a
+ * changelist-having path is discovered.
+ *
+ * @a local_abspath is a local WC path.
+ *
+ * If @a cancel_func is not @c NULL, invoke it passing @a cancel_baton
+ * during the recursive walk.
  *
  * @since New in 1.7.
  */

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_client/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/diff_local.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/diff_local.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/diff_local.c Wed Sep 10 12:10:13 2014
@@ -42,6 +42,7 @@
 #include "svn_pools.h"
 #include "svn_props.h"
 #include "svn_sorts.h"
+#include "svn_subst.h"
 #include "client.h"
 
 #include "private/svn_sorts_private.h"
@@ -291,6 +292,68 @@ inner_dir_diff(const char *left_abspath,
 
   return SVN_NO_ERROR;
 }
+
+/* Translates *LEFT_ABSPATH to a temporary file if PROPS specify that the
+   file needs translation. *LEFT_ABSPATH is updated to point to a file that
+   lives at least as long as RESULT_POOL when translation is necessary.
+   Otherwise the value is not updated */
+static svn_error_t *
+translate_if_necessary(const char **local_abspath,
+                       apr_hash_t *props,
+                       svn_cancel_func_t cancel_func,
+                       void *cancel_baton,
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
+{
+  const svn_string_t *eol_style_val;
+  const svn_string_t *keywords_val;
+  svn_subst_eol_style_t eol_style;
+  const char *eol;
+  apr_hash_t *keywords;
+  svn_stream_t *contents;
+  svn_stream_t *dst;
+
+  /* if (svn_hash_gets(props, SVN_PROP_SPECIAL))
+      ### TODO: Implement */
+
+  eol_style_val = svn_hash_gets(props, SVN_PROP_EOL_STYLE);
+  keywords_val = svn_hash_gets(props, SVN_PROP_KEYWORDS);
+
+  if (eol_style_val)
+    svn_subst_eol_style_from_value(&eol_style, &eol, eol_style_val->data);
+  else
+    {
+      eol = NULL;
+      eol_style = svn_subst_eol_style_none;
+    }
+
+  if (keywords_val)
+    SVN_ERR(svn_subst_build_keywords3(&keywords, keywords_val->data,
+                                      APR_STRINGIFY(SVN_INVALID_REVNUM),
+                                      "", "", 0, "", scratch_pool));
+  else
+    keywords = NULL;
+
+  if (!svn_subst_translation_required(eol_style, eol, keywords, FALSE, FALSE))
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_stream_open_readonly(&contents, *local_abspath,
+                                    scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_stream_open_unique(&dst, local_abspath, NULL,
+                                  svn_io_file_del_on_pool_cleanup,
+                                  result_pool, scratch_pool));
+
+  dst = svn_subst_stream_translated(dst, eol, TRUE /* repair */,
+                                    keywords, FALSE /* expand */,
+                                    scratch_pool);
+
+  SVN_ERR(svn_stream_copy3(contents, dst, cancel_func, cancel_baton,
+                           scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Handles reporting of a file for inner_dir_diff */
 static svn_error_t *
 do_file_diff(const char *left_abspath,
@@ -356,6 +419,10 @@ do_file_diff(const char *left_abspath,
             svn_hash_sets(left_props, SVN_PROP_MIME_TYPE,
                           svn_string_create(mime_type, scratch_pool));
         }
+
+      SVN_ERR(translate_if_necessary(&left_abspath, left_props,
+                                     ctx->cancel_func, ctx->cancel_baton,
+                                     scratch_pool, scratch_pool));
     }
   else
     left_props = NULL;
@@ -379,6 +446,11 @@ do_file_diff(const char *left_abspath,
             svn_hash_sets(right_props, SVN_PROP_MIME_TYPE,
                           svn_string_create(mime_type, scratch_pool));
         }
+
+      SVN_ERR(translate_if_necessary(&right_abspath, right_props,
+                                     ctx->cancel_func, ctx->cancel_baton,
+                                     scratch_pool, scratch_pool));
+
     }
   else
     right_props = NULL;

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

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c Wed Sep 10 12:10:13 2014
@@ -2265,7 +2265,7 @@ read_dir_entries(apr_array_header_t *ent
                            _("Directory entry corrupt in '%s'"),
                            svn_fs_fs__id_unparse(id, scratch_pool)->data);
 
-      dirent->id = svn_fs_fs__id_parse(str, result_pool);
+      SVN_ERR(svn_fs_fs__id_parse(&dirent->id, str, result_pool));
 
       /* In incremental mode, update the hash; otherwise, write to the
        * final array.  Be sure to use hash keys that survive this iteration.

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c Wed Sep 10 12:10:13 2014
@@ -346,7 +346,6 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
   fs_fs_data_t *ffd = fs->fsap_data;
   const char *prefix = apr_pstrcat(pool,
                                    "fsfs:", fs->uuid,
-                                   ":", ffd->instance_id,
                                    "/", normalize_key_part(fs->path, pool),
                                    ":",
                                    SVN_VA_NULL);
@@ -708,7 +707,6 @@ svn_fs_fs__initialize_txn_caches(svn_fs_
      Therefore, throw in a uuid as well - just to be sure. */
   const char *prefix = apr_pstrcat(pool,
                                    "fsfs:", fs->uuid,
-                                   ":", ffd->instance_id,
                                    "/", fs->path,
                                    ":", txn_id,
                                    ":", svn_uuid_generate(pool), ":",

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c Wed Sep 10 12:10:13 2014
@@ -108,13 +108,16 @@ fs_serialized_init(svn_fs_t *fs, apr_poo
       /* POSIX fcntl locks are per-process, so we need a mutex for
          intra-process synchronization when grabbing the repository write
          lock. */
-      SVN_ERR(svn_mutex__init(&ffsd->fs_write_lock, TRUE, common_pool));
+      SVN_ERR(svn_mutex__init(&ffsd->fs_write_lock,
+                              SVN_FS_FS__USE_LOCK_MUTEX, common_pool));
 
       /* ... the pack lock ... */
-      SVN_ERR(svn_mutex__init(&ffsd->fs_pack_lock, TRUE, common_pool));
+      SVN_ERR(svn_mutex__init(&ffsd->fs_pack_lock,
+                              SVN_FS_FS__USE_LOCK_MUTEX, common_pool));
 
       /* ... not to mention locking the txn-current file. */
-      SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock, TRUE, common_pool));
+      SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock,
+                              SVN_FS_FS__USE_LOCK_MUTEX, common_pool));
 
       /* We also need a mutex for synchronizing access to the active
          transaction list and free transaction pointer. */

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h Wed Sep 10 12:10:13 2014
@@ -173,6 +173,17 @@ extern "C" {
 /* The minimum format number that supports a configuration file (fsfs.conf) */
 #define SVN_FS_FS__MIN_CONFIG_FILE 4
 
+/* On most operating systems apr implements file locks per process, not
+   per file.  On Windows apr implements the locking as per file handle
+   locks, so we don't have to add our own mutex for just in-process
+   synchronization. */
+/* Compare ../libsvn_subr/named_atomic.c:USE_THREAD_MUTEX */
+#if APR_HAS_THREADS && !defined(WIN32)
+#define SVN_FS_FS__USE_LOCK_MUTEX 1
+#else
+#define SVN_FS_FS__USE_LOCK_MUTEX 0
+#endif
+
 /* Private FSFS-specific data shared between all svn_txn_t objects that
    relate to a particular transaction in a filesystem (as identified
    by transaction id and filesystem UUID).  Objects of this type are

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c Wed Sep 10 12:10:13 2014
@@ -682,7 +682,7 @@ read_config(fs_fs_data_t *ffd,
       ffd->compress_packed_revprops = FALSE;
     }
 
-  /* should be irrelevant but we initialize them anyway */
+      /* should be irrelevant but we initialize them anyway */
   ffd->block_size = 0x1000;
 
   if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
@@ -891,7 +891,7 @@ read_global_config(svn_fs_t *fs)
   /* Ignore the user-specified larger block size if we don't use block-read.
      Defaulting to 4k gives us the same access granularity in format 7 as in
      older formats. */
-  ffd->block_size = MIN(0x1000, ffd->block_size);
+    ffd->block_size = MIN(0x1000, ffd->block_size);
 
   return SVN_NO_ERROR;
 }
@@ -1159,6 +1159,27 @@ svn_fs_fs__youngest_rev(svn_revnum_t *yo
   return SVN_NO_ERROR;
 }
 
+int
+svn_fs_fs__shard_size(svn_fs_t *fs)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+
+  return ffd->max_files_per_dir;
+}
+
+svn_error_t *
+svn_fs_fs__min_unpacked_rev(svn_revnum_t *min_unpacked,
+                            svn_fs_t *fs,
+                            apr_pool_t *pool)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+
+  SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, pool));
+  *min_unpacked = ffd->min_unpacked_rev;
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_fs_fs__ensure_revision_exists(svn_revnum_t rev,
                                   svn_fs_t *fs,
@@ -1382,14 +1403,14 @@ write_revision_zero(svn_fs_t *fs,
   svn_string_t date;
 
   /* Write out a rev file for revision 0. */
-  SVN_ERR(svn_io_file_create(path_revision_zero,
-                              "PLAIN\nEND\nENDREP\n"
-                              "id: 0.0.r0/17\n"
-                              "type: dir\n"
-                              "count: 0\n"
-                              "text: 0 0 4 4 "
-                              "2d2977d1c96f487abe4a1e202dd03b4e\n"
-                              "cpath: /\n"
+    SVN_ERR(svn_io_file_create(path_revision_zero,
+                               "PLAIN\nEND\nENDREP\n"
+                               "id: 0.0.r0/17\n"
+                               "type: dir\n"
+                               "count: 0\n"
+                               "text: 0 0 4 4 "
+                               "2d2977d1c96f487abe4a1e202dd03b4e\n"
+                               "cpath: /\n"
                               "\n\n17 107\n", scratch_pool));
 
   SVN_ERR(svn_io_set_file_read_only(path_revision_zero, FALSE, scratch_pool));
@@ -1643,9 +1664,9 @@ svn_fs_fs__get_node_origin(const svn_fs_
         = apr_hash_get(node_origins, node_id_ptr, len);
 
       if (origin_id_str)
-        *origin_id = svn_fs_fs__id_parse(apr_pstrdup(pool,
-                                                     origin_id_str->data),
-                                         pool);
+        SVN_ERR(svn_fs_fs__id_parse(origin_id,
+                                    apr_pstrdup(pool, origin_id_str->data),
+                                    pool));
     }
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h Wed Sep 10 12:10:13 2014
@@ -51,6 +51,17 @@ svn_error_t *svn_fs_fs__youngest_rev(svn
                                      svn_fs_t *fs,
                                      apr_pool_t *pool);
 
+/* Return the shard size of filesystem FS.  Return 0 for non-shared ones. */
+int
+svn_fs_fs__shard_size(svn_fs_t *fs);
+
+/* Set *MIN_UNPACKED to the oldest non-packed revision in filesystem FS.
+   Do any temporary allocation in POOL. */
+svn_error_t *
+svn_fs_fs__min_unpacked_rev(svn_revnum_t *min_unpacked,
+                            svn_fs_t *fs,
+                            apr_pool_t *pool);
+
 /* Return SVN_ERR_FS_NO_SUCH_REVISION if the given revision REV is newer
    than the current youngest revision in FS or is simply not a valid
    revision number, else return success. */

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c Wed Sep 10 12:10:13 2014
@@ -1165,8 +1165,8 @@ svn_fs_fs__hotcopy(svn_fs_t *src_fs,
   hbb.notify_baton = notify_baton;
   hbb.cancel_func = cancel_func;
   hbb.cancel_baton = cancel_baton;
-  SVN_ERR(svn_fs_fs__with_write_lock(dst_fs, hotcopy_locking_src_body, &hbb,
-                                     pool));
+  SVN_ERR(svn_fs_fs__with_all_locks(dst_fs, hotcopy_locking_src_body, &hbb,
+                                    pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c Wed Sep 10 12:10:13 2014
@@ -147,8 +147,8 @@ txn_id_parse(svn_fs_fs__id_part_t *txn_i
   if (!locale_independent_strtol(&txn_id->revision, data, &end))
     return FALSE;
 
-  data = strchr(end, '-');
-  if (data == NULL)
+  data = end;
+  if (*data != '-')
     return FALSE;
 
   ++data;
@@ -344,8 +344,14 @@ svn_fs_fs__id_eq(const svn_fs_id_t *a,
   if (a == b)
     return TRUE;
 
-  return memcmp(&id_a->private_id, &id_b->private_id,
-                sizeof(id_a->private_id)) == 0;
+  return svn_fs_fs__id_part_eq(&id_a->private_id.node_id,
+                               &id_b->private_id.node_id)
+      && svn_fs_fs__id_part_eq(&id_a->private_id.copy_id,
+                               &id_b->private_id.copy_id)
+      && svn_fs_fs__id_part_eq(&id_a->private_id.txn_id,
+                               &id_b->private_id.txn_id)
+      && svn_fs_fs__id_part_eq(&id_a->private_id.rev_item,
+                               &id_b->private_id.rev_item);
 }
 
 
@@ -488,10 +494,11 @@ svn_fs_fs__id_copy(const svn_fs_id_t *so
   return (svn_fs_id_t *)new_id;
 }
 
-
-svn_fs_id_t *
-svn_fs_fs__id_parse(char *data,
-                    apr_pool_t *pool)
+/* Return an ID resulting from parsing the string DATA, or NULL if DATA is
+   an invalid ID string. *DATA will be modified / invalidated by this call. */
+static svn_fs_id_t *
+id_parse(char *data,
+         apr_pool_t *pool)
 {
   fs_fs__id_t *id;
   char *str;
@@ -567,6 +574,21 @@ svn_fs_fs__id_parse(char *data,
   return (svn_fs_id_t *)id;
 }
 
+svn_error_t *
+svn_fs_fs__id_parse(const svn_fs_id_t **id_p,
+                    char *data,
+                    apr_pool_t *pool)
+{
+  svn_fs_id_t *id = id_parse(data, pool);
+  if (id == NULL)
+    return svn_error_createf(SVN_ERR_FS_MALFORMED_NODEREV_ID, NULL,
+                             "Malformed node revision ID string");
+
+  *id_p = id;
+
+  return SVN_NO_ERROR;
+}
+
 /* (de-)serialization support */
 
 /* Serialize an ID within the serialization CONTEXT.

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.h Wed Sep 10 12:10:13 2014
@@ -149,10 +149,13 @@ svn_fs_id_t *svn_fs_fs__id_rev_create(co
 svn_fs_id_t *svn_fs_fs__id_copy(const svn_fs_id_t *id,
                                 apr_pool_t *pool);
 
-/* Return an ID resulting from parsing the string DATA, or NULL if DATA is
-   an invalid ID string. *DATA will be modified / invalidated by this call. */
-svn_fs_id_t *svn_fs_fs__id_parse(char *data,
-                                 apr_pool_t *pool);
+/* Return an ID in *ID_P resulting from parsing the string DATA, or an error
+   if DATA is an invalid ID string. *DATA will be modified / invalidated by
+   this call. */
+svn_error_t *
+svn_fs_fs__id_parse(const svn_fs_id_t **id_p,
+                    char *data,
+                    apr_pool_t *pool);
 
 
 /* (de-)serialization support*/

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/index.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/index.c Wed Sep 10 12:10:13 2014
@@ -52,9 +52,9 @@ svn_fs_fs__item_offset(apr_off_t *absolu
   svn_error_t *err = SVN_NO_ERROR;
   if (txn_id)
     {
-        /* for data in txns, item_index *is* the offset */
-        *absolute_position = item_index;
-    }
+          /* for data in txns, item_index *is* the offset */
+          *absolute_position = item_index;
+        }
   else if (rev_file->is_packed)
     {
       /* pack file with physical addressing */

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c Wed Sep 10 12:10:13 2014
@@ -27,6 +27,7 @@
 #include "private/svn_sorts_private.h"
 #include "private/svn_string_private.h"
 #include "private/svn_subr_private.h"
+#include "private/svn_fspath.h"
 
 #include "../libsvn_fs/fs-loader.h"
 
@@ -69,6 +70,36 @@
  * various flags. */
 #define MAX_CHANGE_LINE_LEN FSFS_MAX_PATH_LEN + 256
 
+/* Convert the C string in *TEXT to a revision number and return it in *REV.
+ * Overflows, negative values other than -1 and terminating characters other
+ * than 0x20 or 0x0 will cause an error.  Set *TEXT to the first char after
+ * the initial separator or to EOS.
+ */
+static svn_error_t *
+parse_revnum(svn_revnum_t *rev,
+             const char **text)
+{
+  const char *string = *text;
+  if ((string[0] == '-') && (string[1] == '1'))
+    {
+      *rev = SVN_INVALID_REVNUM;
+      string += 2;
+    }
+  else
+    {
+      SVN_ERR(svn_revnum_parse(rev, string, &string));
+    }
+
+  if (*string == ' ')
+    ++string;
+  else if (*string != '\0')
+    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
+                            _("Invalid character in revision number"));
+
+  *text = string;
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_fs_fs__parse_revision_trailer(apr_off_t *root_offset,
                                   apr_off_t *changes_offset,
@@ -228,7 +259,7 @@ read_change(change_t **change_p,
     return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                             _("Invalid changes line in rev-file"));
 
-  info->node_rev_id = svn_fs_fs__id_parse(str, result_pool);
+  SVN_ERR(svn_fs_fs__id_parse(&info->node_rev_id, str, result_pool));
   if (info->node_rev_id == NULL)
     return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                             _("Invalid changes line in rev-file"));
@@ -346,8 +377,12 @@ read_change(change_t **change_p,
                               _("Invalid mergeinfo-mod flag in rev-file"));
         }
     }
-  
+
   /* Get the changed path. */
+  if (!svn_fspath__is_canonical(last_str))
+    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
+                            _("Invalid path in changes line"));
+
   change->path.len = strlen(last_str);
   change->path.data = apr_pstrdup(result_pool, last_str);
 
@@ -362,15 +397,11 @@ read_change(change_t **change_p,
   else
     {
       last_str = line->data;
-      str = svn_cstring_tokenize(" ", &last_str);
-      if (! str)
-        return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
-                                _("Invalid changes line in rev-file"));
-      info->copyfrom_rev = SVN_STR_TO_REV(str);
+      SVN_ERR(parse_revnum(&info->copyfrom_rev, (const char **)&last_str));
 
-      if (! last_str)
+      if (!svn_fspath__is_canonical(last_str))
         return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
-                                _("Invalid changes line in rev-file"));
+                                _("Invalid copy-from path in changes line"));
 
       info->copyfrom_path = apr_pstrdup(result_pool, last_str);
     }
@@ -649,12 +680,7 @@ svn_fs_fs__parse_representation(represen
   rep = apr_pcalloc(result_pool, sizeof(*rep));
   *rep_p = rep;
 
-  str = svn_cstring_tokenize(" ", &string);
-  if (str == NULL)
-    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
-                            _("Malformed text representation offset line in node-rev"));
-
-  rep->revision = SVN_STR_TO_REV(str);
+  SVN_ERR(parse_revnum(&rep->revision, (const char **)&string));
 
   /* initialize transaction info (never stored) */
   svn_fs_fs__id_txn_reset(&rep->txn_id);
@@ -797,7 +823,7 @@ svn_fs_fs__read_noderev(node_revision_t 
 
   SVN_ERR(svn_stream_close(stream));
 
-  noderev->id = svn_fs_fs__id_parse(value, result_pool);
+  SVN_ERR(svn_fs_fs__id_parse(&noderev->id, value, result_pool));
   noderev_id = value; /* for error messages later */
 
   /* Read the type. */
@@ -848,13 +874,19 @@ svn_fs_fs__read_noderev(node_revision_t 
     }
   else
     {
+      if (!svn_fspath__is_canonical(value))
+        return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+                            _("Non-canonical cpath field in node-rev '%s'"),
+                            noderev_id);
+
       noderev->created_path = apr_pstrdup(result_pool, value);
     }
 
   /* Get the predecessor ID. */
   value = svn_hash_gets(headers, HEADER_PRED);
   if (value)
-    noderev->predecessor_id = svn_fs_fs__id_parse(value, result_pool);
+    SVN_ERR(svn_fs_fs__id_parse(&noderev->predecessor_id, value,
+                                result_pool));
 
   /* Get the copyroot. */
   value = svn_hash_gets(headers, HEADER_COPYROOT);
@@ -865,17 +897,9 @@ svn_fs_fs__read_noderev(node_revision_t 
     }
   else
     {
-      char *str;
+      SVN_ERR(parse_revnum(&noderev->copyroot_rev, (const char **)&value));
 
-      str = svn_cstring_tokenize(" ", &value);
-      if (str == NULL)
-        return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
-                                 _("Malformed copyroot line in node-rev '%s'"),
-                                 noderev_id);
-
-      noderev->copyroot_rev = SVN_STR_TO_REV(str);
-
-      if (*value == '\0')
+      if (!svn_fspath__is_canonical(value))
         return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                                  _("Malformed copyroot line in node-rev '%s'"),
                                  noderev_id);
@@ -891,13 +915,7 @@ svn_fs_fs__read_noderev(node_revision_t 
     }
   else
     {
-      char *str = svn_cstring_tokenize(" ", &value);
-      if (str == NULL)
-        return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
-                                 _("Malformed copyfrom line in node-rev '%s'"),
-                                 noderev_id);
-
-      noderev->copyfrom_rev = SVN_STR_TO_REV(str);
+      SVN_ERR(parse_revnum(&noderev->copyfrom_rev, (const char **)&value));
 
       if (*value == 0)
         return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
@@ -1088,10 +1106,7 @@ svn_fs_fs__read_rep_header(svn_fs_fs__re
   if (! str || (strcmp(str, REP_DELTA) != 0))
     goto error;
 
-  str = svn_cstring_tokenize(" ", &last_str);
-  if (! str)
-    goto error;
-  (*header)->base_revision = SVN_STR_TO_REV(str);
+  SVN_ERR(parse_revnum(&(*header)->base_revision, (const char **)&last_str));
 
   str = svn_cstring_tokenize(" ", &last_str);
   if (! str)

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c Wed Sep 10 12:10:13 2014
@@ -216,7 +216,7 @@ recover_find_max_ids(svn_fs_t *fs,
       char *str_val;
       char *str;
       svn_node_kind_t kind;
-      svn_fs_id_t *id;
+      const svn_fs_id_t *id;
       const svn_fs_fs__id_part_t *rev_item;
       apr_uint64_t node_id, copy_id;
       apr_off_t child_dir_offset;
@@ -246,7 +246,7 @@ recover_find_max_ids(svn_fs_t *fs,
         return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                                 _("Directory entry corrupt"));
 
-      id = svn_fs_fs__id_parse(str, iterpool);
+      SVN_ERR(svn_fs_fs__id_parse(&id, str, iterpool));
 
       rev_item = svn_fs_fs__id_rev_item(id);
       if (rev_item->revision != rev)
@@ -348,6 +348,11 @@ recover_body(void *baton, apr_pool_t *po
   /* Lose potentially corrupted data in temp files */
   SVN_ERR(svn_fs_fs__cleanup_revprop_namespace(fs));
 
+  /* The admin may have created a plain copy of this repo before attempting
+     to recover it (hotcopy may or may not work with corrupted repos).
+     Bump the instance ID. */
+  SVN_ERR(svn_fs_fs__set_uuid(fs, fs->uuid, NULL, pool));
+
   /* We need to know the largest revision in the filesystem. */
   SVN_ERR(recover_get_largest_revision(fs, &max_rev, pool));
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/rev_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/rev_file.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/rev_file.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/rev_file.c Wed Sep 10 12:10:13 2014
@@ -30,6 +30,8 @@
 #include "private/svn_io_private.h"
 #include "svn_private_config.h"
 
+/* Initialize the *FILE structure for REVISION in filesystem FS.  Set its
+ * pool member to the provided POOL. */
 static void
 init_revision_file(svn_fs_fs__revision_file_t *file,
                    svn_fs_t *fs,
@@ -39,9 +41,7 @@ init_revision_file(svn_fs_fs__revision_f
   fs_fs_data_t *ffd = fs->fsap_data;
 
   file->is_packed = svn_fs_fs__is_packed_rev(fs, revision);
-  file->start_revision = revision < ffd->min_unpacked_rev
-                       ? revision - (revision % ffd->max_files_per_dir)
-                       : revision;
+  file->start_revision = svn_fs_fs__packed_base_rev(fs, revision);
 
   file->file = NULL;
   file->stream = NULL;
@@ -126,6 +126,7 @@ open_pack_or_rev_file(svn_fs_fs__revisio
 
               /* We failed for the first time. Refresh cache & retry. */
               SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, scratch_pool));
+              file->start_revision = svn_fs_fs__packed_base_rev(fs, rev);
 
               retry = TRUE;
             }

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure Wed Sep 10 12:10:13 2014
@@ -37,8 +37,6 @@ repository) is:
     <shard>.pack/     Pack directory, if the repo has been packed (see below)
       pack            Pack file, if the repository has been packed (see below)
       manifest        Pack manifest file, if a pack file exists (see below)
-      pack.l2p        Log-to-phys index file (format 7+, see below)
-      pack.p2l        Phys-to-log index file (format 7+, see below)
   revprops/           Subdirectory containing rev-props
     <shard>/          Shard directory, if sharding is in use (see below)
       <revnum>        File containing rev-props for <revnum>
@@ -327,8 +325,10 @@ the pack file.  The offsets are stored a
 a newline character.
 
 Revision pack files using logical addressing don't use manifest files but
-index files instead.  The revisions inside a pack file will also get
-interleaved to reduce I/O for typical access patterns.
+appends index data to the revision contents.  The revisions inside a pack
+file will also get interleaved to reduce I/O for typical access patterns.
+There is no structural difference between packed and non-packed revision
+files in that mode.
 
 
 Packing revision properties (format 5: SQLite)
@@ -526,7 +526,8 @@ A revision file contains a concatenation
   * Text and property representations
   * Node-revisions
   * The changed-path data
-  * Two offsets at the very end (physical addressing mode only)
+  * Index data (logical addressing only)
+  * Revision / pack file footer (logical addressing only)
 
 A representation begins with a line containing either "PLAIN\n" or
 "DELTA\n" or "DELTA <rev> <item_index> <length>\n", where <rev>,
@@ -604,7 +605,7 @@ Starting with FS format 4, <action> may 
 "dir") of the node, after a hyphen; for example, an added directory
 may be represented as "add-dir".
 
-Before with FS format 7, <mergeinfo-mod> flag is not available.  It may
+Prior to FS format 7, <mergeinfo-mod> flag is not available.  It may
 also be missing in revisions upgraded from pre-f7 formats.
 
 In physical addressing mode, at the very end of a rev file is a pair of
@@ -612,6 +613,12 @@ lines containing "\n<root-offset> <cp-of
 the offset of the root directory node revision and <cp-offset> is the
 offset of the changed-path data.
 
+In logical addressing mode, the revision footer is pair of offsets,
+separated by a space and the whole is terminated a single byte.  That
+byte contains the length (as plain 8 bit value) of the footer excluding
+the length byte.  The first offset is the start of the log-to-phys index,
+the other is the start offset of the phys-to-log index.
+
 All numbers in the rev file format are unsigned and are represented as
 ASCII decimal.
 
@@ -732,11 +739,12 @@ digests, too, so you would simply iterat
 consult the files they reference for lock information.
 
 
-Index files
------------
+Index Data
+----------
 
 Format 7 introduces logical addressing that requires item indexes
 to be translated / mapped to physical rev / pack file offsets.
+These indexes are appended to the respective rev / pack file.
 
 Details of the binary format used by these index files can be
 found in structure-indexes.

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure-indexes
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure-indexes?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure-indexes (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure-indexes Wed Sep 10 12:10:13 2014
@@ -1,17 +1,17 @@
-This file describes the design, data model, and file formats of FSFS
-index files.
+This file describes the design, data model, and storage formats of FSFS
+index data.
 
 
 Design
 ======
 
-For each pack and each rev file using logical addressing, there is exactly
-two index files.  One, the log-to-phys index, maps the (rev, item_index)
+Each pack and each rev file using logical addressing contains exactly
+two index sections.  One, the log-to-phys index, maps the (rev, item_index)
 pairs to absolute file offsets.  The other, phys-to-log, is a reverse
 index that gives basic information on any file location.  This is enough
 to read and cache any data without traversing DAGs.
 
-Rev and pack files are immutable, so the same is true for index files.
+Rev and pack files are immutable, so the same is true for index data.
 During a transaction or while packing a file, a proto index file gets
 written (actually, one log-to-phys and one phys-to-log).  Its format is
 a simple concatenation of runtime structs and as such, an implementation
@@ -52,7 +52,7 @@ and pre-defined item_index values.
 Encoding
 --------
 
-The final index file format is tuned for space and decoding efficiency.
+The final index data format is tuned for space and decoding efficiency.
 Indexes are stored as a sequence of variable integers.  The encoding is
 as follows:
 
@@ -105,13 +105,13 @@ hierarchy:
   offset = offsets[item_index % page_size];
 
   Different log-to-phys indexes in the same repository may have different
-  page sizes but within any given index file, the page size is the same
-  and immutable.
+  page sizes but within any given index, the page size is the same and
+  immutable.
 
 header:
 
-  <first revision>   ... first revision covered by this index file
-  <revision count>   ... number of revision covered by this index file
+  <first revision>   ... first revision covered by this index
+  <revision count>   ... number of revision covered by this index
   <page size>        ... maximum number of entries per page
   <page table index> ... array, for each revision containing the index in
                          <page table> of the first page that belongs to
@@ -123,7 +123,7 @@ header:
 page table:
 
   <offset>           ... absolute position of the page contents within the
-                         index file
+                         index
   <entry count>      ... number of offset entries in the page.
                          Must match <header>.<page size> unless this is
                          the last page for the respective revision.
@@ -140,10 +140,10 @@ page:
                          pack file.  This has <entry count> entries.
 
                          
-Index file format
------------------
+Index on-disk format
+--------------------
 
-  file := header revisions pages offsets
+  index := header revisions pages offsets
 
   header := u(<header>.<first revision>) \
             u(<header>.<page size>) \
@@ -217,7 +217,7 @@ hierarchy:
   offset is does not match any actual item start.  To simplify the lookup,
   the last index page will have an "unused item" entry for the section
   behind EOF.  Holes aren't allowed as well, i.e. every byte of the rev /
-  pack is expected to be covered by the index file.
+  pack is expected to be covered by the index.
 
   Also, there may be items stretching across page borders or even over
   multiple pages.  The data model solves this issue by storing the item
@@ -227,7 +227,7 @@ hierarchy:
 
 header:
 
-  <first revision>   ... first revision covered by this index file
+  <first revision>   ... first revision covered by this index
   <file size>        ... size of the rev / pack file in bytes
   <page size>        ... number of bytes in the rev / pack file covered by
                          each index page
@@ -253,10 +253,10 @@ entry:
   <item_index>       ... item_index within that revision
 
 
-Index file format
------------------
+Index on-disk format
+--------------------
 
-  file := header pages items
+  index := header pages items
 
   header := u(<header>.<first revision>) \
             u(<header>.<file size>) \
@@ -303,7 +303,7 @@ are not allowed; zero-length items are.
 In transactions, the final revision number may not be known when writing
 the proto index file (e.g. while still writing the proto rev file).  Items
 with revision set to SVN_INVALID_REVNUM will therefore be automatically
-updated when creating the index file.  This is possible in conjunction
+updated when creating the final index.  This is possible in conjunction
 with rev files but not for pack files.
 
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c Wed Sep 10 12:10:13 2014
@@ -4338,10 +4338,12 @@ stringify_node(dag_node_t *node,
 
 /* Check metadata sanity on NODE, and on its children.  Manually verify
    information for DAG nodes in revision REV, and trust the metadata
-   accuracy for nodes belonging to older revisions. */
+   accuracy for nodes belonging to older revisions.  To detect cycles,
+   provide all parent dag_node_t * in PARENT_NODES. */
 static svn_error_t *
 verify_node(dag_node_t *node,
             svn_revnum_t rev,
+            apr_array_header_t *parent_nodes,
             apr_pool_t *pool)
 {
   svn_boolean_t has_mergeinfo;
@@ -4351,6 +4353,18 @@ verify_node(dag_node_t *node,
   int pred_count;
   svn_node_kind_t kind;
   apr_pool_t *iterpool = svn_pool_create(pool);
+  int i;
+
+  /* Detect (non-)DAG cycles. */
+  for (i = 0; i < parent_nodes->nelts; ++i)
+    {
+      dag_node_t *parent = APR_ARRAY_IDX(parent_nodes, i, dag_node_t *);
+      if (svn_fs_fs__id_eq(svn_fs_fs__dag_get_id(parent),
+                           svn_fs_fs__dag_get_id(node)))
+        return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+                                "Node is its own direct or indirect parent '%s'",
+                                stringify_node(node, iterpool));
+    }
 
   /* Fetch some data. */
   SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&has_mergeinfo, node));
@@ -4402,8 +4416,8 @@ verify_node(dag_node_t *node,
   if (kind == svn_node_dir)
     {
       apr_array_header_t *entries;
-      int i;
       apr_int64_t children_mergeinfo = 0;
+      APR_ARRAY_PUSH(parent_nodes, dag_node_t*) = node;
 
       SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, node, pool));
 
@@ -4422,7 +4436,7 @@ verify_node(dag_node_t *node,
             {
               SVN_ERR(svn_fs_fs__dag_get_node(&child, fs, dirent->id,
                                               iterpool));
-              SVN_ERR(verify_node(child, rev, iterpool));
+              SVN_ERR(verify_node(child, rev, parent_nodes, iterpool));
               SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&child_mergeinfo,
                                                          child));
             }
@@ -4447,6 +4461,10 @@ verify_node(dag_node_t *node,
                                  stringify_node(node, iterpool),
                                  mergeinfo_count, has_mergeinfo,
                                  children_mergeinfo);
+
+      /* If we don't make it here, there was an error / corruption.
+       * In that case, nobody will need PARENT_NODES anymore. */
+      apr_array_pop(parent_nodes);
     }
 
   svn_pool_destroy(iterpool);
@@ -4459,6 +4477,7 @@ svn_fs_fs__verify_root(svn_fs_root_t *ro
 {
   svn_fs_t *fs = root->fs;
   dag_node_t *root_dir;
+  apr_array_header_t *parent_nodes;
 
   /* Issue #4129: bogus pred-counts and minfo-cnt's on the root node-rev
      (and elsewhere).  This code makes more thorough checks than the
@@ -4482,7 +4501,8 @@ svn_fs_fs__verify_root(svn_fs_root_t *ro
     }
 
   /* Recursively verify ROOT_DIR. */
-  SVN_ERR(verify_node(root_dir, root->rev, pool));
+  parent_nodes = apr_array_make(pool, 16, sizeof(dag_node_t *));
+  SVN_ERR(verify_node(root_dir, root->rev, parent_nodes, pool));
 
   /* Verify explicitly the predecessor of the root. */
   {

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.c Wed Sep 10 12:10:13 2014
@@ -55,6 +55,16 @@ svn_fs_fs__is_packed_revprop(svn_fs_t *f
       && (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT);
 }
 
+svn_revnum_t
+svn_fs_fs__packed_base_rev(svn_fs_t *fs,
+                           svn_revnum_t revision)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+  return (revision < ffd->min_unpacked_rev)
+       ? (revision - (revision % ffd->max_files_per_dir))
+       : revision;
+}
+
 const char *
 svn_fs_fs__path_txn_current(svn_fs_t *fs,
                             apr_pool_t *pool)

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/util.h Wed Sep 10 12:10:13 2014
@@ -76,6 +76,12 @@ svn_boolean_t
 svn_fs_fs__is_packed_revprop(svn_fs_t *fs,
                              svn_revnum_t rev);
 
+/* Return the first revision in the pack / rev file containing REVISION in
+ * filesystem FS.  For non-packed revs, this will simply be REVISION. */
+svn_revnum_t
+svn_fs_fs__packed_base_rev(svn_fs_t *fs,
+                           svn_revnum_t revision);
+
 /* Return the full path of the rev shard directory that will contain
  * revision REV in FS.  Allocate the result in POOL.
  */

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/verify.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/verify.c Wed Sep 10 12:10:13 2014
@@ -159,16 +159,6 @@ verify_rep_cache(svn_fs_t *fs,
 }
 
 static svn_revnum_t
-packed_base_rev(svn_fs_t *fs, svn_revnum_t rev)
-{
-  fs_fs_data_t *ffd = fs->fsap_data;
-
-  return rev < ffd->min_unpacked_rev
-       ? rev - (rev % ffd->max_files_per_dir)
-       : rev;
-}
-
-static svn_revnum_t
 pack_size(svn_fs_t *fs, svn_revnum_t rev)
 {
   fs_fs_data_t *ffd = fs->fsap_data;

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c Wed Sep 10 12:10:13 2014
@@ -315,6 +315,19 @@ run_locks(svn_ra_serf__session_t *sess,
                   && !SVN_ERR_IS_UNLOCK_ERROR(err)
                   && !SVN_ERR_IS_LOCK_ERROR(err))
                 {
+                  /* If the error that we are going to report is just about the
+                     POST unlock hook, we should first report that the operation
+                     succeeded, or the repository and working copy will be
+                     out of sync... */
+
+                  if (lock_func &&
+                      err->apr_err == SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED)
+                    {
+                      err = svn_error_compose_create(
+                                  err, lock_func(lock_baton, ctx->path, locking,
+                                                 NULL, NULL, ctx->pool));
+                    }
+
                   return svn_error_trace(err); /* Don't go through callbacks */
                 }
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h Wed Sep 10 12:10:13 2014
@@ -144,13 +144,6 @@ struct svn_ra_serf__session_t {
      i.e. is there a (reverse) proxy that does not support them?  */
   svn_boolean_t detect_chunking;
 
-  /* Can serf use HTTP pipelining, or should it send requests one by one.
-     HTTP pipelining is enabled by default. The only known case where it should
-     be disabled is when the server triggers SSL renegotiations in the middle
-     of HTTP traffic on a connection, which OpenSSL currently doesn't handle
-     well. See serf issue #135. */
-  svn_boolean_t http_pipelining;
-
   /* Our Version-Controlled-Configuration; may be NULL until we know it. */
   const char *vcc_url;
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c Wed Sep 10 12:10:13 2014
@@ -244,12 +244,6 @@ load_config(svn_ra_serf__session_t *sess
                                   SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS,
                                   "auto", svn_tristate_unknown));
 
-  /* Should we use HTTP pipelining. */
-  SVN_ERR(svn_config_get_bool(config, &session->http_pipelining,
-                              SVN_CONFIG_SECTION_GLOBAL,
-                              SVN_CONFIG_OPTION_HTTP_PIPELINING,
-                              TRUE));
-
 #if SERF_VERSION_AT_LEAST(1, 4, 0) && !defined(SVN_SERF_NO_LOGGING)
   SVN_ERR(svn_config_get_int64(config, &log_components,
                                SVN_CONFIG_SECTION_GLOBAL,
@@ -317,12 +311,6 @@ load_config(svn_ra_serf__session_t *sess
                                       SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS,
                                       "auto", chunked_requests));
 
-      /* Should we use HTTP pipelining. */
-      SVN_ERR(svn_config_get_bool(config, &session->http_pipelining,
-                                  server_group,
-                                  SVN_CONFIG_OPTION_HTTP_PIPELINING,
-                                  session->http_pipelining));
-
 #if SERF_VERSION_AT_LEAST(1, 4, 0) && !defined(SVN_SERF_NO_LOGGING)
       SVN_ERR(svn_config_get_int64(config, &log_components,
                                    server_group,
@@ -582,10 +570,6 @@ svn_ra_serf__open(svn_ra_session_t *sess
   if (status)
     return svn_ra_serf__wrap_err(status, NULL);
 
-  if (!serf_sess->http_pipelining) {
-      serf_connection_set_max_outstanding_requests(serf_sess->conns[0]->conn, 1);
-  }
-
   /* Set the progress callback. */
   serf_context_set_progress_cb(serf_sess->context, svn_ra_serf__progress,
                                serf_sess);
@@ -787,10 +771,6 @@ ra_serf_dup_session(svn_ra_session_t *ne
   if (status)
     return svn_ra_serf__wrap_err(status, NULL);
 
-  if (!new_sess->http_pipelining) {
-      serf_connection_set_max_outstanding_requests(new_sess->conns[0]->conn, 1);
-  }
-
   /* Set the progress callback. */
   serf_context_set_progress_cb(new_sess->context, svn_ra_serf__progress,
                                new_sess);

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c Wed Sep 10 12:10:13 2014
@@ -723,11 +723,6 @@ open_connection_if_needed(svn_ra_serf__s
       if (status)
         return svn_ra_serf__wrap_err(status, NULL);
 
-      if (!sess->http_pipelining) {
-          serf_connection_set_max_outstanding_requests(sess->conns[cur]->conn,
-                                                       1);
-      }
-
       sess->num_conns++;
     }
 
@@ -757,22 +752,45 @@ get_best_connection(report_context_t *ct
   if (ctx->report_received && (ctx->sess->max_connections > 2))
     first_conn = 0;
 
-  /* Currently, we just cycle connections.  In the future we could
-     store the number of pending requests on each connection, or
-     perform other heuristics, to achieve better connection usage.
-     (As an optimization, if there's only one available auxiliary
-     connection to use, don't bother doing all the cur_conn math --
-     just return that one connection.)  */
+  /* If there's only one available auxiliary connection to use, don't bother
+     doing all the cur_conn math -- just return that one connection.  */
   if (ctx->sess->num_conns - first_conn == 1)
     {
       conn = ctx->sess->conns[first_conn];
     }
   else
     {
+#if SERF_VERSION_AT_LEAST(1, 4, 0)
+      /* Often one connection is slower than others, e.g. because the server
+         process/thread has to do more work for the particular set of requests.
+         In the worst case, when REQUEST_COUNT_TO_RESUME requests are queued
+         on such a slow connection, ra_serf will completely stop sending
+         requests.
+
+         The method used here selects the connection with the least amount of
+         pending requests, thereby giving more work to lightly loaded server
+         processes.
+       */
+      unsigned int i, min = INT_MAX, best_conn = first_conn;
+      for (i = first_conn; i < ctx->sess->num_conns; i++)
+        {
+          serf_connection_t *sc = ctx->sess->conns[i]->conn;
+          unsigned int pending = serf_connection_pending_requests(sc);
+          if (pending < min)
+            {
+              min = pending;
+              best_conn = i;
+            }
+        }
+      conn = ctx->sess->conns[best_conn];
+#else
+    /* We don't know how many requests are pending per connection, so just 
+       cycle them. */
       conn = ctx->sess->conns[ctx->sess->cur_conn];
       ctx->sess->cur_conn++;
       if (ctx->sess->cur_conn >= ctx->sess->num_conns)
         ctx->sess->cur_conn = first_conn;
+#endif
     }
   return conn;
 }

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_repos/replay.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_repos/replay.c Wed Sep 10 12:10:13 2014
@@ -548,6 +548,17 @@ path_driver_cb_func(void **dir_baton,
       svn_boolean_t src_readable;
       svn_fs_root_t *copyfrom_root;
 
+      /* E.g. when verifying corrupted repositories, their changed path
+         lists may contain an ADD for "/".  The delta path driver will
+         call us with a NULL parent in that case. */
+      if (*edit_path == 0)
+        return svn_error_create(SVN_ERR_FS_ALREADY_EXISTS, NULL,
+                                _("Root directory already exists."));
+
+      /* A NULL parent_baton will cause a segfault.  It should never be
+          NULL for non-root paths. */
+      SVN_ERR_ASSERT(parent_baton);
+
       /* Was this node copied? */
       SVN_ERR(fill_copyfrom(&copyfrom_root, &copyfrom_path, &copyfrom_rev,
                             &src_readable, root, change,

Propchange: subversion/branches/remove-log-addressing/subversion/libsvn_subr/bit_array.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/config_file.c Wed Sep 10 12:10:13 2014
@@ -940,15 +940,6 @@ svn_config_ensure(const char *config_dir
         "###                              HTTP operation."                   NL
         "###   http-chunked-requests      Whether to use chunked transfer"   NL
         "###                              encoding for HTTP requests body."  NL
-        "###   http-pipelining            Whether to use HTTP pipelining "   NL
-        "###                              or send requests one by one."      NL
-        "###                              Pipelining is enabled by default." NL
-        "###                              The only known case where it should"
-                                                                             NL
-        "###                              be disabled is when the server"    NL
-        "###                              triggers SSL renegotiations in the"NL
-        "###                              middle of HTTP traffic, resulting" NL
-        "###                              in SSL communication errors."      NL
         "###   neon-debug-mask            Debug mask for Neon HTTP library"  NL
         "###   ssl-authority-files        List of files, each of a trusted CA"
                                                                              NL

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/sorts.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/sorts.c?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_subr/sorts.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/sorts.c Wed Sep 10 12:10:13 2014
@@ -244,14 +244,48 @@ svn_sort__array_lookup(const apr_array_h
    * hit location) first.  This speeds up linear scans. */
   if (hint)
     {
-      idx = *hint;
-      *hint = ++idx;
-      if (idx >= 0 && idx < array->nelts)
+      /* We intend to insert right behind *HINT.
+       * Exit this function early, if we actually can. */
+      idx = *hint + 1;
+      if (idx >= array->nelts)
         {
+          /* We intend to insert after the last entry.
+           * That is only allowed if that last entry is smaller than KEY.
+           * In that case, there will be no current entry, i.e. we must
+           * return NULL. */
+          apr_size_t offset;
+
+          *hint = array->nelts;
+          if (array->nelts == 0)
+            return NULL;
+
+          offset = (array->nelts - 1) * array->elt_size;
+          if (compare_func(array->elts + offset, key) < 0)
+            return NULL;
+        }
+      else if (idx > 0)
+        {
+          /* Intend to insert at a position inside the array, i.e. not
+           * at one of the boundaries.  The predecessor must be smaller
+           * and the current entry at IDX must be larger than KEY. */
+		  void *previous;
+
+          *hint = idx;
+		  previous = array->elts + (idx-1) * array->elt_size;
           result = array->elts + idx * array->elt_size;
-          if (!compare_func(result, key))
+          if (compare_func(previous, key) && !compare_func(result, key))
             return result;
         }
+      else if (idx <= 0)
+        {
+          /* Intend to insert at the beginning of an non-empty array.
+           * That requires the first entry to be larger than KEY. */
+          *hint = 0;
+          if (!compare_func(array->elts, key))
+            return array->elts;
+        }
+
+      /* The HINT did not help. */
     }
 
   idx = bsearch_lower_bound(key, array->elts, array->nelts, array->elt_size,

Propchange: subversion/branches/remove-log-addressing/subversion/libsvn_subr/utf8proc/README
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff.h?rev=1623976&r1=1623975&r2=1623976&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_wc/diff.h Wed Sep 10 12:10:13 2014
@@ -47,9 +47,6 @@ extern "C" {
    svn_wc__db_status_added. When DIFF_PRISTINE is TRUE, report the pristine
    version of LOCAL_ABSPATH as ADDED. In this case an
    svn_wc__db_status_deleted may shadow an added or deleted node.
-
-   If CHANGELIST_HASH is not NULL and LOCAL_ABSPATH's changelist is not
-   in the changelist, don't report the node.
  */
 svn_error_t *
 svn_wc__diff_local_only_file(svn_wc__db_t *db,
@@ -57,7 +54,6 @@ svn_wc__diff_local_only_file(svn_wc__db_
                              const char *relpath,
                              const svn_diff_tree_processor_t *processor,
                              void *processor_parent_baton,
-                             apr_hash_t *changelist_hash,
                              svn_boolean_t diff_pristine,
                              svn_cancel_func_t cancel_func,
                              void *cancel_baton,
@@ -73,9 +69,6 @@ svn_wc__diff_local_only_file(svn_wc__db_
    svn_wc__db_status_added. When DIFF_PRISTINE is TRUE, report the pristine
    version of LOCAL_ABSPATH as ADDED. In this case an
    svn_wc__db_status_deleted may shadow an added or deleted node.
-
-   If CHANGELIST_HASH is not NULL and LOCAL_ABSPATH's changelist is not
-   in the changelist, don't report the node.
  */
 svn_error_t *
 svn_wc__diff_local_only_dir(svn_wc__db_t *db,
@@ -84,7 +77,6 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                             svn_depth_t depth,
                             const svn_diff_tree_processor_t *processor,
                             void *processor_parent_baton,
-                            apr_hash_t *changelist_hash,
                             svn_boolean_t diff_pristine,
                             svn_cancel_func_t cancel_func,
                             void *cancel_baton,
@@ -132,7 +124,6 @@ svn_wc__diff_base_working_diff(svn_wc__d
                                const char *local_abspath,
                                const char *relpath,
                                svn_revnum_t revision,
-                               apr_hash_t *changelist_hash,
                                const svn_diff_tree_processor_t *processor,
                                void *processor_dir_baton,
                                svn_boolean_t diff_pristine,
@@ -140,6 +131,32 @@ svn_wc__diff_base_working_diff(svn_wc__d
                                void *cancel_baton,
                                apr_pool_t *scratch_pool);
 
+/* Return a tree processor filter that filters by changelist membership.
+ *
+ * This filter only passes on the changes for a file if the file's path
+ * (in the WC) is assigned to one of the changelists in @a changelist_hash.
+ * It also passes on the opening and closing of each directory that contains
+ * such a change, and possibly also of other directories, but not addition
+ * or deletion or changes to a directory.
+ *
+ * If @a changelist_hash is null then no filtering is performed and the
+ * returned diff processor is driven exactly like the input @a processor.
+ *
+ * @a wc_ctx is the WC context and @a root_local_abspath is the WC path of
+ * the root of the diff (for which relpath = "" in the diff processor).
+ *
+ * Allocate the returned diff processor in @a result_pool, or if no
+ * filtering is required then the input pointer @a processor itself may be
+ * returned.
+ */
+const svn_diff_tree_processor_t *
+svn_wc__changelist_filter_tree_processor_create(
+                                const svn_diff_tree_processor_t *processor,
+                                svn_wc_context_t *wc_ctx,
+                                const char *root_local_abspath,
+                                apr_hash_t *changelist_hash,
+                                apr_pool_t *result_pool);
+
 
 #ifdef __cplusplus
 }



Mime
View raw message