subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1585990 [1/2] - in /subversion/branches/remote-only-status: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/ subversion/libsvn_fs_x/ subv...
Date Wed, 09 Apr 2014 15:22:08 GMT
Author: brane
Date: Wed Apr  9 15:22:07 2014
New Revision: 1585990

URL: http://svn.apache.org/r1585990
Log:
On the remote-only-status branch: synced with trunk up to rr1585988.

Added:
    subversion/branches/remote-only-status/subversion/tests/libsvn_repos/dump-load-test.c
      - copied unchanged from r1585988, subversion/trunk/subversion/tests/libsvn_repos/dump-load-test.c
Modified:
    subversion/branches/remote-only-status/   (props changed)
    subversion/branches/remote-only-status/CHANGES
    subversion/branches/remote-only-status/build.conf
    subversion/branches/remote-only-status/subversion/include/private/svn_error_private.h
    subversion/branches/remote-only-status/subversion/include/private/svn_ra_svn_private.h
    subversion/branches/remote-only-status/subversion/include/svn_config.h
    subversion/branches/remote-only-status/subversion/include/svn_error.h
    subversion/branches/remote-only-status/subversion/include/svn_error_codes.h
    subversion/branches/remote-only-status/subversion/include/svn_fs.h
    subversion/branches/remote-only-status/subversion/include/svn_repos.h
    subversion/branches/remote-only-status/subversion/libsvn_client/info.c
    subversion/branches/remote-only-status/subversion/libsvn_client/status.c
    subversion/branches/remote-only-status/subversion/libsvn_client/update.c
    subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.c
    subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.h
    subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.h
    subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.h
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/hotcopy.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.h
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.h
    subversion/branches/remote-only-status/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.h
    subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.c
    subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.h
    subversion/branches/remote-only-status/subversion/libsvn_ra_local/ra_plugin.c
    subversion/branches/remote-only-status/subversion/libsvn_ra_serf/getlocks.c
    subversion/branches/remote-only-status/subversion/libsvn_ra_svn/marshal.c
    subversion/branches/remote-only-status/subversion/libsvn_repos/config_pool.c
    subversion/branches/remote-only-status/subversion/libsvn_repos/fs-wrap.c
    subversion/branches/remote-only-status/subversion/libsvn_repos/load-fs-vtable.c
    subversion/branches/remote-only-status/subversion/libsvn_subr/cache-memcache.c
    subversion/branches/remote-only-status/subversion/libsvn_subr/config.c
    subversion/branches/remote-only-status/subversion/libsvn_subr/error.c
    subversion/branches/remote-only-status/subversion/mod_dav_svn/lock.c
    subversion/branches/remote-only-status/subversion/svn/notify.c
    subversion/branches/remote-only-status/subversion/svnserve/serve.c
    subversion/branches/remote-only-status/subversion/svnserve/svnserve.c
    subversion/branches/remote-only-status/subversion/tests/cmdline/   (props changed)
    subversion/branches/remote-only-status/subversion/tests/cmdline/commit_tests.py
    subversion/branches/remote-only-status/subversion/tests/cmdline/lock_tests.py
    subversion/branches/remote-only-status/subversion/tests/cmdline/svnadmin_tests.py
    subversion/branches/remote-only-status/subversion/tests/cmdline/svntest/actions.py
    subversion/branches/remote-only-status/subversion/tests/cmdline/svntest/main.py
    subversion/branches/remote-only-status/subversion/tests/libsvn_fs/locks-test.c
    subversion/branches/remote-only-status/subversion/tests/libsvn_repos/repos-test.c
    subversion/branches/remote-only-status/tools/buildbot/slaves/bb-openbsd/svncheck.sh
    subversion/branches/remote-only-status/tools/dev/unix-build/Makefile.svn

Propchange: subversion/branches/remote-only-status/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1584343-1585988

Modified: subversion/branches/remote-only-status/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/CHANGES?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/CHANGES (original)
+++ subversion/branches/remote-only-status/CHANGES Wed Apr  9 15:22:07 2014
@@ -444,6 +444,31 @@ http://svn.apache.org/repos/asf/subversi
     * javahl: allow revert API to take a set of paths (r1571461)
 
 
+Version 1.8.9
+(XX Apr 2014, from /branches/1.8.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.8.9
+
+ User-visible changes:
+  - Client-side bugfixes:
+    * use proper peg revision for log over DAV (r1568872)
+    * allow upgrading from 1.7 with exclusive locks (r1572102 et al)
+    * resolve inconsitent inherited property results (r1575270 et al)
+    * increase minimal timestamp sleep from 1ms to 10ms (r1581305 et al)
+
+  - Server-side bugfixes:
+    * ensure proper access synchronization in fsfs on Windows (r1568953 et al)
+    * don't let invalid mergeinfo stop 'svnadmin dump' (r1574868 et al)
+    * resolve svnserve performance regression caused by iprops (r1578853 et al)
+
+ Developer-visible changes:
+  - General:
+    * improve consistency checks of DAV inherited property requests (r1498000)
+    * fix ocassional failure in autoprop_tests.py (r1567752)
+    * avoid duplicate sqlite analyze information rows (r1571214)
+    * add Mavericks to our sysinfo output (r1573088)
+    * bump copyright years to 2014 (r1555403)
+
+
 Version 1.8.8
 (19 Feb 2014, from /branches/1.8.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.8.8

Modified: subversion/branches/remote-only-status/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/build.conf?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/build.conf (original)
+++ subversion/branches/remote-only-status/build.conf Wed Apr  9 15:22:07 2014
@@ -852,6 +852,14 @@ sources = repos-test.c dir-delta-editor.
 install = test
 libs = libsvn_test libsvn_repos libsvn_fs libsvn_delta libsvn_subr apriconv apr
 
+[dump-load-test]
+description = Test dumping/loading repositories in libsvn_repos
+type = exe
+path = subversion/tests/libsvn_repos
+sources = dump-load-test.c
+install = test
+libs = libsvn_test libsvn_repos libsvn_fs libsvn_delta libsvn_subr apriconv apr
+
 # ----------------------------------------------------------------------------
 # Tests for libsvn_subr
 
@@ -1440,7 +1448,8 @@ path = build/win32
 libs = __ALL__
        fs-test fs-base-test fs-fsfs-test fs-fs-pack-test fs-x-pack-test
        string-table-test
-       skel-test strings-reps-test changes-test locks-test repos-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
        opt-test packed-data-test path-test prefix-string-test
        priority-queue-test root-pools-test stream-test

Modified: subversion/branches/remote-only-status/subversion/include/private/svn_error_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/private/svn_error_private.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/private/svn_error_private.h (original)
+++ subversion/branches/remote-only-status/subversion/include/private/svn_error_private.h Wed Apr  9 15:22:07 2014
@@ -37,7 +37,7 @@ extern "C" {
  * Returns if @a err is a "tracing" error.
  */
 svn_boolean_t
-svn_error__is_tracing_link(svn_error_t *err);
+svn_error__is_tracing_link(const svn_error_t *err);
 
 /**
  * Converts a zlib error to an svn_error_t. zerr is the error code,

Modified: subversion/branches/remote-only-status/subversion/include/private/svn_ra_svn_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/private/svn_ra_svn_private.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/private/svn_ra_svn_private.h (original)
+++ subversion/branches/remote-only-status/subversion/include/private/svn_ra_svn_private.h Wed Apr  9 15:22:07 2014
@@ -314,11 +314,13 @@ svn_ra_svn__write_cmd_response(svn_ra_sv
                                apr_pool_t *pool,
                                const char *fmt, ...);
 
-/** Write an unsuccessful command response over the network. */
+/** Write an unsuccessful command response over the network.
+ *
+ * @note This does not clear @a err. */
 svn_error_t *
 svn_ra_svn__write_cmd_failure(svn_ra_svn_conn_t *conn,
                               apr_pool_t *pool,
-                              svn_error_t *err);
+                              const svn_error_t *err);
 
 /**
  * @}

Modified: subversion/branches/remote-only-status/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/svn_config.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/svn_config.h (original)
+++ subversion/branches/remote-only-status/subversion/include/svn_config.h Wed Apr  9 15:22:07 2014
@@ -892,7 +892,7 @@ svn_config_get_user_config_path(const ch
  */
 svn_error_t *
 svn_config_dup(svn_config_t **cfgp,
-               svn_config_t *src,
+               const svn_config_t *src,
                apr_pool_t *pool);
 
 /** Create a deep copy of the config hash @a src_hash and return

Modified: subversion/branches/remote-only-status/subversion/include/svn_error.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/svn_error.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/svn_error.h (original)
+++ subversion/branches/remote-only-status/subversion/include/svn_error.h Wed Apr  9 15:22:07 2014
@@ -105,7 +105,7 @@ svn_error_symbolic_name(apr_status_t sta
  * @note @a buf and @a bufsize are provided in the interface so that
  * this function is thread-safe and yet does no allocation.
  */
-const char *svn_err_best_message(svn_error_t *err,
+const char *svn_err_best_message(const svn_error_t *err,
                                  char *buf,
                                  apr_size_t bufsize);
 
@@ -202,7 +202,8 @@ svn_error_compose(svn_error_t *chain,
 
 /** Return the root cause of @a err by finding the last error in its
  * chain (e.g. it or its children).  @a err may be @c SVN_NO_ERROR, in
- * which case @c SVN_NO_ERROR is returned.
+ * which case @c SVN_NO_ERROR is returned.  The returned error should
+ * @em not be cleared as it shares memory with @a err.
  *
  * @since New in 1.5.
  */
@@ -225,7 +226,7 @@ svn_error_find_cause(svn_error_t *err, a
  * @since New in 1.2.
  */
 svn_error_t *
-svn_error_dup(svn_error_t *err);
+svn_error_dup(const svn_error_t *err);
 
 /** Free the memory used by @a error, as well as all ancestors and
  * descendants of @a error.
@@ -297,11 +298,13 @@ svn_handle_error(svn_error_t *error,
  *
  * @a error may not be @c NULL.
  *
+ * @note This does not clear @a error.
+ *
  * @since New in 1.2.
  */
 void
 svn_handle_warning2(FILE *stream,
-                    svn_error_t *error,
+                    const svn_error_t *error,
                     const char *prefix);
 
 /** Like svn_handle_warning2() but with @c prefix set to "svn: "

Modified: subversion/branches/remote-only-status/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/svn_error_codes.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/remote-only-status/subversion/include/svn_error_codes.h Wed Apr  9 15:22:07 2014
@@ -851,6 +851,11 @@ SVN_ERROR_START
              SVN_ERR_FS_CATEGORY_START + 60,
              "Move without a suitable deletion")
 
+  /** @since New in 1.9. */
+  SVN_ERRDEF(SVN_ERR_FS_LOCK_OPERATION_FAILED,
+             SVN_ERR_FS_CATEGORY_START + 61,
+             "Lock operation failed")
+
   /* repos errors */
 
   SVN_ERRDEF(SVN_ERR_REPOS_LOCKED,

Modified: subversion/branches/remote-only-status/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/svn_fs.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/svn_fs.h (original)
+++ subversion/branches/remote-only-status/subversion/include/svn_fs.h Wed Apr  9 15:22:07 2014
@@ -1351,10 +1351,12 @@ typedef enum svn_fs_path_change_kind_t
   /** ignore all previous change items for path (internal-use only) */
   svn_fs_path_change_reset,
 
-  /** moved to this path in txn */
+  /** moved to this path in txn
+   * @since New in 1.9 */
   svn_fs_path_change_move,
 
-  /** path removed and replaced by moved path in txn */
+  /** path removed and replaced by moved path in txn
+   * @since New in 1.9 */
   svn_fs_path_change_movereplace
 
 } svn_fs_path_change_kind_t;
@@ -2512,17 +2514,35 @@ svn_fs_set_uuid(svn_fs_t *fs,
  * expiration error (depending on the API).
  */
 
-/** The @a targets hash passed to svn_fs_lock_many() has <tt>const char
- * *</tt> keys and <tt>svn_fs_lock_target_t *</tt> values.
+/** Lock information for use with svn_fs_lock_many() [and svn_repos_fs_...].
+ *
+ * @see svn_fs_lock_target_create().
  *
  * @since New in 1.9.
  */
-typedef struct svn_fs_lock_target_t
-{
-  const char *token;
-  svn_revnum_t current_rev;
+typedef struct svn_fs_lock_target_t svn_fs_lock_target_t;
 
-} svn_fs_lock_target_t;
+/* Create an <tt>svn_fs_lock_target_t</tt> allocated in @a pool. @a
+ * token can be NULL and @a current_rev can be SVN_INVALID_REVNUM.
+ *
+ * The @a token is not duplicated and so must have a lifetime at least as
+ * long as the returned target object.
+ *
+ * @since New in 1.9.
+ **/
+svn_fs_lock_target_t *svn_fs_lock_target_create(const char *token,
+                                                svn_revnum_t current_rev,
+                                                apr_pool_t *pool);
+
+/* Update @a target changing the token to @a token, @a token can be NULL.
+ *
+ * The @a token is not duplicated and so must have a lifetime at least as
+ * long as the returned target object.
+ *
+ * @since New in 1.9.
+ **/
+void svn_fs_lock_target_set_token(svn_fs_lock_target_t *target,
+                                  const char *token);
 
 /** The callback invoked by svn_fs_lock_many() and svn_fs_unlock_many().
  *
@@ -2540,8 +2560,7 @@ typedef svn_error_t *(*svn_fs_lock_callb
                                                svn_error_t *fs_err,
                                                apr_pool_t *pool);
 
-/** Lock the paths in @a targets in @a fs, and set @a *results to the
- * locks or errors representing each new lock.
+/** Lock the paths in @a targets in @a fs.
  *
  * @warning You may prefer to use svn_repos_fs_lock_many() instead,
  * which see.
@@ -2633,8 +2652,7 @@ svn_fs_generate_lock_token(const char **
                            apr_pool_t *pool);
 
 
-/** Remove the locks on the paths in @a targets in @a fs, and return
- * the results in @a *results.
+/** Remove the locks on the paths in @a targets in @a fs.
  *
  * The paths to be unlocked are passed as <tt>const char *</tt> keys
  * of the @a targets hash with the corresponding lock tokens as

Modified: subversion/branches/remote-only-status/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/include/svn_repos.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/include/svn_repos.h (original)
+++ subversion/branches/remote-only-status/subversion/include/svn_repos.h Wed Apr  9 15:22:07 2014
@@ -341,12 +341,13 @@ typedef struct svn_repos_notify_t
       #svn_repos_notify_pack_shard_end_revprop, the shard processed. */
   apr_int64_t shard;
 
-  /** For #svn_repos_notify_load_node_done, the revision committed. */
+  /** For #svn_repos_notify_load_txn_committed, the revision committed. */
   svn_revnum_t new_revision;
 
-  /** For #svn_repos_notify_load_node_done, the source revision, if
+  /** For #svn_repos_notify_load_txn_committed, the source revision, if
       different from @a new_revision, otherwise #SVN_INVALID_REVNUM.
-      For #svn_repos_notify_load_txn_start, the source revision. */
+      For #svn_repos_notify_load_txn_start and
+      #svn_repos_notify_load_skipped_rev, the source revision. */
   svn_revnum_t old_revision;
 
   /** For #svn_repos_notify_load_node_start, the action being taken on the
@@ -2197,9 +2198,7 @@ svn_repos_fs_begin_txn_for_update(svn_fs
  *
  * If an error occurs when running the post-lock hook the error is
  * returned wrapped with #SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED.  If the
- * caller sees this error, it knows that some locks succeeded.  In
- * all cases the caller must handle all errors in @a results to avoid
- * leaks.
+ * caller sees this error, it knows that some locks succeeded.
  *
  * The pre-lock hook may cause a different token to be used for the
  * lock, instead of the token supplied; see the pre-lock-hook
@@ -2255,8 +2254,7 @@ svn_repos_fs_lock(svn_lock_t **lock,
  * If an error occurs when running the post-unlock hook, return the
  * original error wrapped with #SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED.
  * If the caller sees this error, it knows that some unlocks
- * succeeded.  In all cases the caller must handle all errors in @a
- * *results to avoid leaks.
+ * succeeded.
  *
  * The path passed to @a lock_callback will be allocated in @a result_pool.
  * Use @a scratch_pool for temporary allocations.

Modified: subversion/branches/remote-only-status/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_client/info.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_client/info.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_client/info.c Wed Apr  9 15:22:07 2014
@@ -442,9 +442,7 @@ svn_client_info4(const char *abspath_or_
                                   pool);
 
           /* Catch specific errors thrown by old mod_dav_svn or svnserve. */
-          if (err &&
-              (err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED
-               || err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE))
+          if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
             {
               svn_error_clear(err);
               locks = apr_hash_make(pool); /* use an empty hash */

Modified: subversion/branches/remote-only-status/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_client/status.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_client/status.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_client/status.c Wed Apr  9 15:22:07 2014
@@ -197,8 +197,7 @@ reporter_finish_report(void *report_bato
      server doesn't support lock discovery, we'll just not do locky
      stuff. */
   err = svn_ra_get_locks2(ras, &locks, "", rb->depth, rb->pool);
-  if (err && ((err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
-              || (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)))
+  if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
     {
       svn_error_clear(err);
       err = SVN_NO_ERROR;

Modified: subversion/branches/remote-only-status/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_client/update.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_client/update.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_client/update.c Wed Apr  9 15:22:07 2014
@@ -402,8 +402,10 @@ update_internal(svn_revnum_t *result_rev
     {
       SVN_ERR(svn_client__open_ra_session_internal(&ra_session, &corrected_url,
                                                    anchor_url,
-                                                   anchor_abspath, NULL, TRUE,
-                                                   TRUE, ctx, pool, pool));
+                                                   anchor_abspath, NULL,
+                                                   TRUE /* write_dav_props */,
+                                                   TRUE /* read_dav_props */,
+                                                   ctx, pool, pool));
       *ra_session_p = ra_session;
     }
 

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.c Wed Apr  9 15:22:07 2014
@@ -1582,30 +1582,6 @@ svn_fs_set_uuid(svn_fs_t *fs, const char
   return svn_error_trace(fs->vtable->set_uuid(fs, uuid, pool));
 }
 
-struct lock_many_baton_t {
-  svn_fs_lock_callback_t lock_callback;
-  void *lock_baton;
-  svn_error_t *cb_err;
-};
-
-/* Implements svn_fs_lock_callback_t.  Used by svn_fs_lock_many and
-   svn_fs_unlock_many to forward to the supplied callback and record
-   any error from the callback. */
-static svn_error_t *
-lock_many_cb(void *lock_baton,
-             const char *path,
-             const svn_lock_t *lock,
-             svn_error_t *fs_err,
-             apr_pool_t *pool)
-{
-  struct lock_many_baton_t *b = lock_baton;
-
-  if (!b->cb_err)
-    b->cb_err = b->lock_callback(b->lock_baton, path, lock, fs_err, pool);
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_lock_many(svn_fs_t *fs,
                  apr_hash_t *targets,
@@ -1621,7 +1597,6 @@ svn_fs_lock_many(svn_fs_t *fs,
   apr_hash_index_t *hi;
   apr_hash_t *ok_targets = apr_hash_make(scratch_pool);
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
-  struct lock_many_baton_t baton;
 
   /* Enforce that the comment be xml-escapable. */
   if (comment)
@@ -1681,19 +1656,15 @@ svn_fs_lock_many(svn_fs_t *fs,
   if (!apr_hash_count(ok_targets))
     return svn_error_trace(cb_err);
 
-  baton.lock_callback = lock_callback;
-  baton.lock_baton = lock_baton;
-  baton.cb_err = cb_err;
-
   err = fs->vtable->lock(fs, ok_targets, comment, is_dav_comment,
                          expiration_date, steal_lock,
-                         lock_many_cb, &baton,
+                         lock_callback, lock_baton,
                          result_pool, scratch_pool);
 
-  if (err && baton.cb_err)
-    svn_error_compose(err, baton.cb_err);
+  if (err && cb_err)
+    svn_error_compose(err, cb_err);
   else if (!err)
-    err = baton.cb_err;
+    err = cb_err;
 
   return svn_error_trace(err);
 }
@@ -1758,6 +1729,26 @@ svn_fs_generate_lock_token(const char **
   return svn_error_trace(fs->vtable->generate_lock_token(token, fs, pool));
 }
 
+svn_fs_lock_target_t *
+svn_fs_lock_target_create(const char *token,
+                          svn_revnum_t current_rev,
+                          apr_pool_t *pool)
+{
+  svn_fs_lock_target_t *target = apr_palloc(pool, sizeof(svn_fs_lock_target_t));
+
+  target->token = token;
+  target->current_rev = current_rev;
+
+  return target;
+}
+
+void
+svn_fs_lock_target_set_token(svn_fs_lock_target_t *target,
+                             const char *token)
+{
+  target->token = token;
+}
+
 svn_error_t *
 svn_fs_unlock_many(svn_fs_t *fs,
                    apr_hash_t *targets,

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs/fs-loader.h Wed Apr  9 15:22:07 2014
@@ -548,6 +548,11 @@ struct svn_fs_access_t
   apr_hash_t *lock_tokens;
 };
 
+struct svn_fs_lock_target_t
+{
+  const char *token;
+  svn_revnum_t current_rev;
+};
 
 
 #ifdef __cplusplus

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.c Wed Apr  9 15:22:07 2014
@@ -1342,7 +1342,7 @@ svn_fs_base__dag_finalize_edits(dag_node
 
 
 dag_node_t *
-svn_fs_base__dag_dup(dag_node_t *node,
+svn_fs_base__dag_dup(const dag_node_t *node,
                      apr_pool_t *pool)
 {
   /* Allocate our new node. */

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_base/dag.h Wed Apr  9 15:22:07 2014
@@ -82,7 +82,7 @@ svn_error_t *svn_fs_base__dag_get_node(d
 
 /* Return a new dag_node_t object referring to the same node as NODE,
    allocated in POOL.  */
-dag_node_t *svn_fs_base__dag_dup(dag_node_t *node,
+dag_node_t *svn_fs_base__dag_dup(const dag_node_t *node,
                                  apr_pool_t *pool);
 
 

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.c Wed Apr  9 15:22:07 2014
@@ -70,6 +70,7 @@ delete_lock_and_token(const char *lock_t
 }
 
 
+/* The effective arguments for txn_body_lock() below. */
 struct lock_args
 {
   svn_lock_t **lock_p;
@@ -80,9 +81,19 @@ struct lock_args
   svn_boolean_t steal_lock;
   apr_time_t expiration_date;
   svn_revnum_t current_rev;
+  apr_pool_t *result_pool;
 };
 
 
+/* The body of svn_fs_base__lock(), which see.
+
+   BATON is a 'struct lock_args *' holding the effective arguments.
+   BATON->path is the canonical abspath to lock.  Set *BATON->lock_p
+   to the resulting lock.  For the other arguments, see
+   svn_fs_lock_many().
+
+   This implements the svn_fs_base__retry_txn() 'body' callback type.
+ */
 static svn_error_t *
 txn_body_lock(void *baton, trail_t *trail)
 {
@@ -196,15 +207,15 @@ txn_body_lock(void *baton, trail_t *trai
     }
 
   /* Create a new lock, and add it to the tables. */
-  lock = svn_lock_create(trail->pool);
+  lock = svn_lock_create(args->result_pool);
   if (args->token)
-    lock->token = apr_pstrdup(trail->pool, args->token);
+    lock->token = apr_pstrdup(args->result_pool, args->token);
   else
     SVN_ERR(svn_fs_base__generate_lock_token(&(lock->token), trail->fs,
-                                             trail->pool));
-  lock->path = apr_pstrdup(trail->pool, args->path);
-  lock->owner = apr_pstrdup(trail->pool, trail->fs->access_ctx->username);
-  lock->comment = apr_pstrdup(trail->pool, args->comment);
+                                             args->result_pool));
+  lock->path = args->path; /* Already in result_pool. */
+  lock->owner = apr_pstrdup(args->result_pool, trail->fs->access_ctx->username);
+  lock->comment = apr_pstrdup(args->result_pool, args->comment);
   lock->is_dav_comment = args->is_dav_comment;
   lock->creation_date = apr_time_now();
   lock->expiration_date = args->expiration_date;
@@ -249,11 +260,12 @@ svn_fs_base__lock(svn_fs_t *fs,
       args.steal_lock = steal_lock;
       args.expiration_date = expiration_date;
       args.current_rev = target->current_rev;
+      args.result_pool = result_pool;
       
-      err = svn_fs_base__retry_txn(fs, txn_body_lock, &args, FALSE,
+      err = svn_fs_base__retry_txn(fs, txn_body_lock, &args, TRUE,
                                    scratch_pool);
       if (!cb_err && lock_callback)
-        cb_err = lock_callback(lock_baton, path, lock, err, scratch_pool);
+        cb_err = lock_callback(lock_baton, args.path, lock, err, scratch_pool);
       svn_error_clear(err);
     }
 
@@ -276,6 +288,7 @@ svn_fs_base__generate_lock_token(const c
 }
 
 
+/* The effective arguments for txn_body_unlock() below. */
 struct unlock_args
 {
   const char *path;
@@ -284,6 +297,14 @@ struct unlock_args
 };
 
 
+/* The body of svn_fs_base__unlock(), which see.
+
+   BATON is a 'struct unlock_args *' holding the effective arguments.
+   BATON->path is the canonical path and BATON->token is the token.
+   For the other arguments, see svn_fs_unlock_many().
+
+   This implements the svn_fs_base__retry_txn() 'body' callback type.
+ */
 static svn_error_t *
 txn_body_unlock(void *baton, trail_t *trail)
 {
@@ -356,7 +377,7 @@ svn_fs_base__unlock(svn_fs_t *fs,
       svn_error_clear(err);
     }
 
-  return SVN_NO_ERROR;
+  return svn_error_trace(cb_err);
 }
 
 

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_base/lock.h Wed Apr  9 15:22:07 2014
@@ -33,8 +33,9 @@ extern "C" {
 
 
 /* These functions implement part of the FS loader library's fs
-   vtables.  See the public svn_fs.h for docstrings.*/
+   vtables. */
 
+/* See svn_fs_lock(), svn_fs_lock_many(). */
 svn_error_t *svn_fs_base__lock(svn_fs_t *fs,
                                apr_hash_t *targets,
                                const char *comment,
@@ -46,10 +47,12 @@ svn_error_t *svn_fs_base__lock(svn_fs_t 
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool);
 
+/* See svn_fs_generate_lock_token(). */
 svn_error_t *svn_fs_base__generate_lock_token(const char **token,
                                               svn_fs_t *fs,
                                               apr_pool_t *pool);
 
+/* See svn_fs_unlock(), svn_fs_unlock_many(). */
 svn_error_t *svn_fs_base__unlock(svn_fs_t *fs,
                                  apr_hash_t *targets,
                                  svn_boolean_t break_lock,
@@ -58,11 +61,13 @@ svn_error_t *svn_fs_base__unlock(svn_fs_
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool);
 
+/* See svn_fs_get_lock(). */
 svn_error_t *svn_fs_base__get_lock(svn_lock_t **lock,
                                    svn_fs_t *fs,
                                    const char *path,
                                    apr_pool_t *pool);
 
+/* See svn_fs_get_locks2(). */
 svn_error_t *
 svn_fs_base__get_locks(svn_fs_t *fs,
                        const char *path,

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/cached_data.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/cached_data.c Wed Apr  9 15:22:07 2014
@@ -2928,18 +2928,24 @@ block_read(void **result,
 
       /* if the revision got packed in the meantime and we still need
        * to actually read some item, we retry the whole process */
-      if (err &&
-          revision_file->is_packed != svn_fs_fs__is_packed_rev(fs, revision))
+      if (err)
         {
-          if (result && !*result)
+          /* We failed for the first time. Refresh cache & retry. */
+          SVN_ERR(svn_fs_fs__update_min_unpacked_rev(fs, scratch_pool));
+          if (   revision_file->is_packed
+              != svn_fs_fs__is_packed_rev(fs, revision))
             {
-              SVN_ERR(svn_fs_fs__reopen_revision_file(revision_file, fs, 
-                                                      revision));
-              SVN_ERR(block_read(result, fs, revision, item_index,
-                                  revision_file, result_pool, scratch_pool));
-            }
+              if (result && !*result)
+                {
+                  SVN_ERR(svn_fs_fs__reopen_revision_file(revision_file, fs, 
+                                                          revision));
+                  SVN_ERR(block_read(result, fs, revision, item_index,
+                                     revision_file, result_pool,
+                                     scratch_pool));
+                }
 
-          return SVN_NO_ERROR;
+              return SVN_NO_ERROR;
+            }
         }
 
       SVN_ERR(err);

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/hotcopy.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/hotcopy.c Wed Apr  9 15:22:07 2014
@@ -867,20 +867,8 @@ hotcopy_body(void *baton, apr_pool_t *po
                                       rev, max_files_per_dir, FALSE,
                                       iterpool));
 
-      /* After completing a full shard, update 'current'.  For non-sharded
-       * repositories, update after every revision.
-       * 
-       * This "checkpoints" the progress we made so far and prevents us from
-       * starting all over again if the hotcopy process got canceled.  It is
-       * not _necessary_ to update "current" until the very end (see further
-       * below); it's a performance trade-off between different scenarios.
-       *
-       * Repositories with global IDs must do a full repo scan here to find
-       * the latest IDs.  Because that's too expensive, we don't checkpoint
-       * pre-1.4 repositories.
-       */
-      if (   (!max_files_per_dir || rev % max_files_per_dir == 0)
-          && dst_ffd->format >= SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT)
+      /* After completing a full shard, update 'current'. */
+      if (max_files_per_dir && rev % max_files_per_dir == 0)
         SVN_ERR(hotcopy_update_current(&dst_youngest, dst_fs, rev, iterpool));
     }
   svn_pool_destroy(iterpool);

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.c Wed Apr  9 15:22:07 2014
@@ -1600,6 +1600,36 @@ svn_fs_fs__p2l_proto_index_add_entry(apr
 }
 
 svn_error_t *
+svn_fs_fs__p2l_proto_index_next_offset(apr_off_t *next_offset,
+                                       apr_file_t *proto_index,
+                                       apr_pool_t *pool)
+{
+  apr_off_t offset = 0;
+
+  /* Empty index file? */
+  SVN_ERR(svn_io_file_seek(proto_index, APR_END, &offset, pool));
+  if (offset == 0)
+    {
+      *next_offset = 0;
+    }
+  else
+    {
+      /* At least one entry.  Read last entry. */
+      svn_fs_fs__p2l_entry_t entry;
+      offset -= sizeof(entry);
+
+      SVN_ERR(svn_io_file_seek(proto_index, APR_SET, &offset, pool));
+      SVN_ERR(svn_io_file_read_full2(proto_index, &entry, sizeof(entry),
+                                    NULL, NULL, pool));
+
+      /* Return next offset. */
+      *next_offset = entry.offset + entry.size;
+    }
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_fs_fs__p2l_index_create(svn_fs_t *fs,
                             const char *file_name,
                             const char *proto_file_name,

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/index.h Wed Apr  9 15:22:07 2014
@@ -136,6 +136,15 @@ svn_fs_fs__p2l_proto_index_add_entry(apr
                                      svn_fs_fs__p2l_entry_t *entry,
                                      apr_pool_t *pool);
 
+/* Set *NEXT_OFFSET to the first offset behind the last entry in the
+ * phys-to-log proto index file PROTO_INDEX.  This will be 0 for empty
+ * index files.  Use POOL for temporary allocations.
+ */
+svn_error_t *
+svn_fs_fs__p2l_proto_index_next_offset(apr_off_t *next_offset,
+                                       apr_file_t *proto_index,
+                                       apr_pool_t *pool);
+
 /* Use the proto index file stored at PROTO_FILE_NAME and construct the
  * final phys-to-log index file at FILE_NAME.  Entries without a valid
  * revision will be assigned to the REVISION given here.

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.c Wed Apr  9 15:22:07 2014
@@ -715,7 +715,7 @@ svn_fs_fs__allow_locked_operation(const 
   return SVN_NO_ERROR;
 }
 
-/* Baton used for lock_body below. */
+/* The effective arguments for lock_body() below. */
 struct lock_baton {
   svn_fs_t *fs;
   apr_array_header_t *targets;
@@ -832,9 +832,17 @@ struct lock_info_t {
   svn_error_t *fs_err;
 };
 
-/* This implements the svn_fs_fs__with_write_lock() 'body' callback
+/* The body of svn_fs_fs__lock(), which see.
+
+   BATON is a 'struct lock_baton *' holding the effective arguments.
+   BATON->targets is an array of 'svn_sort__item_t' targets, sorted by
+   path, mapping canonical path to 'svn_fs_lock_target_t'.  Set
+   BATON->infos to an array of 'lock_info_t' holding the results.  For
+   the other arguments, see svn_fs_lock_many().
+
+   This implements the svn_fs_fs__with_write_lock() 'body' callback
    type, and assumes that the write lock is held.
-   BATON is a 'struct lock_baton *'. */
+ */
 static svn_error_t *
 lock_body(void *baton, apr_pool_t *pool)
 {
@@ -984,10 +992,12 @@ lock_body(void *baton, apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+/* The effective arguments for unlock_body() below. */
 struct unlock_baton {
   svn_fs_t *fs;
   apr_array_header_t *targets;
   apr_array_header_t *infos;
+  /* Set skip_check TRUE to prevent the checks that set infos[].fs_err. */
   svn_boolean_t skip_check;
   svn_boolean_t break_lock;
   apr_pool_t *result_pool;
@@ -1021,9 +1031,21 @@ struct unlock_info_t {
   const char *path;
   const char *component;
   svn_error_t *fs_err;
+  svn_boolean_t done;
   int components;
 };
 
+/* The body of svn_fs_fs__unlock(), which see.
+
+   BATON is a 'struct unlock_baton *' holding the effective arguments.
+   BATON->targets is an array of 'svn_sort__item_t' targets, sorted by
+   path, mapping canonical path to (const char *) token.  Set
+   BATON->infos to an array of 'unlock_info_t' results.  For the other
+   arguments, see svn_fs_unlock_many().
+
+   This implements the svn_fs_fs__with_write_lock() 'body' callback
+   type, and assumes that the write lock is held.
+ */
 static svn_error_t *
 unlock_body(void *baton, apr_pool_t *pool)
 {
@@ -1095,6 +1117,7 @@ unlock_body(void *baton, apr_pool_t *poo
               if (info->components == i)
                 {
                   SVN_ERR(delete_lock(ub->fs->path, info->path, iterpool));
+                  info->done = TRUE;
                 }
               else if (info->components > i)
                 {
@@ -1137,6 +1160,10 @@ unlock_body(void *baton, apr_pool_t *poo
   return SVN_NO_ERROR;
 }
 
+/* Unlock the lock described by LOCK->path and LOCK->token in FS.
+
+   This assumes that the write lock is held.
+ */
 static svn_error_t *
 unlock_single(svn_fs_t *fs,
               svn_lock_t *lock,
@@ -1156,6 +1183,7 @@ unlock_single(svn_fs_t *fs,
   ub.skip_check = TRUE;
   ub.result_pool = pool;
 
+  /* No ub.infos[].fs_err error because skip_check is TRUE. */
   SVN_ERR(unlock_body(&ub, pool));
 
   return SVN_NO_ERROR;
@@ -1178,7 +1206,7 @@ svn_fs_fs__lock(svn_fs_t *fs,
 {
   struct lock_baton lb;
   apr_array_header_t *sorted_targets;
-  apr_hash_t *cannonical_targets = apr_hash_make(scratch_pool);
+  apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
@@ -1189,8 +1217,8 @@ svn_fs_fs__lock(svn_fs_t *fs,
   if (!fs->access_ctx || !fs->access_ctx->username)
     return SVN_FS__ERR_NO_USER(fs);
 
-  /* The FS locking API allows both cannonical and non-cannonical
-     paths which means that the same cannonical path could be
+  /* The FS locking API allows both canonical and non-canonical
+     paths which means that the same canonical path could be
      represented more than once in the TARGETS hash.  We just keep
      one, choosing one with a token if possible. */
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
@@ -1200,13 +1228,13 @@ svn_fs_fs__lock(svn_fs_t *fs,
       const svn_fs_lock_target_t *other;
 
       path = svn_fspath__canonicalize(path, result_pool);
-      other = svn_hash_gets(cannonical_targets, path);
+      other = svn_hash_gets(canonical_targets, path);
 
       if (!other || (!other->token && target->token))
-        svn_hash_sets(cannonical_targets, path, target);
+        svn_hash_sets(canonical_targets, path, target);
     }
 
-  sorted_targets = svn_sort__hash(cannonical_targets,
+  sorted_targets = svn_sort__hash(canonical_targets,
                                   svn_sort_compare_items_as_paths,
                                   scratch_pool);
 
@@ -1224,8 +1252,15 @@ svn_fs_fs__lock(svn_fs_t *fs,
       struct lock_info_t *info = &APR_ARRAY_IDX(lb.infos, i,
                                                 struct lock_info_t);
       if (!cb_err && lock_callback)
-        cb_err = lock_callback(lock_baton, info->path, info->lock,
-                               info->fs_err, scratch_pool);
+        {
+          if (!info->lock && !info->fs_err)
+            info->fs_err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED,
+                                             0, _("Failed to lock '%s'"),
+                                             info->path);
+                                             
+          cb_err = lock_callback(lock_baton, info->path, info->lock,
+                                 info->fs_err, scratch_pool);
+        }
       svn_error_clear(info->fs_err);
     }
 
@@ -1265,7 +1300,7 @@ svn_fs_fs__unlock(svn_fs_t *fs,
 {
   struct unlock_baton ub;
   apr_array_header_t *sorted_targets;
-  apr_hash_t *cannonical_targets = apr_hash_make(scratch_pool);
+  apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
@@ -1283,13 +1318,13 @@ svn_fs_fs__unlock(svn_fs_t *fs,
       const char *other;
 
       path = svn_fspath__canonicalize(path, result_pool);
-      other = svn_hash_gets(cannonical_targets, path);
+      other = svn_hash_gets(canonical_targets, path);
 
       if (!other)
-        svn_hash_sets(cannonical_targets, path, token);
+        svn_hash_sets(canonical_targets, path, token);
     }
 
-  sorted_targets = svn_sort__hash(cannonical_targets,
+  sorted_targets = svn_sort__hash(canonical_targets,
                                   svn_sort_compare_items_as_paths,
                                   scratch_pool);
 
@@ -1305,8 +1340,14 @@ svn_fs_fs__unlock(svn_fs_t *fs,
       struct unlock_info_t *info = &APR_ARRAY_IDX(ub.infos, i,
                                                   struct unlock_info_t);
       if (!cb_err && lock_callback)
-        cb_err = lock_callback(lock_baton, info->path, NULL, info->fs_err,
-                               scratch_pool);
+        {
+          if (!info->done && !info->fs_err)
+            info->fs_err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED,
+                                             0, _("Failed to unlock '%s'"),
+                                             info->path);
+          cb_err = lock_callback(lock_baton, info->path, NULL, info->fs_err,
+                                 scratch_pool);
+        }
       svn_error_clear(info->fs_err);
     }
 

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/lock.h Wed Apr  9 15:22:07 2014
@@ -32,6 +32,7 @@ extern "C" {
 /* These functions implement some of the calls in the FS loader
    library's fs vtables. */
 
+/* See svn_fs_lock(), svn_fs_lock_many(). */
 svn_error_t *svn_fs_fs__lock(svn_fs_t *fs,
                              apr_hash_t *targets,
                              const char *comment,
@@ -43,10 +44,12 @@ svn_error_t *svn_fs_fs__lock(svn_fs_t *f
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool);
 
+/* See svn_fs_generate_lock_token(). */
 svn_error_t *svn_fs_fs__generate_lock_token(const char **token,
                                             svn_fs_t *fs,
                                             apr_pool_t *pool);
 
+/* See svn_fs_unlock(), svn_fs_unlock_many(). */
 svn_error_t *svn_fs_fs__unlock(svn_fs_t *fs,
                                apr_hash_t *targets,
                                svn_boolean_t break_lock,
@@ -55,11 +58,13 @@ svn_error_t *svn_fs_fs__unlock(svn_fs_t 
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool);
 
+/* See svn_fs_get_lock(). */
 svn_error_t *svn_fs_fs__get_lock(svn_lock_t **lock,
                                  svn_fs_t *fs,
                                  const char *path,
                                  apr_pool_t *pool);
 
+/* See svn_fs_get_locks2(). */
 svn_error_t *svn_fs_fs__get_locks(svn_fs_t *fs,
                                   const char *path,
                                   svn_depth_t depth,

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_fs/transaction.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_fs/transaction.c Wed Apr  9 15:22:07 2014
@@ -395,6 +395,51 @@ get_writable_proto_rev_body(svn_fs_t *fs
   return SVN_NO_ERROR;
 }
 
+/* Make sure the length ACTUAL_LENGTH of the proto-revision file PROTO_REV
+   of transaction TXN_ID in filesystem FS matches the proto-index file.
+   Trim any crash / failure related extra data from the proto-rev file.
+
+   If the prototype revision file is too short, we can't do much but bail out.
+
+   Perform all allocations in POOL. */
+static svn_error_t *
+auto_truncate_proto_rev(svn_fs_t *fs,
+                        apr_file_t *proto_rev,
+                        apr_off_t actual_length,
+                        const svn_fs_fs__id_part_t *txn_id,
+                        apr_pool_t *pool)
+{
+  /* Only relevant for newer FSFS formats. */
+  if (svn_fs_fs__use_log_addressing(fs, txn_id->revision))
+    {
+      /* Determine file range covered by the proto-index so far.  Note that
+         we always append to both file, i.e. the last index entry also
+         corresponds to the last addition in the rev file. */
+      const char *path = svn_fs_fs__path_p2l_proto_index(fs, txn_id, pool);
+      apr_file_t *file;
+      apr_off_t indexed_length;
+
+      SVN_ERR(svn_fs_fs__p2l_proto_index_open(&file, path, pool));
+      SVN_ERR(svn_fs_fs__p2l_proto_index_next_offset(&indexed_length, file,
+                                                     pool));
+      SVN_ERR(svn_io_file_close(file, pool));
+
+      /* Handle mismatches. */
+      if (indexed_length < actual_length)
+        SVN_ERR(svn_io_file_trunc(proto_rev, indexed_length, pool));
+      else if (indexed_length > actual_length)
+        return svn_error_createf(SVN_ERR_FS_ITEM_INDEX_INCONSISTENT,
+                                 NULL,
+                                 _("p2l proto index offset %s beyond proto"
+                                   "rev file size %s for TXN %s"),
+                                   apr_off_t_toa(pool, indexed_length),
+                                   apr_off_t_toa(pool, actual_length),
+                                   svn_fs_fs__id_txn_unparse(txn_id, pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Get a handle to the prototype revision file for transaction TXN_ID in
    filesystem FS, and lock it for writing.  Return FILE, a file handle
    positioned at the end of the file, and LOCKCOOKIE, a cookie that
@@ -414,6 +459,7 @@ get_writable_proto_rev(apr_file_t **file
 {
   struct get_writable_proto_rev_baton b;
   svn_error_t *err;
+  apr_off_t end_offset = 0;
 
   b.lockcookie = lockcookie;
   b.txn_id = *txn_id;
@@ -434,10 +480,15 @@ get_writable_proto_rev(apr_file_t **file
      the APR file pointer to the OS file pointer (since we need to be
      able to read the current file position later). */
   if (!err)
-    {
-      apr_off_t offset = 0;
-      err = svn_io_file_seek(*file, APR_END, &offset, pool);
-    }
+    err = svn_io_file_seek(*file, APR_END, &end_offset, pool);
+
+  /* We don't want unused sections (such as leftovers from failed delta
+     stream) in our file.  If we use log addressing, we would need an
+     index entry for the unused section and that section would need to 
+     be all NUL by convention.  So, detect and fix those cases by truncating
+     the protorev file. */
+  if (!err)
+    err = auto_truncate_proto_rev(fs, *file, end_offset, txn_id, pool);
 
   if (err)
     {

Propchange: subversion/branches/remote-only-status/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/libsvn_fs_x:r1584343-1585988

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.c Wed Apr  9 15:22:07 2014
@@ -1634,7 +1634,7 @@ svn_fs_x__l2p_get_max_ids(apr_array_head
  * phys-to-log index
  */
 svn_fs_x__p2l_entry_t *
-svn_fs_x__p2l_entry_dup(svn_fs_x__p2l_entry_t *entry,
+svn_fs_x__p2l_entry_dup(const svn_fs_x__p2l_entry_t *entry,
                         apr_pool_t *pool)
 {
   svn_fs_x__p2l_entry_t *new_entry = apr_palloc(pool, sizeof(*new_entry));

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_x/index.h Wed Apr  9 15:22:07 2014
@@ -79,7 +79,7 @@ typedef struct svn_fs_x__p2l_entry_t
 /* Return a (deep) copy of ENTRY, allocated in POOL.
  */
 svn_fs_x__p2l_entry_t *
-svn_fs_x__p2l_entry_dup(svn_fs_x__p2l_entry_t *entry,
+svn_fs_x__p2l_entry_dup(const svn_fs_x__p2l_entry_t *entry,
                         apr_pool_t *pool);
 
 /* Open / create a log-to-phys index file with the full file path name

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.c Wed Apr  9 15:22:07 2014
@@ -715,7 +715,7 @@ svn_fs_x__allow_locked_operation(const c
   return SVN_NO_ERROR;
 }
 
-/* Baton used for lock_body below. */
+/* The effective arguments for lock_body() below. */
 struct lock_baton {
   svn_fs_t *fs;
   apr_array_header_t *targets;
@@ -832,9 +832,17 @@ struct lock_info_t {
   svn_error_t *fs_err;
 };
 
-/* This implements the svn_fs_x__with_write_lock() 'body' callback
+/* The body of svn_fs_x__lock(), which see.
+
+   BATON is a 'struct lock_baton *' holding the effective arguments.
+   BATON->targets is an array of 'svn_sort__item_t' targets, sorted by
+   path, mapping canonical path to 'svn_fs_lock_target_t'.  Set
+   BATON->infos to an array of 'lock_info_t' holding the results.  For
+   the other arguments, see svn_fs_lock_many().
+
+   This implements the svn_fs_x__with_write_lock() 'body' callback
    type, and assumes that the write lock is held.
-   BATON is a 'struct lock_baton *'. */
+ */
 static svn_error_t *
 lock_body(void *baton, apr_pool_t *pool)
 {
@@ -984,10 +992,12 @@ lock_body(void *baton, apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+/* The effective arguments for unlock_body() below. */
 struct unlock_baton {
   svn_fs_t *fs;
   apr_array_header_t *targets;
   apr_array_header_t *infos;
+  /* Set skip_check TRUE to prevent the checks that set infos[].fs_err. */
   svn_boolean_t skip_check;
   svn_boolean_t break_lock;
   apr_pool_t *result_pool;
@@ -1021,9 +1031,21 @@ struct unlock_info_t {
   const char *path;
   const char *component;
   svn_error_t *fs_err;
+  svn_boolean_t done;
   int components;
 };
 
+/* The body of svn_fs_x__unlock(), which see.
+
+   BATON is a 'struct unlock_baton *' holding the effective arguments.
+   BATON->targets is an array of 'svn_sort__item_t' targets, sorted by
+   path, mapping canonical path to (const char *) token.  Set
+   BATON->infos to an array of 'unlock_info_t' results.  For the other
+   arguments, see svn_fs_unlock_many().
+
+   This implements the svn_fs_x__with_write_lock() 'body' callback
+   type, and assumes that the write lock is held.
+ */
 static svn_error_t *
 unlock_body(void *baton, apr_pool_t *pool)
 {
@@ -1095,6 +1117,7 @@ unlock_body(void *baton, apr_pool_t *poo
               if (info->components == i)
                 {
                   SVN_ERR(delete_lock(ub->fs->path, info->path, iterpool));
+                  info->done = TRUE;
                 }
               else if (info->components > i)
                 {
@@ -1137,6 +1160,10 @@ unlock_body(void *baton, apr_pool_t *poo
   return SVN_NO_ERROR;
 }
 
+/* Unlock the lock described by LOCK->path and LOCK->token in FS.
+
+   This assumes that the write lock is held.
+ */
 static svn_error_t *
 unlock_single(svn_fs_t *fs,
               svn_lock_t *lock,
@@ -1156,6 +1183,7 @@ unlock_single(svn_fs_t *fs,
   ub.skip_check = TRUE;
   ub.result_pool = pool;
 
+  /* No ub.infos[].fs_err error because skip_check is TRUE. */
   SVN_ERR(unlock_body(&ub, pool));
 
   return SVN_NO_ERROR;
@@ -1178,7 +1206,7 @@ svn_fs_x__lock(svn_fs_t *fs,
 {
   struct lock_baton lb;
   apr_array_header_t *sorted_targets;
-  apr_hash_t *cannonical_targets = apr_hash_make(scratch_pool);
+  apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
@@ -1189,8 +1217,8 @@ svn_fs_x__lock(svn_fs_t *fs,
   if (!fs->access_ctx || !fs->access_ctx->username)
     return SVN_FS__ERR_NO_USER(fs);
 
-  /* The FS locking API allows both cannonical and non-cannonical
-     paths which means that the same cannonical path could be
+  /* The FS locking API allows both canonical and non-canonical
+     paths which means that the same canonical path could be
      represented more than once in the TARGETS hash.  We just keep
      one, choosing one with a token if possible. */
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
@@ -1200,13 +1228,13 @@ svn_fs_x__lock(svn_fs_t *fs,
       const svn_fs_lock_target_t *other;
 
       path = svn_fspath__canonicalize(path, result_pool);
-      other = svn_hash_gets(cannonical_targets, path);
+      other = svn_hash_gets(canonical_targets, path);
 
       if (!other || (!other->token && target->token))
-        svn_hash_sets(cannonical_targets, path, target);
+        svn_hash_sets(canonical_targets, path, target);
     }
 
-  sorted_targets = svn_sort__hash(cannonical_targets,
+  sorted_targets = svn_sort__hash(canonical_targets,
                                   svn_sort_compare_items_as_paths,
                                   scratch_pool);
 
@@ -1224,8 +1252,15 @@ svn_fs_x__lock(svn_fs_t *fs,
       struct lock_info_t *info = &APR_ARRAY_IDX(lb.infos, i,
                                                 struct lock_info_t);
       if (!cb_err && lock_callback)
-        cb_err = lock_callback(lock_baton, info->path, info->lock,
-                               info->fs_err, scratch_pool);
+        {
+          if (!info->lock && !info->fs_err)
+            info->fs_err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED,
+                                             0, _("Failed to lock '%s'"),
+                                             info->path);
+                                             
+          cb_err = lock_callback(lock_baton, info->path, info->lock,
+                                 info->fs_err, scratch_pool);
+        }
       svn_error_clear(info->fs_err);
     }
 
@@ -1265,7 +1300,7 @@ svn_fs_x__unlock(svn_fs_t *fs,
 {
   struct unlock_baton ub;
   apr_array_header_t *sorted_targets;
-  apr_hash_t *cannonical_targets = apr_hash_make(scratch_pool);
+  apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
@@ -1283,13 +1318,13 @@ svn_fs_x__unlock(svn_fs_t *fs,
       const char *other;
 
       path = svn_fspath__canonicalize(path, result_pool);
-      other = svn_hash_gets(cannonical_targets, path);
+      other = svn_hash_gets(canonical_targets, path);
 
       if (!other)
-        svn_hash_sets(cannonical_targets, path, token);
+        svn_hash_sets(canonical_targets, path, token);
     }
 
-  sorted_targets = svn_sort__hash(cannonical_targets,
+  sorted_targets = svn_sort__hash(canonical_targets,
                                   svn_sort_compare_items_as_paths,
                                   scratch_pool);
 
@@ -1305,8 +1340,14 @@ svn_fs_x__unlock(svn_fs_t *fs,
       struct unlock_info_t *info = &APR_ARRAY_IDX(ub.infos, i,
                                                   struct unlock_info_t);
       if (!cb_err && lock_callback)
-        cb_err = lock_callback(lock_baton, info->path, NULL, info->fs_err,
-                               scratch_pool);
+        {
+          if (!info->done && !info->fs_err)
+            info->fs_err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED,
+                                             0, _("Failed to unlock '%s'"),
+                                             info->path);
+          cb_err = lock_callback(lock_baton, info->path, NULL, info->fs_err,
+                                 scratch_pool);
+        }
       svn_error_clear(info->fs_err);
     }
 

Modified: subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.h
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.h?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.h (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_fs_x/lock.h Wed Apr  9 15:22:07 2014
@@ -32,6 +32,7 @@ extern "C" {
 /* These functions implement some of the calls in the FS loader
    library's fs vtables. */
 
+/* See svn_fs_lock(), svn_fs_lock_many(). */
 svn_error_t *svn_fs_x__lock(svn_fs_t *fs,
                             apr_hash_t *targets,
                             const char *comment,
@@ -43,10 +44,12 @@ svn_error_t *svn_fs_x__lock(svn_fs_t *fs
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 
+/* See svn_fs_generate_lock_token(). */
 svn_error_t *svn_fs_x__generate_lock_token(const char **token,
                                            svn_fs_t *fs,
                                            apr_pool_t *pool);
 
+/* See svn_fs_unlock(), svn_fs_unlock_many(). */
 svn_error_t *svn_fs_x__unlock(svn_fs_t *fs,
                               apr_hash_t *targets,
                               svn_boolean_t break_lock,
@@ -55,11 +58,13 @@ svn_error_t *svn_fs_x__unlock(svn_fs_t *
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool);
   
+/* See svn_fs_get_lock(). */
 svn_error_t *svn_fs_x__get_lock(svn_lock_t **lock,
                                 svn_fs_t *fs,
                                 const char *path,
                                 apr_pool_t *pool);
 
+/* See svn_fs_get_locks2(). */
 svn_error_t *svn_fs_x__get_locks(svn_fs_t *fs,
                                  const char *path,
                                  svn_depth_t depth,

Modified: subversion/branches/remote-only-status/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_ra_local/ra_plugin.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_ra_local/ra_plugin.c Wed Apr  9 15:22:07 2014
@@ -1428,10 +1428,10 @@ svn_ra_local__lock(svn_ra_session_t *ses
       const char *abs_path = svn_fspath__join(sess->fs_path->data,
                                               svn__apr_hash_index_key(hi),
                                               pool);
-      svn_fs_lock_target_t *target = apr_palloc(pool,
-                                                sizeof(svn_fs_lock_target_t));
-      target->token = NULL;
-      target->current_rev = *(svn_revnum_t *)svn__apr_hash_index_val(hi);
+      svn_revnum_t current_rev = *(svn_revnum_t *)svn__apr_hash_index_val(hi);
+      svn_fs_lock_target_t *target = svn_fs_lock_target_create(NULL,
+                                                               current_rev,
+                                                               pool);
 
       svn_hash_sets(targets, abs_path, target);
     }

Modified: subversion/branches/remote-only-status/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_ra_serf/getlocks.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_ra_serf/getlocks.c Wed Apr  9 15:22:07 2014
@@ -241,6 +241,7 @@ svn_ra_serf__get_locks(svn_ra_session_t 
   svn_ra_serf__handler_t *handler;
   svn_ra_serf__xml_context_t *xmlctx;
   const char *req_url, *rel_path;
+  svn_error_t *err;
 
   req_url = svn_path_url_add_component2(session->session_url.path, path, pool);
   SVN_ERR(svn_ra_serf__get_relative_path(&rel_path, req_url, session,
@@ -266,22 +267,33 @@ svn_ra_serf__get_locks(svn_ra_session_t 
 
   handler->body_delegate = create_getlocks_body;
   handler->body_delegate_baton = lock_ctx;
-  handler->no_fail_on_http_failure_status = TRUE;
 
-  SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
+  err = svn_ra_serf__context_run_one(handler, pool);
+
+  if (err)
+    {
+      if (svn_error_find_cause(err, SVN_ERR_UNSUPPORTED_FEATURE))
+        {
+          /* The server told us that it doesn't support this report type.
+             We return the documented error for svn_ra_get_locks(), but
+             with the original error report */
+          return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL);
+        }
+      else if (err->apr_err == SVN_ERR_FS_NOT_FOUND)
+        {
+          /* File doesn't exist in HEAD: Not an error */
+          svn_error_clear(err);
+        }
+      else
+        return svn_error_trace(err);
+    }
 
   /* We get a 404 when a path doesn't exist in HEAD, but it might
      have existed earlier (E.g. 'svn ls http://s/svn/trunk/file@1' */
   if (handler->sline.code != 200
       && handler->sline.code != 404)
     {
-      svn_error_t *err = svn_ra_serf__unexpected_status(handler);
-
-      if (handler->sline.code == 500 || handler->sline.code == 501)
-        return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err,
-                                _("Server does not support locking features"));
-
-      return svn_error_trace(err);
+      return svn_error_trace(svn_ra_serf__unexpected_status(handler));
     }
 
   *locks = lock_ctx->hash;

Modified: subversion/branches/remote-only-status/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_ra_svn/marshal.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_ra_svn/marshal.c Wed Apr  9 15:22:07 2014
@@ -2403,7 +2403,8 @@ svn_error_t *svn_ra_svn__write_cmd_respo
 }
 
 svn_error_t *svn_ra_svn__write_cmd_failure(svn_ra_svn_conn_t *conn,
-                                           apr_pool_t *pool, svn_error_t *err)
+                                           apr_pool_t *pool,
+                                           const svn_error_t *err)
 {
   char buffer[128];
   SVN_ERR(writebuf_write_short_string(conn, pool, "( failure ( ", 12));

Modified: subversion/branches/remote-only-status/subversion/libsvn_repos/config_pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_repos/config_pool.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_repos/config_pool.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_repos/config_pool.c Wed Apr  9 15:22:07 2014
@@ -205,7 +205,7 @@ auto_parse(svn_config_t **cfg,
                    &checksum, NULL, svn_checksum_sha1, TRUE, scratch_pool)));
 
   /* return reference to suitable config object if that already exists */
-  *key = checksum_as_key(checksum, scratch_pool);
+  *key = checksum_as_key(checksum, result_pool);
   SVN_ERR(svn_object_pool__lookup((void **)cfg, config_pool->object_pool,
                                   *key, &case_sensitive, result_pool));
   if (*cfg)

Modified: subversion/branches/remote-only-status/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_repos/fs-wrap.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_repos/fs-wrap.c Wed Apr  9 15:22:07 2014
@@ -167,7 +167,7 @@ svn_repos_fs_begin_txn_for_commit2(svn_f
   if (err)
     return svn_error_compose_create(err, svn_fs_abort_txn(txn, pool));
 
-  /* We have API promise that *TXN_P is unaffected on faulure. */
+  /* We have API promise that *TXN_P is unaffected on failure. */
   *txn_p = txn;
   return SVN_NO_ERROR;
 }
@@ -598,7 +598,7 @@ svn_repos_fs_lock_many(svn_repos_t *repo
 
       target = svn__apr_hash_index_val(hi);
       if (*new_token)
-        target->token = new_token;
+        svn_fs_lock_target_set_token(target, new_token);
       svn_hash_sets(pre_targets, path, target);
     }
 
@@ -617,14 +617,18 @@ svn_repos_fs_lock_many(svn_repos_t *repo
                          is_dav_comment, expiration_date, steal_lock,
                          lock_many_cb, &baton, result_pool, iterpool);
 
-  /* If there are locks and an error should we return or run the post-lock? */
-  if (!err && baton.paths->nelts)
+  /* If there are locks run the post-lock even if there is an error. */
+  if (baton.paths->nelts)
     {
-      err = svn_repos__hooks_post_lock(repos, hooks_env, baton.paths, username,
-                                       iterpool);
-      if (err)
-        err = svn_error_create(SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED, err,
+      svn_error_t *perr = svn_repos__hooks_post_lock(repos, hooks_env,
+                                                     baton.paths, username,
+                                                     iterpool);
+      if (perr)
+        {
+          perr = svn_error_create(SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED, perr,
                             _("Locking succeeded, but post-lock hook failed"));
+          err = svn_error_compose_create(err, perr);
+        }
     }
 
   svn_pool_destroy(iterpool);
@@ -673,13 +677,12 @@ svn_repos_fs_lock(svn_lock_t **lock,
                   apr_pool_t *pool)
 {
   apr_hash_t *targets = apr_hash_make(pool);
-  svn_fs_lock_target_t target; 
+  svn_fs_lock_target_t *target = svn_fs_lock_target_create(token, current_rev,
+                                                           pool); 
   svn_error_t *err;
   struct lock_baton_t baton = {0};
 
-  target.token = token;
-  target.current_rev = current_rev;
-  svn_hash_sets(targets, path, &target);
+  svn_hash_sets(targets, path, target);
 
   err = svn_repos_fs_lock_many(repos, targets, comment, is_dav_comment,
                                expiration_date, steal_lock, lock_cb, &baton,
@@ -768,13 +771,18 @@ svn_repos_fs_unlock_many(svn_repos_t *re
   err = svn_fs_unlock_many(repos->fs, pre_targets, break_lock,
                            lock_many_cb, &baton, result_pool, iterpool);
 
-  if (!err && baton.paths->nelts)
+  /* If there are 'unlocks' run the post-unlock even if there is an error. */
+  if (baton.paths->nelts)
     {
-      err = svn_repos__hooks_post_unlock(repos, hooks_env, baton.paths,
-                                         username, iterpool);
-      if (err)
-        err = svn_error_create(SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED, err,
+      svn_error_t *perr = svn_repos__hooks_post_unlock(repos, hooks_env,
+                                                       baton.paths,
+                                                       username, iterpool);
+      if (perr)
+        {
+          perr = svn_error_create(SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED, perr,
                            _("Unlock succeeded, but post-unlock hook failed"));
+          err = svn_error_compose_create(err, perr);
+        }
     }
 
   svn_pool_destroy(iterpool);

Modified: subversion/branches/remote-only-status/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_repos/load-fs-vtable.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_repos/load-fs-vtable.c Wed Apr  9 15:22:07 2014
@@ -91,12 +91,14 @@ struct parse_baton
 
 struct revision_baton
 {
+  /* rev num from dump file */
   svn_revnum_t rev;
   svn_fs_txn_t *txn;
   svn_fs_root_t *txn_root;
 
   const svn_string_t *datestamp;
 
+  /* (rev num from dump file) minus (rev num to be committed) */
   apr_int32_t rev_offset;
   svn_boolean_t skipped;
 
@@ -519,7 +521,7 @@ new_revision_record(void **revision_bato
       pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
     }
 
-  /* If we're parsing revision 0, only the revision are (possibly)
+  /* If we're parsing revision 0, only the revision props are (possibly)
      interesting to us: when loading the stream into an empty
      filesystem, then we want new filesystem's revision 0 to have the
      same props.  Otherwise, we just ignore revision 0 in the stream. */

Modified: subversion/branches/remote-only-status/subversion/libsvn_subr/cache-memcache.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_subr/cache-memcache.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_subr/cache-memcache.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_subr/cache-memcache.c Wed Apr  9 15:22:07 2014
@@ -205,7 +205,8 @@ memcache_get(void **value_p,
         {
           svn_stringbuf_t *value = svn_stringbuf_create_empty(result_pool);
           value->data = data;
-          value->len = value->blocksize = data_len;
+          value->blocksize = data_len;
+          value->len = data_len - 1; /* account for trailing NUL */
           *value_p = value;
         }
     }
@@ -283,7 +284,7 @@ memcache_set(void *cache_void,
     {
       svn_stringbuf_t *value_str = value;
       data = value_str->data;
-      data_len = value_str->len;
+      data_len = value_str->len + 1; /* copy trailing NUL */
     }
 
   err = memcache_internal_set(cache_void, key, data, data_len, subpool);

Modified: subversion/branches/remote-only-status/subversion/libsvn_subr/config.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_subr/config.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_subr/config.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_subr/config.c Wed Apr  9 15:22:07 2014
@@ -1113,7 +1113,7 @@ svn_config_get_server_setting(svn_config
 
 svn_error_t *
 svn_config_dup(svn_config_t **cfgp,
-               svn_config_t *src,
+               const svn_config_t *src,
                apr_pool_t *pool)
 {
   apr_hash_index_t *sectidx;

Modified: subversion/branches/remote-only-status/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/libsvn_subr/error.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/remote-only-status/subversion/libsvn_subr/error.c Wed Apr  9 15:22:07 2014
@@ -355,7 +355,7 @@ svn_error_find_cause(svn_error_t *err, a
 }
 
 svn_error_t *
-svn_error_dup(svn_error_t *err)
+svn_error_dup(const svn_error_t *err)
 {
   apr_pool_t *pool;
   svn_error_t *new_err = NULL, *tmp_err = NULL;
@@ -409,7 +409,7 @@ svn_error_clear(svn_error_t *err)
 }
 
 svn_boolean_t
-svn_error__is_tracing_link(svn_error_t *err)
+svn_error__is_tracing_link(const svn_error_t *err)
 {
 #ifdef SVN_ERR__TRACING
   /* ### A strcmp()?  Really?  I think it's the best we can do unless
@@ -640,7 +640,7 @@ svn_handle_warning(FILE *stream, svn_err
 }
 
 void
-svn_handle_warning2(FILE *stream, svn_error_t *err, const char *prefix)
+svn_handle_warning2(FILE *stream, const svn_error_t *err, const char *prefix)
 {
   char buf[256];
 #ifdef SVN_DEBUG
@@ -663,7 +663,7 @@ svn_handle_warning2(FILE *stream, svn_er
 }
 
 const char *
-svn_err_best_message(svn_error_t *err, char *buf, apr_size_t bufsize)
+svn_err_best_message(const svn_error_t *err, char *buf, apr_size_t bufsize)
 {
   /* Skip over any trace records.  */
   while (svn_error__is_tracing_link(err))

Modified: subversion/branches/remote-only-status/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/mod_dav_svn/lock.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/remote-only-status/subversion/mod_dav_svn/lock.c Wed Apr  9 15:22:07 2014
@@ -458,7 +458,8 @@ get_locks(dav_lockdb *lockdb,
      lock.  For the --force case, this is required and for the non-force case,
      we allow the filesystem to produce a better error for svn clients.
   */
-  if (info->r->method_number == M_LOCK)
+  if (info->r->method_number == M_LOCK
+      && resource->info->repos->is_svn_client)
     {
       *locks = NULL;
       return 0;
@@ -599,7 +600,8 @@ has_locks(dav_lockdb *lockdb, const dav_
      lock.  For the --force case, this is required and for the non-force case,
      we allow the filesystem to produce a better error for svn clients.
   */
-  if (info->r->method_number == M_LOCK)
+  if (info->r->method_number == M_LOCK
+      && resource->info->repos->is_svn_client)
     {
       *locks_present = 0;
       return 0;

Modified: subversion/branches/remote-only-status/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/svn/notify.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/svn/notify.c (original)
+++ subversion/branches/remote-only-status/subversion/svn/notify.c Wed Apr  9 15:22:07 2014
@@ -700,7 +700,7 @@ notify(void *baton, const svn_wc_notify_
       else
         {
           svn_error_t *warn_err =
-            svn_error_createf(SVN_ERR_BASE, NULL,
+            svn_error_createf(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
                               _("Error handling externals definition for '%s':"),
                               path_local);
           svn_handle_warning2(stderr, warn_err, "svn: ");

Modified: subversion/branches/remote-only-status/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/remote-only-status/subversion/svnserve/serve.c?rev=1585990&r1=1585989&r2=1585990&view=diff
==============================================================================
--- subversion/branches/remote-only-status/subversion/svnserve/serve.c (original)
+++ subversion/branches/remote-only-status/subversion/svnserve/serve.c Wed Apr  9 15:22:07 2014
@@ -2787,8 +2787,7 @@ static svn_error_t *lock_many(svn_ra_svn
       svn_revnum_t current_rev;
       svn_ra_svn_item_t *item = &APR_ARRAY_IDX(path_revs, i,
                                                svn_ra_svn_item_t);
-      svn_fs_lock_target_t *target
-        = apr_palloc(pool, sizeof(svn_fs_lock_target_t));
+      svn_fs_lock_target_t *target;
 
       svn_pool_clear(subpool);
 
@@ -2802,10 +2801,11 @@ static svn_error_t *lock_many(svn_ra_svn
       full_path = svn_fspath__join(b->repository->fs_path->data,
                                    svn_relpath_canonicalize(path, subpool),
                                    pool);
-      target->token = NULL;
-      target->current_rev = current_rev;
+      target = svn_fs_lock_target_create(NULL, current_rev, pool);
 
-      /* We could check for duplicate paths and reject the request? */
+      /* Any duplicate paths, once canonicalized, get collapsed into a
+         single path that is processed once.  The result is then
+         returned multiple times. */
       svn_hash_sets(targets, full_path, target);
     }
 
@@ -2866,8 +2866,15 @@ static svn_error_t *lock_many(svn_ra_svn
       if (!result)
         result = svn_hash_gets(authz_results, full_path);
       if (!result)
-        /* No result?  Should we return some sort of placeholder error? */
-        break;
+        {
+          /* No result?  Something really odd happened, create a
+             placeholder error so that any other results can be
+             reported in the correct order. */
+          result = apr_palloc(pool, sizeof(struct lock_result_t));
+          result->err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED, 0,
+                                          _("No result for '%s'."), path);
+          svn_hash_sets(lmb.results, full_path, result);
+        }
 
       if (result->err)
         write_err = svn_ra_svn__write_cmd_failure(conn, subpool,
@@ -2971,6 +2978,10 @@ static svn_error_t *unlock_many(svn_ra_s
       full_path = svn_fspath__join(b->repository->fs_path->data,
                                    svn_relpath_canonicalize(path, subpool),
                                    pool);
+
+      /* Any duplicate paths, once canonicalized, get collapsed into a
+         single path that is processed once.  The result is then
+         returned multiple times. */
       svn_hash_sets(targets, full_path, token);
     }
 
@@ -3029,8 +3040,15 @@ static svn_error_t *unlock_many(svn_ra_s
       if (!result)
         result = svn_hash_gets(authz_results, full_path);
       if (!result)
-        /* No result?  Should we return some sort of placeholder error? */
-        break;
+        {
+          /* No result?  Something really odd happened, create a
+             placeholder error so that any other results can be
+             reported in the correct order. */
+          result = apr_palloc(pool, sizeof(struct lock_result_t));
+          result->err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED, 0,
+                                          _("No result for '%s'."), path);
+          svn_hash_sets(lmb.results, full_path, result);
+        }
 
       if (result->err)
         write_err = svn_ra_svn__write_cmd_failure(conn, pool, result->err);



Mime
View raw message