You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/15 10:52:18 UTC

svn commit: r1532250 [10/37] - in /subversion/branches/cache-server: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/ contrib/server-side/fsfsfixer/ contrib/se...

Modified: subversion/branches/cache-server/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_io.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_io.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_io.h Tue Oct 15 08:52:06 2013
@@ -182,9 +182,10 @@ svn_io_check_resolved_path(const char *p
  * may be @c NULL.  If @a file is @c NULL, the file will be created but not
  * open.
  *
- * If @a delete_when is #svn_io_file_del_on_close, then the @c APR_DELONCLOSE
- * flag will be used when opening the file.  The @c APR_BUFFERED flag will
- * always be used.
+ * The file will be deleted according to @a delete_when.  If that is
+ * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool.
+ *
+ * The @c APR_BUFFERED flag will always be used when opening the file.
  *
  * The first attempt will just append @a suffix.  If the result is not
  * a unique name, then subsequent attempts will append a dot,
@@ -248,8 +249,9 @@ svn_io_open_uniquely_named(apr_file_t **
  * be possible to atomically rename the resulting file due to cross-device
  * issues.)
  *
- * The file will be deleted according to @a delete_when.  If @a delete_when
- * is @c svn_io_file_del_on_close and @a file is @c NULL, the file will be
+ * The file will be deleted according to @a delete_when.  If that is
+ * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool.  If it
+ * is #svn_io_file_del_on_close and @a file is @c NULL, the file will be
  * deleted before this function returns.
  *
  * When passing @c svn_io_file_del_none please don't forget to eventually
@@ -689,6 +691,27 @@ svn_io_file_create(const char *file,
                    const char *contents,
                    apr_pool_t *pool);
 
+/** Create file at utf8-encoded @a file with binary contents @a contents
+ * of @a length bytes.  @a file must not already exist.
+ * Use @a pool for memory allocations.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_io_file_create_binary(const char *file,
+                          const char *contents,
+                          apr_size_t length,
+                          apr_pool_t *pool);
+
+/** Create empty file at utf8-encoded @a file, which must not already exist.
+ * Use @a pool for memory allocations.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_io_file_create_empty(const char *file,
+                         apr_pool_t *pool);
+
 /**
  * Lock file at @a lock_file. If @a exclusive is TRUE,
  * obtain exclusive lock, otherwise obtain shared lock.
@@ -972,7 +995,8 @@ svn_stream_open_writable(svn_stream_t **
  * be possible to atomically rename the resulting file due to cross-device
  * issues.)
  *
- * The file will be deleted according to @a delete_when.
+ * The file will be deleted according to @a delete_when.  If that is
+ * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool.
  *
  * Temporary allocations will be performed in @a scratch_pool.
  *
@@ -1046,6 +1070,20 @@ svn_error_t *
 svn_stream_for_stdout(svn_stream_t **out,
                       apr_pool_t *pool);
 
+/** Set @a *str to a string buffer allocated in @a pool that contains all
+ * data from the current position in @a stream to its end.  @a len_hint
+ * specifies the initial capacity of the string buffer and may be 0.  The
+ * buffer gets automatically resized to fit the actual amount of data being
+ * read from @a stream.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_stringbuf_from_stream(svn_stringbuf_t **str,
+                          svn_stream_t *stream,
+                          apr_size_t len_hint,
+                          apr_pool_t *pool);
+
 /** Return a generic stream connected to stringbuf @a str.  Allocate the
  * stream in @a pool.
  */
@@ -2062,6 +2100,28 @@ svn_io_file_seek(apr_file_t *file,
                  apr_off_t *offset,
                  apr_pool_t *pool);
 
+/** Set the file pointer of the #APR_BUFFERED @a file to @a offset.  In
+ * contrast to #svn_io_file_seek, this function will attempt to resize the
+ * internal data buffer to @a block_size bytes and to read data aligned to
+ * multiples of that value.  The beginning of the block will be returned
+ * in @a buffer_start, if that is not NULL.
+ * Uses @a pool for temporary allocations.
+ *
+ * @note Due to limitations of the APR API, in particular pre-1.3 APR,
+ * the alignment may not be successful.  If you never use any other seek
+ * function on @a file, you are, however, virtually guaranteed to get at
+ * least 4kByte alignments for all reads.
+ *
+ * @note Calling this for non-buffered files is legal but inefficient.
+ *
+ * @since New in 1.9
+ */
+svn_error_t *
+svn_io_file_aligned_seek(apr_file_t *file,
+                         apr_off_t block_size,
+                         apr_off_t *buffer_start,
+                         apr_off_t offset,
+                         apr_pool_t *pool);
 
 /** Wrapper for apr_file_write(). */
 svn_error_t *
@@ -2070,6 +2130,14 @@ svn_io_file_write(apr_file_t *file,
                   apr_size_t *nbytes,
                   apr_pool_t *pool);
 
+/** Wrapper for apr_file_flush().
+ * @since New in 1.9
+ */
+svn_error_t *
+svn_io_file_flush(apr_file_t *file,
+                  apr_pool_t *scratch_pool);
+
+
 
 /** Wrapper for apr_file_write_full(). */
 svn_error_t *
@@ -2080,6 +2148,24 @@ svn_io_file_write_full(apr_file_t *file,
                        apr_pool_t *pool);
 
 /**
+ * Writes @a nbytes bytes from @a *buf to a temporary file inside the same
+ * directory as @a *final_path. Then syncs the temporary file to disk and
+ * closes the file. After this rename the temporary file to @a final_path,
+ * possibly replacing an existing file.
+ *
+ * If @a copy_perms_path is not NULL, copy the permissions applied on @a
+ * @a copy_perms_path on the temporary file before renaming.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_io_write_atomic(const char *final_path,
+                    const void *buf,
+                    apr_size_t nbytes,
+                    const char* copy_perms_path,
+                    apr_pool_t *scratch_pool);
+
+/**
  * Open a unique file in @a dirpath, and write @a nbytes from @a buf to
  * the file before flushing it to disk and closing it.  Return the name
  * of the newly created file in @a *tmp_path, allocated in @a pool.

Modified: subversion/branches/cache-server/subversion/include/svn_path.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_path.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_path.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_path.h Tue Oct 15 08:52:06 2013
@@ -716,6 +716,14 @@ svn_path_resolve_repos_relative_url(cons
                                     const char *repos_root_url,
                                     apr_pool_t *pool);
 
+/* Return a copy of @a path, allocated from @a pool, for which control
+ * characters have been escaped using the form \NNN (where NNN is the
+ * octal representation of the byte's ordinal value).
+ * 
+ * @since New in 1.9. */
+const char *
+svn_path_illegal_path_escape(const char *path, apr_pool_t *pool);
+
 /** @} */
 
 #ifdef __cplusplus

Modified: subversion/branches/cache-server/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_ra.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_ra.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_ra.h Tue Oct 15 08:52:06 2013
@@ -134,7 +134,10 @@ typedef svn_error_t *
                                  apr_pool_t *pool);
 
 
-/** A function type for retrieving the youngest revision from a repos. */
+/** A function type for retrieving the youngest revision from a repos.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
+ */
+/* ### It seems this type was never used by the API, since 1.0.0. */
 typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t)(
   void *session_baton,
   svn_revnum_t *latest_revnum);
@@ -267,6 +270,61 @@ typedef svn_error_t *(*svn_ra_replay_rev
   apr_hash_t *rev_props,
   apr_pool_t *pool);
 
+
+/**
+ * Callback function that checks if an ra_svn tunnel called
+ * @a tunnel_name is handled by the callbakcs or the default
+ * implementation.
+ *
+ * @a tunnel_baton is the baton as originally passed to ra_open.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_boolean_t (*svn_ra_check_tunnel_func_t)(
+    void *tunnel_baton, const char *tunnel_name);
+
+/**
+ * Callback function for opening a tunnel in ra_svn.
+ *
+ * Given the @a tunnel_name, tunnel @a user and server @a hostname and
+ * @a port, return a new ra_svn connection in @a conn. The returned
+ * connection must be allocated from @a pool.
+ *
+ * @a request and @a response are the standard input and output,
+ * respectively, of the process on the other end of the tunnel.
+ *
+ * @a tunnel_context will be passed on to the close-unnel callback.
+ *
+ * @a tunnel_baton is the baton as originally passed to ra_open.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_ra_open_tunnel_func_t)(
+    apr_file_t **request, apr_file_t **response,
+    void **tunnel_context, void *tunnel_baton,
+    const char *tunnel_name, const char *user,
+    const char *hostname, int port,
+    apr_pool_t *pool);
+
+/**
+ * Callback function for closing a tunnel in ra_svn.
+ *
+ * This function will be called when the pool that owns the tunnel
+ * connection is cleared or destroyed. It receives the @a baton that
+ * was created by the open-tunnel callback, and the same
+ * @a tunnel_name, @a user, @a hostname and @a port parameters.
+ *
+ * @a tunel_baton was returned by the open-tunnel callback.
+ *
+ * @a open_baton is the baton as originally passed to ra_open.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_ra_close_tunnel_func_t)(
+    void *tunnel_context, void *tunnel_baton,
+    const char *tunnel_name, const char *user,
+    const char *hostname, int port);
+
 
 /**
  * The update Reporter.
@@ -535,6 +593,41 @@ typedef struct svn_ra_callbacks2_t
    */
   svn_ra_get_wc_contents_func_t get_wc_contents;
 
+  /** Check-tunnel callback
+   *
+   * If not @c NULL, and open_tunnel_func is also not @c NULL, this
+   * callback will be invoked to check if open_tunnel_func should be
+   * used to create a specific tunnel, or if the default tunnel
+   * implementation (either built-in or configured in the client
+   * configuration file) should be used instead.
+   * @since New in 1.9.
+   */
+  svn_ra_check_tunnel_func_t check_tunnel_func;
+
+  /** Open-tunnel callback
+   *
+   * If not @c NULL, this callback will be invoked to create a tunnel
+   * for a ra_svn connection that needs one, overriding any tunnel
+   * definitions in the client config file. This callback is used only
+   * for ra_svn and ignored by the other RA modules.
+   * @since New in 1.9.
+   */
+  svn_ra_open_tunnel_func_t open_tunnel_func;
+
+  /** Close-tunnel callback
+   *
+   * If not @c NULL, this callback will be invoked when the pool that
+   * owns the connection created by the open_tunnel callback is
+   * cleared or destroyed. This callback is used only for ra_svn and
+   * ignored by the other RA modules.
+   * @since New in 1.9.
+   */
+  svn_ra_close_tunnel_func_t close_tunnel_func;
+
+  /** A baton used with open_tunnel_func and close_tunnel_func.
+   * @since New in 1.9.
+   */
+  void *tunnel_baton;
 } svn_ra_callbacks2_t;
 
 /** Similar to svn_ra_callbacks2_t, except that the progress
@@ -1478,6 +1571,9 @@ svn_ra_do_diff(svn_ra_session_t *session
  * If @a include_merged_revisions is set, log information for revisions
  * which have been merged to @a targets will also be returned.
  *
+ * @a move_behavior defines which changes are being reported as moves.
+ * See #svn_move_behavior_t for the various options.
+ *
  * If @a revprops is NULL, retrieve all revision properties; else, retrieve
  * only the revision properties named by the (const char *) array elements
  * (i.e. retrieve none if the array is empty).
@@ -1505,10 +1601,33 @@ svn_ra_do_diff(svn_ra_session_t *session
  * revprops is NULL or contains a revprop other than svn:author, svn:date,
  * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
  *
- * @since New in 1.5.
+ * @since New in 1.9.
  */
 
 svn_error_t *
+svn_ra_get_log3(svn_ra_session_t *session,
+                const apr_array_header_t *paths,
+                svn_revnum_t start,
+                svn_revnum_t end,
+                int limit,
+                svn_boolean_t discover_changed_paths,
+                svn_boolean_t strict_node_history,
+                svn_boolean_t include_merged_revisions,
+                svn_move_behavior_t move_behavior,
+                const apr_array_header_t *revprops,
+                svn_log_entry_receiver_t receiver,
+                void *receiver_baton,
+                apr_pool_t *pool);
+
+/**
+ * Similar to svn_ra_get_log3(), but with @a move_behavior being set to
+ * #svn_fs_move_behavior_no_moves.
+ *
+ * @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
+ */
+SVN_DEPRECATED
+svn_error_t *
 svn_ra_get_log2(svn_ra_session_t *session,
                 const apr_array_header_t *paths,
                 svn_revnum_t start,

Modified: subversion/branches/cache-server/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_repos.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_repos.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_repos.h Tue Oct 15 08:52:06 2013
@@ -69,8 +69,11 @@ enum svn_node_action
 /** The different policies for processing the UUID in the dumpfile. */
 enum svn_repos_load_uuid
 {
+  /** only update uuid if the repos has no revisions. */
   svn_repos_load_uuid_default,
+  /** never update uuid. */
   svn_repos_load_uuid_ignore,
+  /** always update uuid. */
   svn_repos_load_uuid_force
 };
 
@@ -248,8 +251,19 @@ typedef enum svn_repos_notify_action_t
   svn_repos_notify_load_skipped_rev,
 
   /** The structure of a revision is being verified.  @since New in 1.8. */
-  svn_repos_notify_verify_rev_structure
+  svn_repos_notify_verify_rev_structure,
 
+  /** A revision is found with corruption/errors. @since New in 1.9. */
+  svn_repos_notify_failure,
+
+  /** A revprop shard got packed. @since New in 1.9. */
+  svn_repos_notify_pack_revprops,
+
+  /** A non-packed revprop shard got removed. @since New in 1.9. */
+  svn_repos_notify_cleanup_revprops,
+
+  /** The repository format got bumped. @since New in 1.9. */
+  svn_repos_notify_format_bumped
 } svn_repos_notify_action_t;
 
 /** The type of error occurring.
@@ -292,16 +306,18 @@ typedef struct svn_repos_notify_t
   svn_repos_notify_action_t action;
 
   /** For #svn_repos_notify_dump_rev_end and #svn_repos_notify_verify_rev_end,
-   * the revision which just completed. */
+   * the revision which just completed.
+   * For #svn_fs_upgrade_format_bumped, the new format version. */
   svn_revnum_t revision;
 
-  /** For #svn_repos_notify_warning, the warning object. Must be cleared
-      by the consumer of the notification. */
+  /** For #svn_repos_notify_warning, the warning object. */
   const char *warning_str;
   svn_repos_notify_warning_t warning;
 
   /** For #svn_repos_notify_pack_shard_start,
       #svn_repos_notify_pack_shard_end,
+      #svn_repos_notify_pack_revprops,
+      #svn_repos_notify_cleanup_revprops
       #svn_repos_notify_pack_shard_start_revprop, and
       #svn_repos_notify_pack_shard_end_revprop, the shard processed. */
   apr_int64_t shard;
@@ -321,6 +337,11 @@ typedef struct svn_repos_notify_t
   /** For #svn_repos_notify_load_node_start, the path of the node. */
   const char *path;
 
+  /** For #svn_repos_notify_failure, this error chain indicates what
+      went wrong during verification.
+      @since New in 1.9. */
+  svn_error_t *err;
+
   /* NOTE: Add new fields at the end to preserve binary compatibility.
      Also, if you add fields here, you have to update
      svn_repos_notify_create(). */
@@ -1773,6 +1794,9 @@ svn_repos_node_location_segments(svn_rep
  * filesystem, as limited by @a paths. In the latter case those revisions
  * are skipped and @a receiver is not invoked.
  *
+ * @a move_behavior defines which changes are being reported as moves.
+ * See #svn_move_behavior_t for the various options.
+ *
  * If @a revprops is NULL, retrieve all revision properties; else, retrieve
  * only the revision properties named by the (const char *) array elements
  * (i.e. retrieve none if the array is empty).
@@ -1797,8 +1821,33 @@ svn_repos_node_location_segments(svn_rep
  *
  * Use @a pool for temporary allocations.
  *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_repos_get_logs5(svn_repos_t *repos,
+                    const apr_array_header_t *paths,
+                    svn_revnum_t start,
+                    svn_revnum_t end,
+                    int limit,
+                    svn_boolean_t discover_changed_paths,
+                    svn_boolean_t strict_node_history,
+                    svn_boolean_t include_merged_revisions,
+                    svn_move_behavior_t move_behavior,
+                    const apr_array_header_t *revprops,
+                    svn_repos_authz_func_t authz_read_func,
+                    void *authz_read_baton,
+                    svn_log_entry_receiver_t receiver,
+                    void *receiver_baton,
+                    apr_pool_t *pool);
+
+/**
+ * Same as svn_repos_get_logs5(), but with @a move_behavior being set to
+ * #svn_fs_move_behavior_no_moves.
+ *
  * @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_repos_get_logs4(svn_repos_t *repos,
                     const apr_array_header_t *paths,
@@ -2590,12 +2639,39 @@ svn_repos_info_format(int *repos_format,
  * the verified revision and @a warning_text @c NULL. For warnings call @a
  * notify_func with @a warning_text set.
  *
+ * For every revision verification failure, if @a notify_func is not @c NULL,
+ * call @a notify_func with @a rev set to the corrupt revision and @err set to
+ * the corresponding error message.
+ *
  * If @a cancel_func is not @c NULL, call it periodically with @a
  * cancel_baton as argument to see if the caller wishes to cancel the
  * verification.
  *
+ * If @a keep_going is @c TRUE, the verify process notifies the error message
+ * and continues. If @a notify_func is @c NULL, the verification failure is
+ * not notified. Finally, return an error if there were any failures during
+ * verification, or SVN_NO_ERROR if there were no failures.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_repos_verify_fs3(svn_repos_t *repos,
+                     svn_revnum_t start_rev,
+                     svn_revnum_t end_rev,
+                     svn_boolean_t keep_going,
+                     svn_repos_notify_func_t notify_func,
+                     void *notify_baton,
+                     svn_cancel_func_t cancel,
+                     void *cancel_baton,
+                     apr_pool_t *scratch_pool);
+
+/**
+ * Like svn_repos_verify_fs3(), but with @a keep_going set to @c FALSE.
+ *
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_repos_verify_fs2(svn_repos_t *repos,
                      svn_revnum_t start_rev,
@@ -3348,8 +3424,14 @@ svn_repos_authz_check_access(svn_authz_t
  */
 typedef enum svn_repos_revision_access_level_t
 {
+  /** no access allowed to the revision properties and all changed-paths
+   * information. */ 
   svn_repos_revision_access_none,
+  /** access granted to some (svn:date and svn:author) revision properties and
+   * changed-paths information on paths the read has access to. */
   svn_repos_revision_access_partial,
+  /** access granted to all revision properites and changed-paths
+   * information. */
   svn_repos_revision_access_full
 }
 svn_repos_revision_access_level_t;

Modified: subversion/branches/cache-server/subversion/include/svn_sorts.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_sorts.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_sorts.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_sorts.h Tue Oct 15 08:52:06 2013
@@ -174,7 +174,8 @@ svn_sort__hash(apr_hash_t *ht,
 /* Return the lowest index at which the element @a *key should be inserted into
  * the array @a array, according to the ordering defined by @a compare_func.
  * The array must already be sorted in the ordering defined by @a compare_func.
- * @a compare_func is defined as for the C stdlib function bsearch().
+ * @a compare_func is defined as for the C stdlib function bsearch(); the
+ * @a key will always passed to it as the second parameter.
  *
  * @note Private. For use by Subversion's own code only.
  */
@@ -216,6 +217,77 @@ void
 svn_sort__array_reverse(apr_array_header_t *array,
                         apr_pool_t *scratch_pool);
 
+/** Priority queues.
+ *
+ * @defgroup svn_priority_queue__t Priority Queues
+ * @{
+ */
+
+/**
+ * We implement priority queues on top of existing ELEMENTS arrays.  They
+ * provide us with memory management and very basic element type information.
+ *
+ * The extraction order is being defined by a comparison function similar
+ * to the ones used with qsort.  The first element in the queue is always
+ * on with COMPARISON_FUNC(first,element) <= 0, for all elements in the
+ * queue.
+ */
+
+/**
+ * Opaque data type for priority queues.
+ */
+typedef struct svn_priority_queue__t svn_priority_queue__t;
+
+/**
+ * Return a priority queue containing all provided @a elements and prioritize
+ * them according to @a compare_func.
+ *
+ * @note The priority queue will use the existing @a elements array for data
+ * storage.  So, you must not manipulate that array while using the queue.
+ * Also, the lifetime of the queue is bound to that of the array.
+ */
+svn_priority_queue__t *
+svn_priority_queue__create(apr_array_header_t *elements,
+                           int (*compare_func)(const void *, const void *));
+
+/**
+ * Returns the number of elements in the @a queue.
+ */
+apr_size_t
+svn_priority_queue__size(svn_priority_queue__t *queue);
+
+/**
+ * Returns a reference to the first element in the @a queue.  The queue
+ * contents remains unchanged.  If the @a queue is empty, #NULL will be
+ * returned.
+ */
+void *
+svn_priority_queue__peek(svn_priority_queue__t *queue);
+
+/**
+ * Notify the @a queue after modifying the first item as returned by
+ * #svn_priority_queue__peek.
+ */
+void
+svn_priority_queue__update(svn_priority_queue__t *queue);
+
+/**
+ * Remove the first element from the @a queue.  This is a no-op for empty
+ * queues.
+ */
+void
+svn_priority_queue__pop(svn_priority_queue__t *queue);
+
+/**
+ * Append the new @a element to the @a queue.  @a element must neither be
+ * #NULL nor the first element as returned by #svn_priority_queue__peek.
+ */
+void
+svn_priority_queue__push(svn_priority_queue__t *queue, const void *element);
+
+/** @} */
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/cache-server/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_string.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_string.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_string.h Tue Oct 15 08:52:06 2013
@@ -232,6 +232,15 @@ svn_stringbuf_create_ensure(apr_size_t m
 svn_stringbuf_t *
 svn_stringbuf_create_from_string(const svn_string_t *str, apr_pool_t *pool);
 
+/** Create a new stringbuf using the given @a str as initial buffer.
+ * Allocate the result in @a pool.  In contrast to #svn_stringbuf_create,
+ * the contents of @a str may change when the stringbuf gets modified.
+ *
+ * @since New in 1.9
+ */
+svn_stringbuf_t *
+svn_stringbuf_create_wrap(char *str, apr_pool_t *pool);
+
 /** Create a new stringbuf by printf-style formatting using @a fmt and the
  * variable arguments, which are as appropriate for apr_psprintf().
  */
@@ -304,6 +313,16 @@ svn_stringbuf_appendbytes(svn_stringbuf_
                           const char *bytes,
                           apr_size_t count);
 
+/** Append @a byte @a count times onto @a targetstr.
+ *
+ * reallocs if necessary. @a targetstr is affected, nothing else is.
+ * @since New in 1.9.
+ */
+void
+svn_stringbuf_appendfill(svn_stringbuf_t *targetstr,
+                         char byte,
+                         apr_size_t count);
+
 /** Append the stringbuf @c appendstr onto @a targetstr.
  *
  * reallocs if necessary. @a targetstr is affected, nothing else is.
@@ -407,9 +426,11 @@ svn_string_compare_stringbuf(const svn_s
  * @{
  */
 
-/** Divide @a input into substrings along @a sep_chars boundaries, return an
- * array of copies of those substrings (plain const char*), allocating both
- * the array and the copies in @a pool.
+/** Divide @a input into substrings, interpreting any char from @a sep
+ * as a token separator.  
+ *
+ * Return an array of copies of those substrings (plain const char*),
+ * allocating both the array and the copies in @a pool.
  *
  * None of the elements added to the array contain any of the
  * characters in @a sep_chars, and none of the new elements are empty

Modified: subversion/branches/cache-server/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_types.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_types.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_types.h Tue Oct 15 08:52:06 2013
@@ -64,6 +64,26 @@ extern "C" {
 #endif
 
 
+/** Macro used to mark experimental functions.
+ *
+ * @since New in 1.9.
+ */
+#ifndef SVN_EXPERIMENTAL
+# if !defined(SWIGPERL) && !defined(SWIGPYTHON) && !defined(SWIGRUBY)
+#  if !defined(__clang__) && defined(__GNUC__) \
+      && (__GNUC__ >= 4 || (__GNUC__==3 && __GNUC_MINOR__>=1))
+#   define SVN_EXPERIMENTAL __attribute__((warning("experimental function used")))
+#  elif defined(_MSC_VER) && _MSC_VER >= 1300
+#   define SVN_EXPERIMENTAL __declspec(deprecated("experimental function used"))
+#  else
+#   define SVN_EXPERIMENTAL
+#  endif
+# else
+#  define SVN_EXPERIMENTAL
+# endif
+#endif
+
+
 /** Indicate whether the current platform supports unaligned data access.
  *
  * On the majority of machines running SVN (x86 / x64), unaligned access
@@ -72,10 +92,16 @@ extern "C" {
  * Unaligned access on other machines (e.g. IA64) will trigger memory
  * access faults or simply misbehave.
  *
+ * Note: Some platforms may only support unaligned access for integers
+ * (PowerPC).  As a result this macro should only be used to determine
+ * if unaligned access is supported for integers.
+ *
  * @since New in 1.7.
  */
 #ifndef SVN_UNALIGNED_ACCESS_IS_OK
-# if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
+# if defined(_M_IX86) || defined(i386) \
+     || defined(_M_X64) || defined(__x86_64) \
+     || defined(__powerpc__) || defined(__ppc__)
 #  define SVN_UNALIGNED_ACCESS_IS_OK 1
 # else
 #  define SVN_UNALIGNED_ACCESS_IS_OK 0
@@ -213,6 +239,16 @@ svn__apr_hash_index_val(const apr_hash_i
                       || ((s) == APR_OS_START_SYSERR + ERROR_INVALID_NAME))
 #endif
 
+/** On Windows, APR_STATUS_IS_EPIPE does not include ERROR_NO_DATA error.
+ * So we include it.*/
+/* ### These fixes should go into APR. */
+#ifndef WIN32
+#define SVN__APR_STATUS_IS_EPIPE(s)  APR_STATUS_IS_EPIPE(s)
+#else
+#define SVN__APR_STATUS_IS_EPIPE(s)  (APR_STATUS_IS_EPIPE(s) \
+                      || ((s) == APR_OS_START_SYSERR + ERROR_NO_DATA))
+#endif
+
 /** @} */
 
 
@@ -270,8 +306,11 @@ svn_node_kind_from_word(const char *word
  * @since New in 1.7. */
 typedef enum svn_tristate_t
 {
+  /** state known to be false (the constant does not evaulate to false) */
   svn_tristate_false = 2,
+  /** state known to be true */
   svn_tristate_true,
+  /** state could be true or false */
   svn_tristate_unknown
 } svn_tristate_t;
 
@@ -743,7 +782,7 @@ svn_commit_info_dup(const svn_commit_inf
  */
 typedef struct svn_log_changed_path2_t
 {
-  /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */
+  /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify, mo'V'ed, move-replac'E'd */
   char action;
 
   /** Source path of copy (if any). */
@@ -982,6 +1021,28 @@ typedef svn_error_t *(*svn_log_message_r
   const char *message,
   apr_pool_t *pool);
 
+/**
+ * This enumeration contains the various options how SVN shall report
+ * and process explicit MOVes as well as ADD+DEL pairs.
+ *
+ * @since New in 1.9.
+ */
+typedef enum svn_move_behavior_t
+{
+  /* report all moves as ADD with history.
+     This also provides backward compatibility with 1.8 clients. */
+  svn_move_behavior_no_moves = 0,
+
+  /* report all changes, including moves, as they were reported.
+     This is option with the least overhead. */
+  svn_move_behavior_explicit_moves,
+
+  /* in addition to explicit moves, try to find matching DEL + ADD pairs
+     and report the ADD in those as moves as well.  Which of the eligible
+     DEL + ADD pairs will be detected is implementation-dependent. */
+  svn_move_behavior_auto_moves
+} svn_move_behavior_t;
+
 
 
 /** Callback function type for commits.

Modified: subversion/branches/cache-server/subversion/include/svn_utf.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_utf.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_utf.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_utf.h Tue Oct 15 08:52:06 2013
@@ -63,8 +63,8 @@ extern "C" {
  * @since New in 1.8.
  */
 void
-svn_utf_initialize2(apr_pool_t *pool,
-                    svn_boolean_t assume_native_utf8);
+svn_utf_initialize2(svn_boolean_t assume_native_utf8,
+                    apr_pool_t *pool);
 
 /**
  * Like svn_utf_initialize2() but without the ability to force the

Modified: subversion/branches/cache-server/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_version.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_version.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_version.h Tue Oct 15 08:52:06 2013
@@ -116,10 +116,8 @@ extern "C" {
 /** Revision number: The repository revision number of this release.
  *
  * This constant is used to generate the build number part of the Windows
- * file version. Its value remains 0 in the repository.
- *
- * When rolling a tarball, we automatically replace it with what we
- * guess to be the correct revision number.
+ * file version. Its value remains 0 in the repository except in release
+ * tags where it is the revision from which the tag was created.
  */
 #define SVN_VER_REVISION   0
 
@@ -194,6 +192,8 @@ struct svn_version_t
  * unreleased library. A development client is always compatible with
  * a previous released library.
  *
+ * @note Implements the #svn_ver_check_list2.@a comparator interface.
+ *
  * @since New in 1.1.
  */
 svn_boolean_t
@@ -203,6 +203,8 @@ svn_ver_compatible(const svn_version_t *
 /**
  * Check if @a my_version and @a lib_version encode the same version number.
  *
+ * @note Implements the #svn_ver_check_list2.@a comparator interface.
+ *
  * @since New in 1.2.
  */
 svn_boolean_t
@@ -230,10 +232,31 @@ typedef struct svn_version_checklist_t
  * my_version is compatible with each entry in @a checklist. @a
  * checklist must end with an entry whose label is @c NULL.
  *
- * @see svn_ver_compatible()
+ * @a my_version is considered to be compatible with a version in @a checklist
+ * if @a comparator returns #TRUE when called with @a my_version as the first
+ * parammeter and the @a checklist version as the second parameter.
+ *
+ * @see svn_ver_compatible(), svn_ver_equal()
+ *
+ * @note Subversion's own code invariably uses svn_ver_equal() as @a comparator,
+ * since the cmdline tools sometimes use non-public APIs (such as utility
+ * functions that haven't been promoted to svn_cmdline.h).  Third-party code
+ * SHOULD use svn_ver_compatible() as @a comparator.
  *
- * @since New in 1.1.
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_ver_check_list2(const svn_version_t *my_version,
+                    const svn_version_checklist_t *checklist,
+                    svn_boolean_t (*comparator)(const svn_version_t *,
+                                                const svn_version_t *));
+
+/** Similar to svn_ver_check_list2(), with @a comparator set to
+ * #svn_ver_compatible.
+ *
+ * @deprecated Provided for backward compatibility with 1.8 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_ver_check_list(const svn_version_t *my_version,
                    const svn_version_checklist_t *checklist);

Modified: subversion/branches/cache-server/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/include/svn_wc.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/include/svn_wc.h (original)
+++ subversion/branches/cache-server/subversion/include/svn_wc.h Tue Oct 15 08:52:06 2013
@@ -1255,7 +1255,16 @@ typedef enum svn_wc_notify_action_t
    * copy + delete. The notified path is the move source (the deleted path).
    * ### TODO: Provide path to move destination as well?
    * @since New in 1.8. */
-  svn_wc_notify_move_broken
+  svn_wc_notify_move_broken,
+
+  /** Running cleanup on an external module.
+   * @since New in 1.9. */
+  svn_wc_notify_cleanup_external,
+
+  /** The operation failed because the operation (E.g. commit) is only valid
+   * if the operation includes this path.
+   * @since New in 1.9. */
+  svn_wc_notify_failed_requires_target
 
 } svn_wc_notify_action_t;
 
@@ -1745,11 +1754,117 @@ svn_wc_conflict_version_dup(const svn_wc
  * @note Fields may be added to the end of this structure in future
  * versions.  Therefore, to preserve binary compatibility, users
  * should not directly allocate structures of this type but should use
+ * svn_wc_conflict_description_create_text3() or
+ * svn_wc_conflict_description_create_prop3() or
+ * svn_wc_conflict_description_create_tree3() instead.
+ *
+ * @since New in 1.9.
+ */
+typedef struct svn_wc_conflict_description3_t
+{
+  /** The path that is in conflict (for a tree conflict, it is the victim) */
+  const char *local_abspath;
+
+  /** The node type of the path being operated on (for a tree conflict,
+   *  ### which version?) */
+  svn_node_kind_t node_kind;
+
+  /** What sort of conflict are we describing? */
+  svn_wc_conflict_kind_t kind;
+
+  /** The name of the property whose conflict is being described.
+   *  (Only if @a kind is 'property'; else undefined.) */
+  const char *property_name;
+
+  /** Whether svn thinks ('my' version of) @c path is a 'binary' file.
+   *  (Only if @c kind is 'text', else undefined.) */
+  svn_boolean_t is_binary;
+
+  /** The svn:mime-type property of ('my' version of) @c path, if available,
+   *  else NULL.
+   *  (Only if @c kind is 'text', else undefined.) */
+  const char *mime_type;
+
+  /** The action being attempted on the conflicted node or property.
+   *  (When @c kind is 'text', this action must be 'edit'.) */
+  svn_wc_conflict_action_t action;
+
+  /** The state of the target node or property, relative to its merge-left
+   *  source, that is the reason for the conflict.
+   *  (When @c kind is 'text', this reason must be 'edited'.) */
+  svn_wc_conflict_reason_t reason;
+
+  /** If this is text-conflict and involves the merging of two files
+   * descended from a common ancestor, here are the paths of up to
+   * four fulltext files that can be used to interactively resolve the
+   * conflict.
+   *
+   * @a base_abspath, @a their_abspath and @a my_abspath are absolute
+   * paths.
+   *
+   * ### Is @a merged_file relative to some directory, or absolute?
+   *
+   * All four files will be in repository-normal form -- LF
+   * line endings and contracted keywords.  (If any of these files are
+   * not available, they default to NULL.)
+   *
+   * On the other hand, if this is a property-conflict, then these
+   * paths represent temporary files that contain the three different
+   * property-values in conflict.  The fourth path (@c merged_file)
+   * may or may not be NULL;  if set, it represents libsvn_wc's
+   * attempt to merge the property values together.  (Remember that
+   * property values are technically binary values, and thus can't
+   * always be merged.)
+   */
+  const char *base_abspath;  /* common ancestor of the two files being merged */
+
+  /** their version of the file */
+  const char *their_abspath;
+
+  /** my locally-edited version of the file */
+  const char *my_abspath;
+
+  /** merged version; may contain conflict markers */
+  const char *merged_file;
+
+  /* For property conflicts, the path to the property reject file. */
+  const char *prop_reject_abspath;
+
+  /** The operation that exposed the conflict.
+   * Used only for tree conflicts.
+   */
+  svn_wc_operation_t operation;
+
+  /** Info on the "merge-left source" or "older" version of incoming change. */
+  const svn_wc_conflict_version_t *src_left_version;
+
+  /** Info on the "merge-right source" or "their" version of incoming change. */
+  const svn_wc_conflict_version_t *src_right_version;
+
+  /* Remember to adjust svn_wc__conflict_description3_dup()
+   * if you add new fields to this struct. */
+} svn_wc_conflict_description3_t;
+
+
+/** A struct that describes a conflict that has occurred in the
+ * working copy.
+ *
+ * The conflict described by this structure is one of:
+ *   - a conflict on the content of the file node @a local_abspath
+ *   - a conflict on the property @a property_name of @a local_abspath
+ *   - a tree conflict, of which @a local_abspath is the victim
+ * Be aware that the victim of a tree conflict can be a non-existent node.
+ * The three kinds of conflict are distinguished by @a kind.
+ *
+ * @note Fields may be added to the end of this structure in future
+ * versions.  Therefore, to preserve binary compatibility, users
+ * should not directly allocate structures of this type but should use
  * svn_wc_conflict_description_create_text2() or
  * svn_wc_conflict_description_create_prop2() or
  * svn_wc_conflict_description_create_tree2() instead.
  *
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
 typedef struct svn_wc_conflict_description2_t
 {
@@ -1928,7 +2043,7 @@ typedef struct svn_wc_conflict_descripti
 } svn_wc_conflict_description_t;
 
 /**
- * Allocate an #svn_wc_conflict_description_t structure in @a result_pool,
+ * Allocate an #svn_wc_conflict_description3_t structure in @a result_pool,
  * initialize to represent a text conflict, and return it.
  *
  * Set the @c local_abspath field of the created struct to @a local_abspath
@@ -1940,8 +2055,19 @@ typedef struct svn_wc_conflict_descripti
  * @note It is the caller's responsibility to set the other required fields
  * (such as the four file names and @c mime_type and @c is_binary).
  *
+ * @since New in 1.9.
+ */
+svn_wc_conflict_description3_t *
+svn_wc_conflict_description_create_text3(const char *local_abspath,
+                                         apr_pool_t *result_pool);
+
+/* Similar to #svn_wc_conflict_description_create_text3, but returns
+ * an svn_wc_conflict_description2_t *.
+ * 
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_wc_conflict_description2_t *
 svn_wc_conflict_description_create_text2(const char *local_abspath,
                                          apr_pool_t *result_pool);
@@ -1960,7 +2086,7 @@ svn_wc_conflict_description_create_text(
                                         apr_pool_t *pool);
 
 /**
- * Allocate an #svn_wc_conflict_description_t structure in @a result_pool,
+ * Allocate an #svn_wc_conflict_description3_t structure in @a result_pool,
  * initialize to represent a property conflict, and return it.
  *
  * Set the @c local_abspath field of the created struct to @a local_abspath
@@ -1971,8 +2097,21 @@ svn_wc_conflict_description_create_text(
  * @note: It is the caller's responsibility to set the other required fields
  * (such as the four file names and @c action and @c reason).
  *
+ * @since New in 1.9.
+ */
+svn_wc_conflict_description3_t *
+svn_wc_conflict_description_create_prop3(const char *local_abspath,
+                                         svn_node_kind_t node_kind,
+                                         const char *property_name,
+                                         apr_pool_t *result_pool);
+
+/* Similar to #svn_wc_conflict_description_create_prop3, but returns
+ * an svn_wc_conflict_description2_t *.
+ * 
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_wc_conflict_description2_t *
 svn_wc_conflict_description_create_prop2(const char *local_abspath,
                                          svn_node_kind_t node_kind,
@@ -2007,8 +2146,24 @@ svn_wc_conflict_description_create_prop(
  * @note: It is the caller's responsibility to set the other required fields
  * (such as the four file names and @c action and @c reason).
  *
+ * @since New in 1.9.
+ */
+svn_wc_conflict_description3_t *
+svn_wc_conflict_description_create_tree3(
+  const char *local_abspath,
+  svn_node_kind_t node_kind,
+  svn_wc_operation_t operation,
+  const svn_wc_conflict_version_t *src_left_version,
+  const svn_wc_conflict_version_t *src_right_version,
+  apr_pool_t *result_pool);
+
+/* Similar to #svn_wc_conflict_description_create_tree3, but returns
+ * an svn_wc_conflict_description2_t *.
+ * 
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_wc_conflict_description2_t *
 svn_wc_conflict_description_create_tree2(
   const char *local_abspath,
@@ -2040,8 +2195,21 @@ svn_wc_conflict_description_create_tree(
 /** Return a duplicate of @a conflict, allocated in @a result_pool.
  * A deep copy of all members will be made.
  *
+ * @since New in 1.9.
+ */
+svn_wc_conflict_description3_t *
+svn_wc__conflict_description3_dup(
+  const svn_wc_conflict_description3_t *conflict,
+  apr_pool_t *result_pool);
+
+
+/** Like svn_wc__conflict_description3_dup(), but duplicates objects
+ * of type svn_wc_conflict_description2_t.
+ *
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
+SVN_DEPRECATED
 svn_wc_conflict_description2_t *
 svn_wc__conflict_description2_dup(
   const svn_wc_conflict_description2_t *conflict,
@@ -2109,9 +2277,8 @@ typedef struct svn_wc_conflict_result_t
  * Allocate an #svn_wc_conflict_result_t structure in @a pool,
  * initialize and return it.
  *
- * Set the @c choice field of the structure to @a choice, and @c
- * merged_file to @a merged_file.  Set all other fields to their @c
- * _unknown, @c NULL or invalid value, respectively. Make only a shallow
+ * Set the @c choice field of the structure to @a choice, @c merged_file
+ * to @a merged_file, and @c save_merged to false.  Make only a shallow
  * copy of the pointer argument @a merged_file.
  *
  * @since New in 1.5.
@@ -2146,7 +2313,21 @@ svn_wc_create_conflict_result(svn_wc_con
  * of conflicts are automatically resolvable and which require user
  * interaction.
  *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_wc_conflict_resolver_func3_t)(
+  svn_wc_conflict_result_t **result,
+  const svn_wc_conflict_description3_t *description,
+  void *baton,
+  apr_pool_t *result_pool,
+  apr_pool_t *scratch_pool);
+
+
+/* Similar to #svn_wc_conflict_resolver_func3_t, but expects an
+ * svn_wc_conflict_description2_t description.
+ *
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
  */
 typedef svn_error_t *(*svn_wc_conflict_resolver_func2_t)(
   svn_wc_conflict_result_t **result,
@@ -4078,6 +4259,9 @@ typedef void (*svn_wc_status_func_t)(voi
  * @a ignore_patterns is an array of file patterns matching
  * unversioned files to ignore for the purposes of status reporting,
  * or @c NULL if the default set of ignorable file patterns should be used.
+ * Patterns from #SVN_PROP_IGNORE (and, as of 1.8,
+ * #SVN_PROP_INHERITABLE_IGNORES) properties are always used, even if not
+ * specified in @a ignore_patterns.
  *
  * If @a cancel_func is non-NULL, call it with @a cancel_baton while walking
  * to determine if the client has canceled the operation.
@@ -8132,17 +8316,17 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
  *
  * If @a show_hidden and @a show_deleted are both @c FALSE, the kind of
  * scheduled for delete, administrative only 'not present' and excluded
- * nodes is reported as #svn_node_kind_node. This is recommended as a check
+ * nodes is reported as #svn_node_none. This is recommended as a check
  * for 'is there a versioned file or directory here?'
  *
  * If @a show_deleted is FALSE, but @a show_hidden is @c TRUE then only
  * scheduled for delete and administrative only 'not present' nodes are
- * reported as #svn_node_kind_none. This is recommended as check for
+ * reported as #svn_node_none. This is recommended as check for
  * 'Can I add a node here?'
  *
  * If @a show_deleted is TRUE, but @a show_hidden is FALSE, then only
  * administrative only 'not present' nodes and excluded nodes are reported as
- * #svn_node_kind_none. This behavior is the behavior bescribed as 'hidden'
+ * #svn_node_none. This behavior is the behavior bescribed as 'hidden'
  * before Subversion 1.7.
  *
  * If @a show_hidden and @a show_deleted are both @c TRUE all nodes are

Modified: subversion/branches/cache-server/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c Tue Oct 15 08:52:06 2013
@@ -32,6 +32,7 @@
 #include <glib.h>
 #include <gnome-keyring.h>
 
+#include "svn_private_config.h"
 #include "svn_auth.h"
 #include "svn_config.h"
 #include "svn_error.h"
@@ -40,8 +41,6 @@
 
 #include "private/svn_auth_private.h"
 
-#include "svn_private_config.h"
-
 
 
 /*-----------------------------------------------------------------------*/

Modified: subversion/branches/cache-server/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/add.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/add.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/add.c Tue Oct 15 08:52:06 2013
@@ -30,6 +30,8 @@
 #include <string.h>
 #include <apr_lib.h>
 #include <apr_fnmatch.h>
+
+#include "svn_private_config.h"
 #include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_string.h"
@@ -50,8 +52,6 @@
 #include "private/svn_ra_private.h"
 #include "private/svn_magic.h"
 
-#include "svn_private_config.h"
-
 
 
 /*** Code. ***/
@@ -704,15 +704,12 @@ svn_client__get_all_auto_props(apr_hash_
 
   for (i = 0; i < inherited_config_auto_props->nelts; i++)
     {
-      apr_hash_index_t *hi;
       svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
         inherited_config_auto_props, i, svn_prop_inherited_item_t *);
+      const svn_string_t *propval =
+        svn_hash_gets(elt->prop_hash, SVN_PROP_INHERITABLE_AUTO_PROPS);
 
-      for (hi = apr_hash_first(scratch_pool, elt->prop_hash);
-           hi;
-           hi = apr_hash_next(hi))
         {
-          const svn_string_t *propval = svn__apr_hash_index_val(hi);
           const char *ch = propval->data;
           svn_stringbuf_t *config_auto_prop_pattern;
           svn_stringbuf_t *config_auto_prop_val;
@@ -1131,7 +1128,7 @@ mkdir_urls(const apr_array_header_t *url
 
       if (*bname == '\0')
         return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
-                                 _("There is no valid uri above '%s'"),
+                                 _("There is no valid URI above '%s'"),
                                  common);
     }
   else
@@ -1158,7 +1155,7 @@ mkdir_urls(const apr_array_header_t *url
 
           if (*bname == '\0')
              return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
-                                      _("There is no valid uri above '%s'"),
+                                      _("There is no valid URI above '%s'"),
                                       common);
 
           for (i = 0; i < targets->nelts; i++)
@@ -1246,35 +1243,34 @@ mkdir_urls(const apr_array_header_t *url
 
 
 svn_error_t *
-svn_client__make_local_parents(const char *path,
+svn_client__make_local_parents(const char *local_abspath,
                                svn_boolean_t make_parents,
                                svn_client_ctx_t *ctx,
-                               apr_pool_t *pool)
+                               apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
   svn_node_kind_t orig_kind;
-  SVN_ERR(svn_io_check_path(path, &orig_kind, pool));
+  SVN_ERR(svn_io_check_path(local_abspath, &orig_kind, scratch_pool));
   if (make_parents)
-    SVN_ERR(svn_io_make_dir_recursively(path, pool));
+    SVN_ERR(svn_io_make_dir_recursively(local_abspath, scratch_pool));
   else
-    SVN_ERR(svn_io_dir_make(path, APR_OS_DEFAULT, pool));
+    SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
 
   /* Should no longer use svn_depth_empty to indicate that only the directory
      itself is added, since it not only constraints the operation depth, but
      also defines the depth of the target directory now. Moreover, the new
      directory will have no children at all.*/
-  err = svn_client_add5(path, svn_depth_infinity, FALSE, FALSE, FALSE,
-                        make_parents, ctx, pool);
+  err = svn_client_add5(local_abspath, svn_depth_infinity, FALSE, FALSE, FALSE,
+                        make_parents, ctx, scratch_pool);
 
   /* If we created a new directory, but couldn't add it to version
      control, then delete it. */
   if (err && (orig_kind == svn_node_none))
     {
-      /* ### If this returns an error, should we link it onto
-         err instead, so that the user is warned that we just
-         created an unversioned directory? */
-
-      svn_error_clear(svn_io_remove_dir2(path, FALSE, NULL, NULL, pool));
+      err = svn_error_compose_create(err,
+                                     svn_io_remove_dir2(local_abspath, FALSE,
+                                                        NULL, NULL,
+                                                        scratch_pool));
     }
 
   return svn_error_trace(err);
@@ -1303,23 +1299,25 @@ svn_client_mkdir4(const apr_array_header
   else
     {
       /* This is a regular "mkdir" + "svn add" */
-      apr_pool_t *subpool = svn_pool_create(pool);
+      apr_pool_t *iterpool = svn_pool_create(pool);
       int i;
 
       for (i = 0; i < paths->nelts; i++)
         {
           const char *path = APR_ARRAY_IDX(paths, i, const char *);
 
-          svn_pool_clear(subpool);
+          svn_pool_clear(iterpool);
 
           /* See if the user wants us to stop. */
           if (ctx->cancel_func)
             SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
+          SVN_ERR(svn_dirent_get_absolute(&path, path, iterpool));
+
           SVN_ERR(svn_client__make_local_parents(path, make_parents, ctx,
-                                                 subpool));
+                                                 iterpool));
         }
-      svn_pool_destroy(subpool);
+      svn_pool_destroy(iterpool);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/cache-server/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/blame.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/blame.c Tue Oct 15 08:52:06 2013
@@ -73,7 +73,7 @@ struct diff_baton {
   const struct rev *rev;
 };
 
-/* The baton used for a file revision. */
+/* The baton used for a file revision. Lives the entire operation */
 struct file_rev_baton {
   svn_revnum_t start_rev, end_rev;
   const char *target;
@@ -81,8 +81,7 @@ struct file_rev_baton {
   const svn_diff_file_options_t *diff_options;
   /* name of file containing the previous revision of the file */
   const char *last_filename;
-  struct rev *rev;     /* the rev for which blame is being assigned
-                          during a diff */
+  struct rev *last_rev;   /* the rev of the last modification */
   struct blame_chain *chain;      /* the original blame chain. */
   const char *repos_root_url;    /* To construct a url */
   apr_pool_t *mainpool;  /* lives during the whole sequence of calls */
@@ -91,7 +90,6 @@ struct file_rev_baton {
 
   /* These are used for tracking merged revisions. */
   svn_boolean_t include_merged_revisions;
-  svn_boolean_t merged_revision;
   struct blame_chain *merged_chain;  /* the merged blame chain. */
   /* name of file containing the previous merged revision of the file */
   const char *last_original_filename;
@@ -100,13 +98,16 @@ struct file_rev_baton {
   apr_pool_t *prevfilepool;
 };
 
-/* The baton used by the txdelta window handler. */
+/* The baton used by the txdelta window handler. Allocated per revision */
 struct delta_baton {
   /* Our underlying handler/baton that we wrap */
   svn_txdelta_window_handler_t wrapped_handler;
   void *wrapped_baton;
   struct file_rev_baton *file_rev_baton;
+  svn_stream_t *source_stream;  /* the delta source */
   const char *filename;
+  svn_boolean_t is_merged_revision;
+  struct rev *rev;     /* the rev struct for the current revision */
 };
 
 
@@ -325,6 +326,13 @@ window_handler(svn_txdelta_window_t *win
   if (window)
     return SVN_NO_ERROR;
 
+  /* Close the source file used for the delta.
+     It is important to do this early, since otherwise, they will be deleted
+     before all handles are closed, which leads to failures on some platforms
+     when new tempfiles are to be created. */
+  if (dbaton->source_stream)
+    SVN_ERR(svn_stream_close(dbaton->source_stream));
+
   /* If we are including merged revisions, we need to add each rev to the
      merged chain. */
   if (frb->include_merged_revisions)
@@ -334,18 +342,18 @@ window_handler(svn_txdelta_window_t *win
 
   /* Process this file. */
   SVN_ERR(add_file_blame(frb->last_filename,
-                         dbaton->filename, chain, frb->rev,
+                         dbaton->filename, chain, dbaton->rev,
                          frb->diff_options, frb->currpool));
 
   /* If we are including merged revisions, and the current revision is not a
      merged one, we need to add its blame info to the chain for the original
      line of history. */
-  if (frb->include_merged_revisions && ! frb->merged_revision)
+  if (frb->include_merged_revisions && ! dbaton->is_merged_revision)
     {
       apr_pool_t *tmppool;
 
       SVN_ERR(add_file_blame(frb->last_original_filename,
-                             dbaton->filename, frb->chain, frb->rev,
+                             dbaton->filename, frb->chain, dbaton->rev,
                              frb->diff_options, frb->currpool));
 
       /* This filename could be around for a while, potentially, so
@@ -431,26 +439,26 @@ file_rev_handler(void *baton, const char
   if (!content_delta_handler)
     return SVN_NO_ERROR;
 
-  frb->merged_revision = merged_revision;
-
   /* Create delta baton. */
   delta_baton = apr_palloc(frb->currpool, sizeof(*delta_baton));
 
   /* Prepare the text delta window handler. */
   if (frb->last_filename)
-    SVN_ERR(svn_stream_open_readonly(&last_stream, frb->last_filename,
+    SVN_ERR(svn_stream_open_readonly(&delta_baton->source_stream, frb->last_filename,
                                      frb->currpool, pool));
   else
-    last_stream = svn_stream_empty(frb->currpool);
+    /* Means empty stream below. */
+    delta_baton->source_stream = NULL;
+  last_stream = svn_stream_disown(delta_baton->source_stream, pool);
 
-  if (frb->include_merged_revisions && !frb->merged_revision)
+  if (frb->include_merged_revisions && !merged_revision)
     filepool = frb->filepool;
   else
     filepool = frb->currpool;
 
   SVN_ERR(svn_stream_open_unique(&cur_stream, &delta_baton->filename, NULL,
                                  svn_io_file_del_on_pool_cleanup,
-                                 filepool, pool));
+                                 filepool, filepool));
 
   /* Get window handler for applying delta. */
   svn_txdelta_apply(last_stream, cur_stream, NULL, NULL,
@@ -460,13 +468,14 @@ file_rev_handler(void *baton, const char
 
   /* Wrap the window handler with our own. */
   delta_baton->file_rev_baton = frb;
+  delta_baton->is_merged_revision = merged_revision;
   *content_delta_handler = window_handler;
   *content_delta_baton = delta_baton;
 
   /* Create the rev structure. */
-  frb->rev = apr_pcalloc(frb->mainpool, sizeof(struct rev));
+  delta_baton->rev = apr_pcalloc(frb->mainpool, sizeof(struct rev));
 
-  if (revnum < frb->start_rev)
+  if (revnum < MIN(frb->start_rev, frb->end_rev))
     {
       /* We shouldn't get more than one revision before the starting
          revision (unless of including merged revisions). */
@@ -475,19 +484,23 @@ file_rev_handler(void *baton, const char
 
       /* The file existed before start_rev; generate no blame info for
          lines from this revision (or before). */
-      frb->rev->revision = SVN_INVALID_REVNUM;
+      delta_baton->rev->revision = SVN_INVALID_REVNUM;
     }
   else
     {
-      SVN_ERR_ASSERT(revnum <= frb->end_rev);
+      /* 1+ for the "youngest to oldest" blame */
+      SVN_ERR_ASSERT(revnum <= 1 + MAX(frb->end_rev, frb->start_rev));
 
       /* Set values from revision props. */
-      frb->rev->revision = revnum;
-      frb->rev->rev_props = svn_prop_hash_dup(rev_props, frb->mainpool);
+      delta_baton->rev->revision = revnum;
+      delta_baton->rev->rev_props = svn_prop_hash_dup(rev_props, frb->mainpool);
     }
 
   if (frb->include_merged_revisions)
-    frb->rev->path = apr_pstrdup(frb->mainpool, path);
+    delta_baton->rev->path = apr_pstrdup(frb->mainpool, path);
+
+  /* Keep last revision for postprocessing after all changes */
+  frb->last_rev = delta_baton->rev;
 
   return SVN_NO_ERROR;
 }
@@ -572,12 +585,12 @@ svn_client_blame5(const char *target,
   struct file_rev_baton frb;
   svn_ra_session_t *ra_session;
   svn_revnum_t start_revnum, end_revnum;
-  svn_client__pathrev_t *end_loc;
   struct blame *walk, *walk_merged = NULL;
   apr_pool_t *iterpool;
   svn_stream_t *last_stream;
   svn_stream_t *stream;
   const char *target_abspath_or_url;
+  svn_revnum_t youngest;
 
   if (start->kind == svn_opt_revision_unspecified
       || end->kind == svn_opt_revision_unspecified)
@@ -590,19 +603,33 @@ svn_client_blame5(const char *target,
     SVN_ERR(svn_dirent_get_absolute(&target_abspath_or_url, target, pool));
 
   /* Get an RA plugin for this filesystem object. */
-  SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &end_loc,
-                                            target, NULL, peg_revision, end,
+  SVN_ERR(svn_client__ra_session_from_path2(&ra_session, NULL,
+                                            target, NULL, peg_revision,
+                                            peg_revision,
                                             ctx, pool));
-  end_revnum = end_loc->rev;
 
   SVN_ERR(svn_client__get_revision_number(&start_revnum, NULL, ctx->wc_ctx,
                                           target_abspath_or_url, ra_session,
                                           start, pool));
 
-  if (end_revnum < start_revnum)
-    return svn_error_create
-      (SVN_ERR_CLIENT_BAD_REVISION, NULL,
-       _("Start revision must precede end revision"));
+  SVN_ERR(svn_client__get_revision_number(&end_revnum, NULL, ctx->wc_ctx,
+                                          target_abspath_or_url, ra_session,
+                                          end, pool));
+
+  {
+    svn_client__pathrev_t *loc;
+    svn_opt_revision_t younger_end;
+    younger_end.kind = svn_opt_revision_number;
+    younger_end.value.number = MAX(start_revnum, end_revnum);
+
+    SVN_ERR(svn_client__resolve_rev_and_url(&loc, ra_session,
+                                            target, peg_revision,
+                                            &younger_end,
+                                            ctx, pool));
+  
+    /* Make the session point to the real URL. */
+    SVN_ERR(svn_ra_reparent(ra_session, loc->url, pool));
+  }
 
   /* We check the mime-type of the yougest revision before getting all
      the older revisions. */
@@ -643,6 +670,7 @@ svn_client_blame5(const char *target,
   frb.diff_options = diff_options;
   frb.include_merged_revisions = include_merged_revisions;
   frb.last_filename = NULL;
+  frb.last_rev = NULL;
   frb.last_original_filename = NULL;
   frb.chain = apr_palloc(pool, sizeof(*frb.chain));
   frb.chain->blame = NULL;
@@ -674,8 +702,11 @@ svn_client_blame5(const char *target,
      We need to ensure that we get one revision before the start_rev,
      if available so that we can know what was actually changed in the start
      revision. */
+  SVN_ERR(svn_ra_get_latest_revnum(ra_session, &youngest, frb.currpool));
   SVN_ERR(svn_ra_get_file_revs2(ra_session, "",
-                                start_revnum - (start_revnum > 0 ? 1 : 0),
+                                start_revnum 
+                                - (0 < start_revnum && start_revnum <= end_revnum ? 1 : 0)
+                                + (youngest > start_revnum && start_revnum > end_revnum ? 1 : 0),
                                 end_revnum, include_merged_revisions,
                                 file_rev_handler, &frb, pool));
 
@@ -762,7 +793,7 @@ svn_client_blame5(const char *target,
          the most recently changed revision.  ### Is this really what we want
          to do here?  Do the sematics of copy change? */
       if (!frb.chain->blame)
-        frb.chain->blame = blame_create(frb.chain, frb.rev, 0);
+        frb.chain->blame = blame_create(frb.chain, frb.last_rev, 0);
 
       normalize_blames(frb.chain, frb.merged_chain, pool);
       walk_merged = frb.merged_chain->blame;

Modified: subversion/branches/cache-server/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/cat.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/cat.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/cat.c Tue Oct 15 08:52:06 2013
@@ -27,6 +27,7 @@
 
 /*** Includes. ***/
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_client.h"
 #include "svn_string.h"
@@ -39,7 +40,6 @@
 #include "svn_props.h"
 #include "client.h"
 
-#include "svn_private_config.h"
 #include "private/svn_wc_private.h"
 
 

Modified: subversion/branches/cache-server/subversion/libsvn_client/changelist.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/changelist.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/changelist.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/changelist.c Tue Oct 15 08:52:06 2013
@@ -27,6 +27,7 @@
 
 /*** Includes. ***/
 
+#include "svn_private_config.h"
 #include "svn_client.h"
 #include "svn_wc.h"
 #include "svn_pools.h"
@@ -36,7 +37,6 @@
 
 #include "client.h"
 #include "private/svn_wc_private.h"
-#include "svn_private_config.h"
 
 
 

Modified: subversion/branches/cache-server/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/checkout.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/checkout.c Tue Oct 15 08:52:06 2013
@@ -79,8 +79,6 @@ svn_client__checkout_internal(svn_revnum
                               apr_pool_t *pool)
 {
   svn_node_kind_t kind;
-  apr_pool_t *session_pool = svn_pool_create(pool);
-  svn_ra_session_t *ra_session;
   svn_client__pathrev_t *pathrev;
 
   /* Sanity check.  Without these, the checkout is meaningless. */
@@ -94,15 +92,21 @@ svn_client__checkout_internal(svn_revnum
       && (revision->kind != svn_opt_revision_head))
     return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL);
 
-  /* Get the RA connection. */
-  SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
-                                            url, NULL, peg_revision, revision,
-                                            ctx, session_pool));
+  {
+    apr_pool_t *session_pool = svn_pool_create(pool);
+    svn_ra_session_t *ra_session;
+
+    /* Get the RA connection. */
+    SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
+                                              url, NULL, peg_revision,
+                                              revision, ctx, session_pool));
+
+    pathrev = svn_client__pathrev_dup(pathrev, pool);
+    SVN_ERR(svn_ra_check_path(ra_session, "", pathrev->rev, &kind,
+                              session_pool));
 
-  pathrev = svn_client__pathrev_dup(pathrev, pool);
-  SVN_ERR(svn_ra_check_path(ra_session, "", pathrev->rev, &kind, pool));
-
-  svn_pool_destroy(session_pool);
+    svn_pool_destroy(session_pool);
+  }
 
   if (kind == svn_node_none)
     return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,

Modified: subversion/branches/cache-server/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/cleanup.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/cleanup.c Tue Oct 15 08:52:06 2013
@@ -27,37 +27,215 @@
 
 /*** Includes. ***/
 
+#include "svn_private_config.h"
 #include "svn_time.h"
 #include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_config.h"
 #include "svn_dirent_uri.h"
+#include "svn_hash.h"
 #include "svn_path.h"
 #include "svn_pools.h"
 #include "client.h"
 #include "svn_props.h"
 
-#include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
 
+struct cleanup_status_walk_baton
+{
+  svn_boolean_t include_externals;
+  svn_boolean_t remove_unversioned_items;
+  svn_boolean_t remove_ignored_items;
+  svn_client_ctx_t *ctx;
+};
+
+/* Forward declararion. */
+static svn_error_t *
+cleanup_status_walk(void *baton,
+                    const char *local_abspath,
+                    const svn_wc_status3_t *status,
+                    apr_pool_t *scratch_pool);
+
+static svn_error_t *
+do_cleanup(const char *local_abspath,
+           svn_boolean_t include_externals,
+           svn_boolean_t remove_unversioned_items,
+           svn_boolean_t remove_ignored_items,
+           svn_client_ctx_t *ctx,
+           apr_pool_t *scratch_pool)
+{
+  svn_error_t *err;
+
+  if (remove_unversioned_items || remove_ignored_items)
+    {
+      svn_boolean_t is_locked_here;
+      svn_boolean_t is_locked;
+      svn_boolean_t sqlite_exclusive;
+      svn_config_t *cfg = ctx->config
+                          ? svn_hash_gets(ctx->config,
+                                          SVN_CONFIG_CATEGORY_CONFIG)
+                          : NULL;
+
+      /* Check if someone else owns a lock for LOCAL_ABSPATH. */
+      SVN_ERR(svn_wc_locked2(&is_locked_here, &is_locked, ctx->wc_ctx,
+                             local_abspath, scratch_pool));
+      if (is_locked && !is_locked_here)
+        return svn_error_createf(SVN_ERR_WC_LOCKED, NULL,
+                                 _("Working copy at '%s' is already locked."),
+                                 svn_dirent_local_style(local_abspath,
+                                                        scratch_pool));
+
+      SVN_ERR(svn_config_get_bool(cfg, &sqlite_exclusive,
+                                  SVN_CONFIG_SECTION_WORKING_COPY,
+                                  SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+                                  FALSE));
+      if (sqlite_exclusive)
+        {
+          /* Close the db because svn_wc_cleanup3() will try to open it again,
+           * which doesn't work if exclusive sqlite locking mode is enabled. */
+          SVN_ERR(svn_wc__close_db(local_abspath, ctx->wc_ctx, scratch_pool));
+        }
+    }
+
+  err = svn_wc_cleanup3(ctx->wc_ctx, local_abspath, ctx->cancel_func,
+                        ctx->cancel_baton, scratch_pool);
+  svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
+  if (err)
+    return svn_error_trace(err);
+
+  if (remove_unversioned_items || remove_ignored_items || include_externals)
+    {
+      struct cleanup_status_walk_baton b;
+      apr_array_header_t *ignores;
+
+      b.include_externals = include_externals;
+      b.remove_unversioned_items = remove_unversioned_items;
+      b.remove_ignored_items = remove_ignored_items;
+      b.include_externals = include_externals;
+      b.ctx = ctx;
+
+      SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, scratch_pool));
+      SVN_ERR(svn_wc_walk_status(ctx->wc_ctx, local_abspath,
+                                 svn_depth_infinity,
+                                 TRUE,  /* get all */
+                                 remove_ignored_items,
+                                 TRUE,  /* ignore textmods */
+                                 ignores,
+                                 cleanup_status_walk, &b,
+                                 ctx->cancel_func,
+                                 ctx->cancel_baton,
+                                 scratch_pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
+/* An implementation of svn_wc_status_func4_t. */
+static svn_error_t *
+cleanup_status_walk(void *baton,
+                    const char *local_abspath,
+                    const svn_wc_status3_t *status,
+                    apr_pool_t *scratch_pool)
+{
+  struct cleanup_status_walk_baton *b = baton;
+  svn_node_kind_t kind_on_disk;
+  svn_wc_notify_t *notify;
+
+  if (status->node_status == svn_wc_status_external && b->include_externals)
+    {
+      svn_error_t *err;
+
+      SVN_ERR(svn_io_check_path(local_abspath, &kind_on_disk, scratch_pool));
+      if (kind_on_disk == svn_node_dir)
+        {
+          if (b->ctx->notify_func2)
+            {
+              notify = svn_wc_create_notify(local_abspath,
+                                            svn_wc_notify_cleanup_external,
+                                            scratch_pool);
+              (*b->ctx->notify_func2)(b->ctx->notify_baton2, notify,
+                                      scratch_pool);
+            }
+
+          err = do_cleanup(local_abspath, b->include_externals,
+                            b->remove_unversioned_items,
+                            b->remove_ignored_items,
+                            b->ctx, scratch_pool);
+          if (err && err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
+            {
+              svn_error_clear(err);
+              return SVN_NO_ERROR;
+            }
+          else
+            SVN_ERR(err);
+        }
+
+      return SVN_NO_ERROR;
+    }
+
+  if (status->node_status == svn_wc_status_ignored)
+    {
+      if (!b->remove_ignored_items)
+        return SVN_NO_ERROR;
+    }
+  else if (status->node_status == svn_wc_status_unversioned)
+    {
+      if (!b->remove_unversioned_items)
+        return SVN_NO_ERROR;
+    }
+  else
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_io_check_path(local_abspath, &kind_on_disk, scratch_pool));
+  switch (kind_on_disk)
+    {
+      case svn_node_file:
+      case svn_node_symlink:
+        SVN_ERR(svn_io_remove_file2(local_abspath, FALSE, scratch_pool));
+        break;
+      case svn_node_dir:
+        SVN_ERR(svn_io_remove_dir2(local_abspath, FALSE,
+                                   b->ctx->cancel_func, b->ctx->cancel_baton,
+                                   scratch_pool));
+        break;
+      case svn_node_none:
+      default:
+        return SVN_NO_ERROR;
+    }
+
+  if (b->ctx->notify_func2)
+    {
+      notify = svn_wc_create_notify(local_abspath, svn_wc_notify_delete,
+                                    scratch_pool);
+      notify->kind = kind_on_disk;
+      (*b->ctx->notify_func2)(b->ctx->notify_baton2, notify, scratch_pool);
+    }
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
-svn_client_cleanup(const char *path,
-                   svn_client_ctx_t *ctx,
-                   apr_pool_t *scratch_pool)
+svn_client_cleanup2(const char *path,
+                    svn_boolean_t include_externals,
+                    svn_boolean_t remove_unversioned_items,
+                    svn_boolean_t remove_ignored_items,
+                    svn_client_ctx_t *ctx,
+                    apr_pool_t *scratch_pool)
 {
   const char *local_abspath;
-  svn_error_t *err;
 
   if (svn_path_is_url(path))
     return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
                              _("'%s' is not a local path"), path);
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
+  SVN_ERR(do_cleanup(local_abspath, include_externals,
+                     remove_unversioned_items, remove_ignored_items,
+                     ctx, scratch_pool));
 
-  err = svn_wc_cleanup3(ctx->wc_ctx, local_abspath, ctx->cancel_func,
-                        ctx->cancel_baton, scratch_pool);
-  svn_io_sleep_for_timestamps(path, scratch_pool);
-  return svn_error_trace(err);
+  return SVN_NO_ERROR;
 }

Modified: subversion/branches/cache-server/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/client.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/client.h (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/client.h Tue Oct 15 08:52:06 2013
@@ -20,7 +20,8 @@
  *    under the License.
  * ====================================================================
  */
-
+
+
 
 #ifndef SVN_LIBSVN_CLIENT_H
 #define SVN_LIBSVN_CLIENT_H
@@ -208,7 +209,9 @@ svn_client__repos_location_segments(apr_
    Use the authentication baton cached in CTX to authenticate against
    the repository.  Use POOL for all allocations.
 
-   See also svn_client__youngest_common_ancestor().
+   See also svn_client__calc_youngest_common_ancestor() to find youngest
+   common ancestor for already fetched history-as-mergeinfo information.
+
 */
 svn_error_t *
 svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
@@ -219,6 +222,34 @@ svn_client__get_youngest_common_ancestor
                                          apr_pool_t *result_pool,
                                          apr_pool_t *scratch_pool);
 
+/* Find the common ancestor of two locations in a repository using already
+   fetched history-as-mergeinfo information.
+
+   Ancestry is determined by the 'copy-from' relationship and the normal
+   successor relationship.
+
+   Set *ANCESTOR_P to the location of the youngest common ancestor of
+   LOC1 and LOC2.  If the locations have no common ancestor (including if
+   they don't have the same repository root URL), set *ANCESTOR_P to NULL.
+
+   HISTORY1, HAS_REV_ZERO_HISTORY1, HISTORY2, HAS_REV_ZERO_HISTORY2 are
+   history-as-mergeinfo information as returned by
+   svn_client__get_history_as_mergeinfo() for LOC1 and LOC2 respectively.
+
+   See also svn_client__get_youngest_common_ancestor().
+
+*/
+svn_error_t *
+svn_client__calc_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
+                                          const svn_client__pathrev_t *loc1,
+                                          apr_hash_t *history1,
+                                          svn_boolean_t has_rev_zero_history1,
+                                          const svn_client__pathrev_t *loc2,
+                                          apr_hash_t *history2,
+                                          svn_boolean_t has_rev_zero_history2,
+                                          apr_pool_t *result_pool,
+                                          apr_pool_t *scratch_pool);
+
 /* Ensure that RA_SESSION's session URL matches SESSION_URL,
    reparenting that session if necessary.
    Store the previous session URL in *OLD_SESSION_URL (so that if the
@@ -247,7 +278,8 @@ svn_client__ensure_ra_session_url(const 
                                   apr_pool_t *pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** RA callbacks ***/
 
 
@@ -329,7 +361,8 @@ svn_client__ra_make_cb_baton(svn_wc_cont
                              apr_pool_t *result_pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Add/delete ***/
 
 /* If AUTOPROPS is not null: Then read automatic properties matching PATH
@@ -433,16 +466,17 @@ svn_client__wc_delete_many(const apr_arr
                            apr_pool_t *pool);
 
 
-/* Make PATH and add it to the working copy, optionally making all the
-   intermediate parent directories if MAKE_PARENTS is TRUE. */
+/* Make LOCAL_ABSPATH and add it to the working copy, optionally making all
+   the intermediate parent directories if MAKE_PARENTS is TRUE. */
 svn_error_t *
-svn_client__make_local_parents(const char *path,
+svn_client__make_local_parents(const char *local_abspath,
                                svn_boolean_t make_parents,
                                svn_client_ctx_t *ctx,
                                apr_pool_t *pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Checkout, update and switch ***/
 
 /* Update a working copy LOCAL_ABSPATH to REVISION, and (if not NULL) set
@@ -581,7 +615,8 @@ svn_client__switch_internal(svn_revnum_t
                             apr_pool_t *pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Inheritable Properties ***/
 
 /* Convert any svn_prop_inherited_item_t elements in INHERITED_PROPS which
@@ -626,7 +661,8 @@ svn_client__get_inheritable_props(apr_ha
                                   apr_pool_t *scratch_pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Editor for repository diff ***/
 
 /* Create an editor for a pure repository comparison, i.e. comparing one
@@ -666,7 +702,8 @@ svn_client__get_diff_editor2(const svn_d
                              apr_pool_t *result_pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Editor for diff summary ***/
 
 /* Set *CALLBACKS and *CALLBACK_BATON to a set of diff callbacks that will
@@ -689,7 +726,8 @@ svn_client__get_diff_summarize_callbacks
                         apr_pool_t *pool);
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Copy Stuff ***/
 
 /* This structure is used to associate a specific copy or move SRC with a
@@ -730,7 +768,8 @@ typedef struct svn_client__copy_pair_t
 } svn_client__copy_pair_t;
 
 /* ---------------------------------------------------------------- */
-
+
+
 /*** Commit Stuff ***/
 
 /* WARNING: This is all new, untested, un-peer-reviewed conceptual
@@ -944,7 +983,8 @@ svn_client__do_commit(const char *base_u
                       apr_pool_t *scratch_pool);
 
 
-
+
+
 /*** Externals (Modules) ***/
 
 /* Handle changes to the svn:externals property described by EXTERNALS_NEW,
@@ -1116,7 +1156,8 @@ svn_client__resolve_conflicts(svn_boolea
                               svn_client_ctx_t *ctx,
                               apr_pool_t *scratch_pool);
 
-
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/cache-server/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/commit.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/commit.c Tue Oct 15 08:52:06 2013
@@ -30,6 +30,8 @@
 #include <string.h>
 #include <apr_strings.h>
 #include <apr_hash.h>
+
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_wc.h"
 #include "svn_ra.h"
@@ -46,8 +48,6 @@
 #include "private/svn_wc_private.h"
 #include "private/svn_ra_private.h"
 
-#include "svn_private_config.h"
-
 struct capture_baton_t {
   svn_commit_callback2_t original_callback;
   void *original_baton;
@@ -240,6 +240,13 @@ post_process_commit_item(svn_wc_committe
   remove_lock = (! keep_locks && (item->state_flags
                                        & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN));
 
+  /* When the node was deleted (or replaced), we need to always remove the 
+     locks, as they're invalidated on the server. We cannot honor the 
+     SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN flag here because it does not tell
+     us whether we have locked children. */
+  if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+    remove_lock = TRUE;
+
   return svn_wc_queue_committed3(queue, wc_ctx, item->path,
                                  loop_recurse, item->incoming_prop_changes,
                                  remove_lock, !keep_changelists,
@@ -847,6 +854,19 @@ svn_client_commit6(const apr_array_heade
                               svn_dirent_local_style(item->path, iterpool),
                               svn_dirent_local_style(delete_op_root_abspath,
                                                      iterpool));
+
+                  if (ctx->notify_func2)
+                    {
+                      svn_wc_notify_t *notify;
+                      notify = svn_wc_create_notify(
+                                    delete_op_root_abspath,
+                                    svn_wc_notify_failed_requires_target,
+                                    iterpool);
+                      notify->err = cmt_err;
+
+                      ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
+                    }
+
                   goto cleanup;
                 }
             }
@@ -878,6 +898,19 @@ svn_client_commit6(const apr_array_heade
                          svn_dirent_local_style(item->path, iterpool),
                          svn_dirent_local_style(copy_op_root_abspath,
                                                 iterpool));
+
+              if (ctx->notify_func2)
+                {
+                    svn_wc_notify_t *notify;
+                    notify = svn_wc_create_notify(
+                                copy_op_root_abspath,
+                                svn_wc_notify_failed_requires_target,
+                                iterpool);
+                    notify->err = cmt_err;
+
+                    ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
+                }
+
               goto cleanup;
             }
         }
@@ -992,9 +1025,22 @@ svn_client_commit6(const apr_array_heade
     }
 
  cleanup:
-  /* Sleep to ensure timestamp integrity. */
+  /* Sleep to ensure timestamp integrity.  BASE_ABSPATH may have been
+     removed by the commit or it may the common ancestor of multiple
+     working copies. */
   if (timestamp_sleep)
-    svn_io_sleep_for_timestamps(base_abspath, pool);
+    {
+      const char *sleep_abspath;
+      svn_error_t *err = svn_wc__get_wcroot(&sleep_abspath, ctx->wc_ctx,
+                                            base_abspath, pool, pool);
+      if (err)
+        {
+          svn_error_clear(err);
+          sleep_abspath = base_abspath;
+        }
+
+      svn_io_sleep_for_timestamps(sleep_abspath, pool);
+    }
 
   /* Abort the commit if it is still in progress. */
   svn_pool_clear(iterpool); /* Close open handles before aborting */

Modified: subversion/branches/cache-server/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_client/commit_util.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_client/commit_util.c Tue Oct 15 08:52:06 2013
@@ -30,6 +30,7 @@
 #include <apr_hash.h>
 #include <apr_md5.h>
 
+#include "svn_private_config.h"
 #include "client.h"
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
@@ -42,7 +43,6 @@
 #include <assert.h>
 #include <stdlib.h>  /* for qsort() */
 
-#include "svn_private_config.h"
 #include "private/svn_wc_private.h"
 #include "private/svn_client_private.h"