aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/include/private
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/include/private')
-rw-r--r--subversion/include/private/svn_branch.h2
-rw-r--r--subversion/include/private/svn_client_mtcc.h11
-rw-r--r--subversion/include/private/svn_client_private.h234
-rw-r--r--subversion/include/private/svn_client_shelf.h498
-rw-r--r--subversion/include/private/svn_client_shelf2.h467
-rw-r--r--subversion/include/private/svn_dep_compat.h6
-rw-r--r--subversion/include/private/svn_diff_tree.h1
-rw-r--r--subversion/include/private/svn_dirent_uri_private.h53
-rw-r--r--subversion/include/private/svn_element.h2
-rw-r--r--subversion/include/private/svn_fs_fs_private.h97
-rw-r--r--subversion/include/private/svn_repos_private.h47
-rw-r--r--subversion/include/private/svn_sorts_private.h31
-rw-r--r--subversion/include/private/svn_subr_private.h14
-rw-r--r--subversion/include/private/svn_wc_private.h82
14 files changed, 1429 insertions, 116 deletions
diff --git a/subversion/include/private/svn_branch.h b/subversion/include/private/svn_branch.h
index 3fbaeb7ef77c..df3a91c9a488 100644
--- a/subversion/include/private/svn_branch.h
+++ b/subversion/include/private/svn_branch.h
@@ -98,7 +98,7 @@ extern "C" {
*
* An element may appear in any or all branches, and its EID is the same in
* each branch in which the element appears.
- *
+ *
* By definition, an element keeps the same EID for its whole lifetime, even
* if deleted from all branches and later 'resurrected'.
*
diff --git a/subversion/include/private/svn_client_mtcc.h b/subversion/include/private/svn_client_mtcc.h
index fe670b04e530..d8bc9029cfaf 100644
--- a/subversion/include/private/svn_client_mtcc.h
+++ b/subversion/include/private/svn_client_mtcc.h
@@ -207,6 +207,17 @@ svn_client__mtcc_check_path(svn_node_kind_t *kind,
/** Commits all operations stored in @a mtcc as a new revision and destroys
* @a mtcc.
*
+ * A log message is obtained from the log message callback in the client
+ * context in @a mtcc.
+ *
+ * @a revprop_table (if non-NULL) supplies additional revision properties;
+ * it may not supply any "svn:*" revision properties.
+ *
+ * As with svn_ra_get_commit_editor3(), after the commit has succeeded,
+ * it will invoke @a commit_callback (if non-NULL) with filled-in
+ * #svn_commit_info_t *, @a commit_baton, and @a scratch_pool or some subpool
+ * thereof as arguments.
+ *
* @since New in 1.9.
*/
svn_error_t *
diff --git a/subversion/include/private/svn_client_private.h b/subversion/include/private/svn_client_private.h
index 892fc4b0b574..614405ac7f35 100644
--- a/subversion/include/private/svn_client_private.h
+++ b/subversion/include/private/svn_client_private.h
@@ -281,26 +281,6 @@ svn_client__wc_node_get_origin(svn_client__pathrev_t **origin_p,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Copy the file or directory on URL in some repository to DST_ABSPATH,
- * copying node information and properties. Resolve URL using PEG_REV and
- * REVISION.
- *
- * If URL specifies a directory, create the copy using depth DEPTH.
- *
- * If MAKE_PARENTS is TRUE and DST_ABSPATH doesn't have an added parent
- * create missing parent directories
- */
-svn_error_t *
-svn_client__copy_foreign(const char *url,
- const char *dst_abspath,
- svn_opt_revision_t *peg_revision,
- svn_opt_revision_t *revision,
- svn_depth_t depth,
- svn_boolean_t make_parents,
- svn_boolean_t already_locked,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool);
-
/* Same as the public svn_client_mergeinfo_log2 API, except for the addition
* of the TARGET_MERGEINFO_CATALOG and RESULT_POOL parameters.
*
@@ -341,6 +321,220 @@ svn_client__mergeinfo_log(svn_boolean_t finding_merged,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/** Return a diff processor that will print a Subversion-style
+ * (not git-style) diff.
+ *
+ * @a anchor is optional (may be null), and is the 'anchor' path to prefix
+ * to the diff-processor paths before displaying.
+ *
+ * @a orig_path_1 and @a orig_path_2 are the two main root paths to be
+ * diffed; each may be a URL, a local WC path or a local unversioned path.
+ *
+ * Other arguments are as for svn_client_diff7() etc.
+ */
+svn_error_t *
+svn_client__get_diff_writer_svn(
+ svn_diff_tree_processor_t **diff_processor,
+ const char *anchor,
+ const char *orig_path_1,
+ const char *orig_path_2,
+ const apr_array_header_t *options,
+ const char *relative_to_dir,
+ svn_boolean_t no_diff_added,
+ svn_boolean_t no_diff_deleted,
+ svn_boolean_t show_copies_as_adds,
+ svn_boolean_t ignore_content_type,
+ svn_boolean_t ignore_properties,
+ svn_boolean_t properties_only,
+ svn_boolean_t pretty_print_mergeinfo,
+ const char *header_encoding,
+ svn_stream_t *outstream,
+ svn_stream_t *errstream,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/*** Editor for diff summary ***/
+
+/* Set *DIFF_PROCESSOR to a diff processor that will report a diff summary
+ to SUMMARIZE_FUNC.
+
+ SUMMARIZE_FUNC is called with SUMMARIZE_BATON as parameter by the
+ created callbacks for each changed item.
+*/
+svn_error_t *
+svn_client__get_diff_summarize_callbacks(
+ svn_diff_tree_processor_t **diff_processor,
+ svn_client_diff_summarize_func_t summarize_func,
+ void *summarize_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Copy a directory tree or a file (according to @a kind) from @a src_url at
+ * @a src_rev, to @a dst_abspath in a WC.
+ *
+ * The caller should be holding a WC write lock that allows @a dst_abspath to
+ * be created, such as on the parent of @a dst_abspath.
+ *
+ * If not same repositories, then remove any svn:mergeinfo property.
+ *
+ * Use @a ra_session to fetch the data. The session may point to any URL
+ * within the source repository.
+ *
+ * This API does not process any externals definitions that may be present
+ * on copied directories.
+ */
+svn_error_t *
+svn_client__repos_to_wc_copy_internal(svn_boolean_t *timestamp_sleep,
+ svn_node_kind_t kind,
+ const char *src_url,
+ svn_revnum_t src_rev,
+ const char *dst_abspath,
+ svn_ra_session_t *ra_session,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/** Copy a directory tree or a file (according to @a kind) from @a src_url at
+ * @a src_rev, to @a dst_abspath in a WC.
+ *
+ * The caller should be holding a WC write lock that allows @a dst_abspath to
+ * be created, such as on the parent of @a dst_abspath.
+ *
+ * If not same repositories, then remove any svn:mergeinfo property.
+ *
+ * Use @a ra_session to fetch the data. The session may point to a different
+ * URL after returning.
+ *
+ * This API does not process any externals definitions that may be present
+ * on copied directories.
+ */
+svn_error_t *
+svn_client__repos_to_wc_copy_by_editor(svn_boolean_t *timestamp_sleep,
+ svn_node_kind_t kind,
+ const char *src_url,
+ svn_revnum_t src_rev,
+ const char *dst_abspath,
+ svn_ra_session_t *ra_session,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/** Return an editor for applying local modifications to a WC.
+ *
+ * Return an editor in @a *editor_p, @a *edit_baton_p that will apply
+ * local modifications to the WC subdirectory at @a dst_abspath.
+ *
+ * The @a path arguments to the editor methods shall be local WC paths,
+ * relative to @a dst_abspath. The @a copyfrom_path arguments to the
+ * editor methods shall be URLs.
+ *
+ * Send notifications via @a notify_func / @a notify_baton.
+ * ### INCOMPLETE
+ *
+ * @a ra_session is used to fetch the original content for copies.
+ *
+ * Ignore changes to non-regular property (entry-props, DAV/WC-props).
+ *
+ * Acquire the WC write lock in 'open_root' and release it in
+ * 'close_edit', in 'abort_edit', or when @a result_pool is cleared.
+ */
+svn_error_t *
+svn_client__wc_editor(const svn_delta_editor_t **editor_p,
+ void **edit_baton_p,
+ const char *dst_abspath,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_ra_session_t *ra_session,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/* Return an editor for applying local modifications to a WC.
+ *
+ * Like svn_client__wc_editor() but with additional options.
+ *
+ * If @a root_dir_add is true, then create and schedule for addition
+ * the root directory of this edit, else assume it is already a versioned,
+ * existing directory.
+ *
+ * If @a ignore_mergeinfo_changes is true, ignore any incoming changes
+ * to the 'svn:mergeinfo' property.
+ *
+ * If @a manage_wc_write_lock is true, acquire the WC write lock in
+ * 'open_root' and release it in 'close_edit', in 'abort_edit', or
+ * when @a result_pool is cleared.
+ */
+svn_error_t *
+svn_client__wc_editor_internal(const svn_delta_editor_t **editor_p,
+ void **edit_baton_p,
+ const char *dst_abspath,
+ svn_boolean_t root_dir_add,
+ svn_boolean_t ignore_mergeinfo_changes,
+ svn_boolean_t manage_wc_write_lock,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_ra_session_t *ra_session,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/** Send committable changes found in the WC to a delta-editor.
+ *
+ * Committable changes are found in TARGETS:DEPTH:CHANGELISTS.
+ *
+ * Send the changes to @a editor:@a edit_baton. The @a path arguments
+ * to the editor methods are URL-paths relative to the URL of
+ * @a src_wc_abspath.
+ *
+ * ### We will presumably need to change this so that the @a path
+ * arguments to the editor will be local WC relpaths, in order
+ * to handle switched paths.
+ *
+ * The @a copyfrom_path arguments to the editor methods are URLs. As the
+ * WC does not store copied-from-foreign-repository metadata, the URL will
+ * be in the same repository as the URL of its parent path.
+ *
+ * Compared with svn_client__do_commit(), this (like svn_client_commit6)
+ * handles:
+ * - condense targets and find committable paths
+ * - checking only one repository is involved
+ *
+ * Compared with svn_client_commit6(), this does not handle:
+ * - externals
+ * - log message
+ * - revprops
+ * - checking the commit includes both halves of each local move
+ * - changing the copy revision of each local move to ~HEAD
+ * - WC write locks
+ * - bumping revisions in WC
+ * - removing locks and changelists in WC
+ */
+svn_error_t *
+svn_client__wc_replay(const char *src_wc_abspath,
+ const apr_array_header_t *targets,
+ svn_depth_t depth,
+ const apr_array_header_t *changelists,
+ const svn_delta_editor_t *editor,
+ void *edit_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/** Copy local modifications from one WC subtree to another.
+ *
+ * Find local modifications under @a src_wc_abspath, in the same way as
+ * for a commit.
+ *
+ * Edit the WC at @a dst_wc_abspath, applying those modifications to the
+ * current working state to produce a new working state.
+ *
+ * The source and destination may be in the same WC or in different WCs.
+ */
+svn_error_t *
+svn_client__wc_copy_mods(const char *src_wc_abspath,
+ const char *dst_wc_abspath,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/subversion/include/private/svn_client_shelf.h b/subversion/include/private/svn_client_shelf.h
new file mode 100644
index 000000000000..0d747cdcd36f
--- /dev/null
+++ b/subversion/include/private/svn_client_shelf.h
@@ -0,0 +1,498 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file svn_client_shelf.h
+ * @brief Subversion's client library: experimental shelving v3
+ */
+
+#ifndef SVN_CLIENT_SHELF_H
+#define SVN_CLIENT_SHELF_H
+
+#include <apr.h>
+#include <apr_pools.h>
+#include <apr_hash.h>
+#include <apr_time.h>
+
+#include "svn_client.h"
+#include "svn_types.h"
+#include "svn_string.h"
+#include "svn_wc.h"
+#include "svn_diff.h"
+#include "private/svn_diff_tree.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/** Shelving v3, with checkpoints
+ *
+ * @defgroup svn_client_shelves_checkpoints Shelves and checkpoints
+ * @{
+ */
+
+/** A shelf.
+ *
+ * @warning EXPERIMENTAL.
+ */
+typedef struct svn_client__shelf_t
+{
+ /* Public fields (read-only for public use) */
+ const char *name;
+ int max_version; /**< @deprecated */
+
+ /* Private fields */
+ const char *wc_root_abspath;
+ const char *shelves_dir;
+ apr_hash_t *revprops; /**< non-null; allocated in POOL */
+ svn_client_ctx_t *ctx;
+ apr_pool_t *pool;
+} svn_client__shelf_t;
+
+/** One version of a shelved change-set.
+ *
+ * @warning EXPERIMENTAL.
+ */
+typedef struct svn_client__shelf_version_t
+{
+ /* Public fields (read-only for public use) */
+ svn_client__shelf_t *shelf;
+ apr_time_t mtime; /**< time-stamp of this version */
+
+ /* Private fields */
+ const char *files_dir_abspath; /**< abspath of the storage area */
+ int version_number; /**< version number starting from 1 */
+} svn_client__shelf_version_t;
+
+/** Open an existing shelf or create a new shelf.
+ *
+ * Create a new shelf (containing no versions) if a shelf named @a name
+ * is not found.
+ *
+ * The shelf should be closed after use by calling svn_client_shelf_close().
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_open_or_create(svn_client__shelf_t **shelf_p,
+ const char *name,
+ const char *local_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/** Open an existing shelf named @a name, or error if it doesn't exist.
+ *
+ * The shelf should be closed after use by calling svn_client_shelf_close().
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_open_existing(svn_client__shelf_t **shelf_p,
+ const char *name,
+ const char *local_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/** Close @a shelf.
+ *
+ * If @a shelf is NULL, do nothing; otherwise @a shelf must be an open shelf.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_close(svn_client__shelf_t *shelf,
+ apr_pool_t *scratch_pool);
+
+/** Delete the shelf named @a name, or error if it doesn't exist.
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_delete(const char *name,
+ const char *local_abspath,
+ svn_boolean_t dry_run,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/** Get an editor that, when driven, will store changes in @a shelf_version.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_mods_editor(const svn_delta_editor_t **editor_p,
+ void **edit_baton_p,
+ svn_client__shelf_version_t *shelf_version,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/** Save the local modifications found by @a paths, @a depth,
+ * @a changelists as a new version of @a shelf.
+ *
+ * If any paths are shelved, create a new shelf-version and return the new
+ * shelf-version in @a *new_version_p, else set @a *new_version_p to null.
+ * @a new_version_p may be null if that output is not wanted; a new shelf-
+ * version is still saved and may be found through @a shelf.
+ *
+ * @a paths are relative to the CWD, or absolute.
+ *
+ * For each successfully shelved path: call @a shelved_func (if not null)
+ * with @a shelved_baton.
+ *
+ * If any paths cannot be shelved: if @a not_shelved_func is given, call
+ * it with @a not_shelved_baton for each such path, and still create a new
+ * shelf-version if any paths are shelved.
+ *
+ * This function does not revert the changes from the WC; use
+ * svn_client_shelf_unapply() for that.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_save_new_version3(svn_client__shelf_version_t **new_version_p,
+ svn_client__shelf_t *shelf,
+ const apr_array_header_t *paths,
+ svn_depth_t depth,
+ const apr_array_header_t *changelists,
+ svn_client_status_func_t shelved_func,
+ void *shelved_baton,
+ svn_client_status_func_t not_shelved_func,
+ void *not_shelved_baton,
+ apr_pool_t *scratch_pool);
+
+/** Delete all newer versions of @a shelf newer than @a shelf_version.
+ *
+ * If @a shelf_version is null, delete all versions of @a shelf. (The
+ * shelf will still exist, with any log message and other revprops, but
+ * with no versions in it.)
+ *
+ * Leave the shelf's log message and other revprops unchanged.
+ *
+ * Any #svn_client__shelf_version_t object that refers to a deleted version
+ * will become invalid: attempting to use it will give undefined behaviour.
+ * The given @a shelf_version will remain valid.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_delete_newer_versions(svn_client__shelf_t *shelf,
+ svn_client__shelf_version_t *shelf_version,
+ apr_pool_t *scratch_pool);
+
+/** Return in @a shelf_version an existing version of @a shelf, given its
+ * @a version_number (starting from 1). Error if that version doesn't exist.
+ *
+ * There is no need to "close" it after use.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_version_open(svn_client__shelf_version_t **shelf_version_p,
+ svn_client__shelf_t *shelf,
+ int version_number,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Return in @a shelf_version the newest version of @a shelf.
+ *
+ * Set @a shelf_version to null if no versions exist.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_get_newest_version(svn_client__shelf_version_t **shelf_version_p,
+ svn_client__shelf_t *shelf,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Return in @a versions_p an array of (#svn_client__shelf_version_t *)
+ * containing all versions of @a shelf.
+ *
+ * The versions will be in chronological order, oldest to newest.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_get_all_versions(apr_array_header_t **versions_p,
+ svn_client__shelf_t *shelf,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Apply @a shelf_version to the WC.
+ *
+ * If @a dry_run is true, try applying the shelf-version to the WC and
+ * report the full set of notifications about successes and conflicts,
+ * but leave the WC untouched.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_apply(svn_client__shelf_version_t *shelf_version,
+ svn_boolean_t dry_run,
+ apr_pool_t *scratch_pool);
+
+/** Test whether we can successfully apply the changes for @a file_relpath
+ * in @a shelf_version to the WC.
+ *
+ * Set @a *conflict_p to true if the changes conflict with the WC state,
+ * else to false.
+ *
+ * If @a file_relpath is not found in @a shelf_version, set @a *conflict_p
+ * to FALSE.
+ *
+ * @a file_relpath is relative to the WC root.
+ *
+ * A conflict means the shelf cannot be applied successfully to the WC
+ * because the change to be applied is not compatible with the current
+ * working state of the WC file. Examples are a text conflict, or the
+ * file does not exist or is a directory, or the shelf is trying to add
+ * the file but it already exists, or trying to delete it but it does not
+ * exist.
+ *
+ * Return an error only if something is broken, e.g. unable to read data
+ * from the specified shelf-version.
+ *
+ * Leave the WC untouched.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_test_apply_file(svn_boolean_t *conflict_p,
+ svn_client__shelf_version_t *shelf_version,
+ const char *file_relpath,
+ apr_pool_t *scratch_pool);
+
+/** Reverse-apply @a shelf_version to the WC.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_unapply(svn_client__shelf_version_t *shelf_version,
+ svn_boolean_t dry_run,
+ apr_pool_t *scratch_pool);
+
+/** Send committable changes found in a shelf to a delta-editor.
+ *
+ * Push changes from the @a shelf_version subtree at @a top_relpath
+ * to @a editor : @a edit_baton.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_replay(svn_client__shelf_version_t *shelf_version,
+ const char *top_relpath,
+ const svn_delta_editor_t *editor,
+ void *edit_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ apr_pool_t *scratch_pool);
+
+/** Set @a *affected_paths to a hash with one entry for each path affected
+ * by the @a shelf_version.
+ *
+ * The hash key is the path of the affected file, relative to the WC root.
+ *
+ * (Future possibility: When moves and copies are supported, the hash key
+ * is the old path and value is the new path.)
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_paths_changed(apr_hash_t **affected_paths,
+ svn_client__shelf_version_t *shelf_version,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Set @a shelf's revprop @a prop_name to @a prop_val.
+ *
+ * This can be used to set or change the shelf's log message
+ * (property name "svn:log" or #SVN_PROP_REVISION_LOG).
+ *
+ * If @a prop_val is NULL, delete the property (if present).
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_revprop_set(svn_client__shelf_t *shelf,
+ const char *prop_name,
+ const svn_string_t *prop_val,
+ apr_pool_t *scratch_pool);
+
+/** Set @a shelf's revprops to @a revprop_table.
+ *
+ * This deletes all previous revprops.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_revprop_set_all(svn_client__shelf_t *shelf,
+ apr_hash_t *revprop_table,
+ apr_pool_t *scratch_pool);
+
+/** Get @a shelf's revprop @a prop_name into @a *prop_val.
+ *
+ * If the property is not present, set @a *prop_val to NULL.
+ *
+ * This can be used to get the shelf's log message
+ * (property name "svn:log" or #SVN_PROP_REVISION_LOG).
+ *
+ * The lifetime of the result is limited to that of @a shelf and/or
+ * of @a result_pool.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_revprop_get(svn_string_t **prop_val,
+ svn_client__shelf_t *shelf,
+ const char *prop_name,
+ apr_pool_t *result_pool);
+
+/** Get @a shelf's revprops into @a props.
+ *
+ * The lifetime of the result is limited to that of @a shelf and/or
+ * of @a result_pool.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_revprop_list(apr_hash_t **props,
+ svn_client__shelf_t *shelf,
+ apr_pool_t *result_pool);
+
+/** Set the log message in @a shelf to @a log_message.
+ *
+ * If @a log_message is null, delete the log message.
+ *
+ * Similar to svn_client_shelf_revprop_set(... SVN_PROP_REVISION_LOG ...).
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_set_log_message(svn_client__shelf_t *shelf,
+ const char *log_message,
+ apr_pool_t *scratch_pool);
+
+/** Get the log message in @a shelf into @a *log_message.
+ *
+ * Set @a *log_message to NULL if there is no log message.
+ *
+ * Similar to svn_client_shelf_revprop_get(... SVN_PROP_REVISION_LOG ...).
+ *
+ * The result is allocated in @a result_pool.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_get_log_message(char **log_message,
+ svn_client__shelf_t *shelf,
+ apr_pool_t *result_pool);
+
+/** Information about a shelf.
+ *
+ * @warning EXPERIMENTAL.
+ */
+typedef struct svn_client__shelf_info_t
+{
+ apr_time_t mtime; /**< mtime of the latest change */
+} svn_client__shelf_info_t;
+
+/** Set @a *shelf_infos to a hash, keyed by shelf name, of pointers to
+ * @c svn_client_shelf_info_t structures, one for each shelf in the
+ * given WC.
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_list(apr_hash_t **shelf_infos,
+ const char *local_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Report the shelved status of all the shelved paths in @a shelf_version
+ * via @a walk_func(@a walk_baton, ...).
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_version_status_walk(svn_client__shelf_version_t *shelf_version,
+ const char *wc_relpath,
+ svn_wc_status_func4_t walk_func,
+ void *walk_baton,
+ apr_pool_t *scratch_pool);
+
+/** Output the subtree of @a shelf_version rooted at @a shelf_relpath
+ * as a diff to @a diff_processor.
+ *
+ * ### depth and ignore_ancestry are currently ignored.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf_diff(svn_client__shelf_version_t *shelf_version,
+ const char *shelf_relpath,
+ svn_depth_t depth,
+ svn_boolean_t ignore_ancestry,
+ const svn_diff_tree_processor_t *diff_processor,
+ apr_pool_t *scratch_pool);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_CLIENT_SHELF_H */
diff --git a/subversion/include/private/svn_client_shelf2.h b/subversion/include/private/svn_client_shelf2.h
new file mode 100644
index 000000000000..e26537506976
--- /dev/null
+++ b/subversion/include/private/svn_client_shelf2.h
@@ -0,0 +1,467 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file svn_client_shelf2.h
+ * @brief Subversion's client library: experimental shelving v2
+ */
+
+#ifndef SVN_CLIENT_SHELF2_H
+#define SVN_CLIENT_SHELF2_H
+
+#include <apr.h>
+#include <apr_pools.h>
+#include <apr_hash.h>
+#include <apr_time.h>
+
+#include "svn_client.h"
+#include "svn_types.h"
+#include "svn_string.h"
+#include "svn_wc.h"
+#include "svn_diff.h"
+#include "private/svn_diff_tree.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/** Shelving v2, with checkpoints
+ *
+ * @defgroup svn_client_shelves_checkpoints Shelves and checkpoints
+ * @{
+ */
+
+/** A shelf.
+ *
+ * @warning EXPERIMENTAL.
+ */
+typedef struct svn_client__shelf2_t
+{
+ /* Public fields (read-only for public use) */
+ const char *name;
+ int max_version; /** @deprecated */
+
+ /* Private fields */
+ const char *wc_root_abspath;
+ const char *shelves_dir;
+ apr_hash_t *revprops; /* non-null; allocated in POOL */
+ svn_client_ctx_t *ctx;
+ apr_pool_t *pool;
+} svn_client__shelf2_t;
+
+/** One version of a shelved change-set.
+ *
+ * @warning EXPERIMENTAL.
+ */
+typedef struct svn_client__shelf2_version_t
+{
+ /* Public fields (read-only for public use) */
+ svn_client__shelf2_t *shelf;
+ apr_time_t mtime; /** time-stamp of this version */
+
+ /* Private fields */
+ const char *files_dir_abspath; /** abspath of the storage area */
+ int version_number; /** version number starting from 1 */
+} svn_client__shelf2_version_t;
+
+/** Open an existing shelf or create a new shelf.
+ *
+ * Create a new shelf (containing no versions) if a shelf named @a name
+ * is not found.
+ *
+ * The shelf should be closed after use by calling svn_client_shelf_close().
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_open_or_create(svn_client__shelf2_t **shelf_p,
+ const char *name,
+ const char *local_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/** Open an existing shelf named @a name, or error if it doesn't exist.
+ *
+ * The shelf should be closed after use by calling svn_client_shelf_close().
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_open_existing(svn_client__shelf2_t **shelf_p,
+ const char *name,
+ const char *local_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool);
+
+/** Close @a shelf.
+ *
+ * If @a shelf is NULL, do nothing; otherwise @a shelf must be an open shelf.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_close(svn_client__shelf2_t *shelf,
+ apr_pool_t *scratch_pool);
+
+/** Delete the shelf named @a name, or error if it doesn't exist.
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_delete(const char *name,
+ const char *local_abspath,
+ svn_boolean_t dry_run,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/** Save the local modifications found by @a paths, @a depth,
+ * @a changelists as a new version of @a shelf.
+ *
+ * If any paths are shelved, create a new shelf-version and return the new
+ * shelf-version in @a *new_version_p, else set @a *new_version_p to null.
+ * @a new_version_p may be null if that output is not wanted; a new shelf-
+ * version is still saved and may be found through @a shelf.
+ *
+ * @a paths are relative to the CWD, or absolute.
+ *
+ * For each successfully shelved path: call @a shelved_func (if not null)
+ * with @a shelved_baton.
+ *
+ * If any paths cannot be shelved: if @a not_shelved_func is given, call
+ * it with @a not_shelved_baton for each such path, and still create a new
+ * shelf-version if any paths are shelved.
+ *
+ * This function does not revert the changes from the WC; use
+ * svn_client_shelf_unapply() for that.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_save_new_version3(svn_client__shelf2_version_t **new_version_p,
+ svn_client__shelf2_t *shelf,
+ const apr_array_header_t *paths,
+ svn_depth_t depth,
+ const apr_array_header_t *changelists,
+ svn_client_status_func_t shelved_func,
+ void *shelved_baton,
+ svn_client_status_func_t not_shelved_func,
+ void *not_shelved_baton,
+ apr_pool_t *scratch_pool);
+
+/** Delete all newer versions of @a shelf newer than @a shelf_version.
+ *
+ * If @a shelf_version is null, delete all versions of @a shelf. (The
+ * shelf will still exist, with any log message and other revprops, but
+ * with no versions in it.)
+ *
+ * Leave the shelf's log message and other revprops unchanged.
+ *
+ * Any #svn_client_shelf_version_t object that refers to a deleted version
+ * will become invalid: attempting to use it will give undefined behaviour.
+ * The given @a shelf_version will remain valid.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_delete_newer_versions(svn_client__shelf2_t *shelf,
+ svn_client__shelf2_version_t *shelf_version,
+ apr_pool_t *scratch_pool);
+
+/** Return in @a shelf_version an existing version of @a shelf, given its
+ * @a version_number. Error if that version doesn't exist.
+ *
+ * There is no need to "close" it after use.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_version_open(svn_client__shelf2_version_t **shelf_version_p,
+ svn_client__shelf2_t *shelf,
+ int version_number,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Return in @a shelf_version the newest version of @a shelf.
+ *
+ * Set @a shelf_version to null if no versions exist.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_get_newest_version(svn_client__shelf2_version_t **shelf_version_p,
+ svn_client__shelf2_t *shelf,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Return in @a versions_p an array of (#svn_client_shelf_version_t *)
+ * containing all versions of @a shelf.
+ *
+ * The versions will be in chronological order, oldest to newest.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_get_all_versions(apr_array_header_t **versions_p,
+ svn_client__shelf2_t *shelf,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Apply @a shelf_version to the WC.
+ *
+ * If @a dry_run is true, try applying the shelf-version to the WC and
+ * report the full set of notifications about successes and conflicts,
+ * but leave the WC untouched.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_apply(svn_client__shelf2_version_t *shelf_version,
+ svn_boolean_t dry_run,
+ apr_pool_t *scratch_pool);
+
+/** Test whether we can successfully apply the changes for @a file_relpath
+ * in @a shelf_version to the WC.
+ *
+ * Set @a *conflict_p to true if the changes conflict with the WC state,
+ * else to false.
+ *
+ * If @a file_relpath is not found in @a shelf_version, set @a *conflict_p
+ * to FALSE.
+ *
+ * @a file_relpath is relative to the WC root.
+ *
+ * A conflict means the shelf cannot be applied successfully to the WC
+ * because the change to be applied is not compatible with the current
+ * working state of the WC file. Examples are a text conflict, or the
+ * file does not exist or is a directory, or the shelf is trying to add
+ * the file but it already exists, or trying to delete it but it does not
+ * exist.
+ *
+ * Return an error only if something is broken, e.g. unable to read data
+ * from the specified shelf-version.
+ *
+ * Leave the WC untouched.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_test_apply_file(svn_boolean_t *conflict_p,
+ svn_client__shelf2_version_t *shelf_version,
+ const char *file_relpath,
+ apr_pool_t *scratch_pool);
+
+/** Reverse-apply @a shelf_version to the WC.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_unapply(svn_client__shelf2_version_t *shelf_version,
+ svn_boolean_t dry_run,
+ apr_pool_t *scratch_pool);
+
+/** Set @a *affected_paths to a hash with one entry for each path affected
+ * by the @a shelf_version.
+ *
+ * The hash key is the path of the affected file, relative to the WC root.
+ *
+ * (Future possibility: When moves and copies are supported, the hash key
+ * is the old path and value is the new path.)
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_paths_changed(apr_hash_t **affected_paths,
+ svn_client__shelf2_version_t *shelf_version,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/** Set @a shelf's revprop @a prop_name to @a prop_val.
+ *
+ * This can be used to set or change the shelf's log message
+ * (property name "svn:log" or #SVN_PROP_REVISION_LOG).
+ *
+ * If @a prop_val is NULL, delete the property (if present).
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_revprop_set(svn_client__shelf2_t *shelf,
+ const char *prop_name,
+ const svn_string_t *prop_val,
+ apr_pool_t *scratch_pool);
+
+/** Set @a shelf's revprops to @a revprop_table.
+ *
+ * This deletes all previous revprops.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_revprop_set_all(svn_client__shelf2_t *shelf,
+ apr_hash_t *revprop_table,
+ apr_pool_t *scratch_pool);
+
+/** Get @a shelf's revprop @a prop_name into @a *prop_val.
+ *
+ * If the property is not present, set @a *prop_val to NULL.
+ *
+ * This can be used to get the shelf's log message
+ * (property name "svn:log" or #SVN_PROP_REVISION_LOG).
+ *
+ * The lifetime of the result is limited to that of @a shelf and/or
+ * of @a result_pool.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_revprop_get(svn_string_t **prop_val,
+ svn_client__shelf2_t *shelf,
+ const char *prop_name,
+ apr_pool_t *result_pool);
+
+/** Get @a shelf's revprops into @a props.
+ *
+ * The lifetime of the result is limited to that of @a shelf and/or
+ * of @a result_pool.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_revprop_list(apr_hash_t **props,
+ svn_client__shelf2_t *shelf,
+ apr_pool_t *result_pool);
+
+/** Set the log message in @a shelf to @a log_message.
+ *
+ * If @a log_message is null, delete the log message.
+ *
+ * Similar to svn_client_shelf_revprop_set(... SVN_PROP_REVISION_LOG ...).
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_set_log_message(svn_client__shelf2_t *shelf,
+ const char *log_message,
+ apr_pool_t *scratch_pool);
+
+/** Get the log message in @a shelf into @a *log_message.
+ *
+ * Set @a *log_message to NULL if there is no log message.
+ *
+ * Similar to svn_client_shelf_revprop_get(... SVN_PROP_REVISION_LOG ...).
+ *
+ * The result is allocated in @a result_pool.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_get_log_message(char **log_message,
+ svn_client__shelf2_t *shelf,
+ apr_pool_t *result_pool);
+
+/** Information about a shelf.
+ *
+ * @warning EXPERIMENTAL.
+ */
+typedef struct svn_client__shelf2_info_t
+{
+ apr_time_t mtime; /* mtime of the latest change */
+} svn_client__shelf2_info_t;
+
+/** Set @a *shelf_infos to a hash, keyed by shelf name, of pointers to
+ * @c svn_client_shelf_info_t structures, one for each shelf in the
+ * given WC.
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_list(apr_hash_t **shelf_infos,
+ const char *local_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Report the shelved status of all the shelved paths in SHELF_VERSION
+ * via WALK_FUNC(WALK_BATON, ...).
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_version_status_walk(svn_client__shelf2_version_t *shelf_version,
+ const char *wc_relpath,
+ svn_wc_status_func4_t walk_func,
+ void *walk_baton,
+ apr_pool_t *scratch_pool);
+
+/** Output the subtree of @a shelf_version rooted at @a shelf_relpath
+ * as a diff to @a diff_processor.
+ *
+ * ### depth and ignore_ancestry are currently ignored.
+ *
+ * @warning EXPERIMENTAL.
+ */
+SVN_EXPERIMENTAL
+svn_error_t *
+svn_client__shelf2_diff(svn_client__shelf2_version_t *shelf_version,
+ const char *shelf_relpath,
+ svn_depth_t depth,
+ svn_boolean_t ignore_ancestry,
+ const svn_diff_tree_processor_t *diff_processor,
+ apr_pool_t *scratch_pool);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_CLIENT_SHELF2_H */
diff --git a/subversion/include/private/svn_dep_compat.h b/subversion/include/private/svn_dep_compat.h
index 6b381d2ce81c..7e6603826135 100644
--- a/subversion/include/private/svn_dep_compat.h
+++ b/subversion/include/private/svn_dep_compat.h
@@ -108,12 +108,6 @@ extern "C" {
#define APR_OPENINFO 0x00100000
#endif
-#if !APR_VERSION_AT_LEAST(1,4,0)
-#ifndef apr_time_from_msec
-#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
-#endif
-#endif
-
/**
* APR 1 has volatile qualifier bugs in some atomic prototypes that
* are fixed in APR 2:
diff --git a/subversion/include/private/svn_diff_tree.h b/subversion/include/private/svn_diff_tree.h
index 713644d08c4e..9c675d916aa1 100644
--- a/subversion/include/private/svn_diff_tree.h
+++ b/subversion/include/private/svn_diff_tree.h
@@ -321,7 +321,6 @@ svn_diff__tree_processor_create(void *baton,
*/ /* Used by libsvn clients repository diff */
const svn_diff_tree_processor_t *
svn_diff__tree_processor_reverse_create(const svn_diff_tree_processor_t * processor,
- const char *prefix_relpath,
apr_pool_t *result_pool);
/**
diff --git a/subversion/include/private/svn_dirent_uri_private.h b/subversion/include/private/svn_dirent_uri_private.h
new file mode 100644
index 000000000000..0da5f4722884
--- /dev/null
+++ b/subversion/include/private/svn_dirent_uri_private.h
@@ -0,0 +1,53 @@
+/*
+ * svn_dirent_uri_private.h : private definitions for dirents and URIs
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ */
+
+#ifndef SVN_DIRENT_URI_PRIVATE_H
+#define SVN_DIRENT_URI_PRIVATE_H
+
+#include <apr_pools.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * Convert @a relpath from the local style to the canonical internal style.
+ * "Local style" means native path separators and "." for the empty path.
+ *
+ * Allocates the results in @a result_pool. Uses @a scratch_pool for
+ * temporary allocations.
+ *
+ * @since New in 1.7 (as svn_relpath__internal_style()).
+ * @since Name and signature changed in 1.12.
+ */
+svn_error_t *
+svn_relpath__make_internal(const char **internal_style_relpath,
+ const char *relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_DIRENT_URI_PRIVATE_H */
diff --git a/subversion/include/private/svn_element.h b/subversion/include/private/svn_element.h
index c467175c748e..9c7129a4a98a 100644
--- a/subversion/include/private/svn_element.h
+++ b/subversion/include/private/svn_element.h
@@ -348,7 +348,7 @@ svn_element__content_t *
svn_element__tree_get(const svn_element__tree_t *tree,
int eid);
-svn_error_t *
+void
svn_element__tree_set(svn_element__tree_t *tree,
int eid,
const svn_element__content_t *element);
diff --git a/subversion/include/private/svn_fs_fs_private.h b/subversion/include/private/svn_fs_fs_private.h
index d2573d447c9d..2ca61e4cf8c1 100644
--- a/subversion/include/private/svn_fs_fs_private.h
+++ b/subversion/include/private/svn_fs_fs_private.h
@@ -255,22 +255,6 @@ typedef struct svn_fs_fs__stats_t
apr_hash_t *by_extension;
} svn_fs_fs__stats_t;
-
-/* Scan all contents of the repository FS and return statistics in *STATS,
- * allocated in RESULT_POOL. Report progress through PROGRESS_FUNC with
- * PROGRESS_BATON, if PROGRESS_FUNC is not NULL.
- * Use SCRATCH_POOL for temporary allocations.
- */
-svn_error_t *
-svn_fs_fs__get_stats(svn_fs_fs__stats_t **stats,
- svn_fs_t *fs,
- svn_fs_progress_notify_func_t progress_func,
- void *progress_baton,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* A node-revision ID in FSFS consists of 3 sub-IDs ("parts") that consist
* of a creation REVISION number and some revision- / transaction-local
* counter value (NUMBER). Old-style ID parts use global counter values.
@@ -325,33 +309,60 @@ typedef svn_error_t *
void *baton,
apr_pool_t *scratch_pool);
-/* Read the P2L index for the rev / pack file containing REVISION in FS.
- * For each index entry, invoke CALLBACK_FUNC with CALLBACK_BATON.
- * If not NULL, call CANCEL_FUNC with CANCEL_BATON from time to time.
- * Use SCRATCH_POOL for temporary allocations.
- */
-svn_error_t *
-svn_fs_fs__dump_index(svn_fs_t *fs,
- svn_revnum_t revision,
- svn_fs_fs__dump_index_func_t callback_func,
- void *callback_baton,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- apr_pool_t *scratch_pool);
-
-
-/* Rewrite the respective index information of the rev / pack file in FS
- * containing REVISION and use the svn_fs_fs__p2l_entry_t * array ENTRIES
- * as the new index contents. Allocate temporaries from SCRATCH_POOL.
- *
- * Note that this becomes a no-op if ENTRIES is empty. You may use a zero-
- * sized empty entry instead.
- */
-svn_error_t *
-svn_fs_fs__load_index(svn_fs_t *fs,
- svn_revnum_t revision,
- apr_array_header_t *entries,
- apr_pool_t *scratch_pool);
+typedef struct svn_fs_fs__ioctl_get_stats_input_t
+{
+ svn_fs_progress_notify_func_t progress_func;
+ void *progress_baton;
+} svn_fs_fs__ioctl_get_stats_input_t;
+
+typedef struct svn_fs_fs__ioctl_get_stats_output_t
+{
+ svn_fs_fs__stats_t *stats;
+} svn_fs_fs__ioctl_get_stats_output_t;
+
+SVN_FS_DECLARE_IOCTL_CODE(SVN_FS_FS__IOCTL_GET_STATS, SVN_FS_TYPE_FSFS, 1000);
+
+typedef struct svn_fs_fs__ioctl_dump_index_input_t
+{
+ svn_revnum_t revision;
+ svn_fs_fs__dump_index_func_t callback_func;
+ void *callback_baton;
+} svn_fs_fs__ioctl_dump_index_input_t;
+
+SVN_FS_DECLARE_IOCTL_CODE(SVN_FS_FS__IOCTL_DUMP_INDEX, SVN_FS_TYPE_FSFS, 1001);
+
+typedef struct svn_fs_fs__ioctl_load_index_input_t
+{
+ svn_revnum_t revision;
+ /* Array of svn_fs_fs__p2l_entry_t * entries. */
+ apr_array_header_t *entries;
+} svn_fs_fs__ioctl_load_index_input_t;
+
+SVN_FS_DECLARE_IOCTL_CODE(SVN_FS_FS__IOCTL_LOAD_INDEX, SVN_FS_TYPE_FSFS, 1002);
+
+typedef struct svn_fs_fs__ioctl_revision_size_input_t
+{
+ svn_revnum_t revision;
+} svn_fs_fs__ioctl_revision_size_input_t;
+
+typedef struct svn_fs_fs__ioctl_revision_size_output_t
+{
+ apr_off_t rev_size;
+} svn_fs_fs__ioctl_revision_size_output_t;
+
+/* See svn_fs_fs__revision_size(). */
+SVN_FS_DECLARE_IOCTL_CODE(SVN_FS_FS__IOCTL_REVISION_SIZE, SVN_FS_TYPE_FSFS, 1003);
+
+typedef struct svn_fs_fs__ioctl_build_rep_cache_input_t
+{
+ svn_revnum_t start_rev;
+ svn_revnum_t end_rev;
+ svn_fs_progress_notify_func_t progress_func;
+ void *progress_baton;
+} svn_fs_fs__ioctl_build_rep_cache_input_t;
+
+/* See svn_fs_fs__build_rep_cache(). */
+SVN_FS_DECLARE_IOCTL_CODE(SVN_FS_FS__IOCTL_BUILD_REP_CACHE, SVN_FS_TYPE_FSFS, 1004);
#ifdef __cplusplus
}
diff --git a/subversion/include/private/svn_repos_private.h b/subversion/include/private/svn_repos_private.h
index c65b73fc1e69..1fd34e8053c7 100644
--- a/subversion/include/private/svn_repos_private.h
+++ b/subversion/include/private/svn_repos_private.h
@@ -31,6 +31,7 @@
#include "svn_types.h"
#include "svn_repos.h"
+#include "svn_delta.h"
#include "svn_editor.h"
#include "svn_config.h"
@@ -85,9 +86,11 @@ svn_repos__validate_prop(const char *name,
*
* NAME is used to check that VALUE should be normalized, and if this
* is the case, VALUE is then normalized, allocated from RESULT_POOL.
- * If no normalization is required, VALUE will be copied to RESULT_POOL
- * unchanged. If NORMALIZED_P is not NULL, and the normalization
- * happened, set *NORMALIZED_P to non-zero. If the property is returned
+ * If no normalization happened, *RESULT_P will be set to VALUE, and
+ * no copying of the value will occur.
+ *
+ * If NORMALIZED_P is not NULL, and the normalization happened,
+ * set *NORMALIZED_P to non-zero. If the property is returned
* unchanged and NORMALIZED_P is not NULL, then *NORMALIZED_P will be
* set to zero. SCRATCH_POOL will be used for temporary allocations.
*/
@@ -296,6 +299,23 @@ svn_repos__dump_headers(svn_stream_t *stream,
svn_repos__dumpfile_headers_t *headers,
apr_pool_t *scratch_pool);
+/* Write a magic header record to DUMP_STREAM specifying format version
+ * VERSION.
+ */
+svn_error_t *
+svn_repos__dump_magic_header_record(svn_stream_t *dump_stream,
+ int version,
+ apr_pool_t *pool);
+
+/* Write a UUID record to DUMP_STREAM.
+ *
+ * If UUID is NULL then write nothing at all.
+ */
+svn_error_t *
+svn_repos__dump_uuid_header_record(svn_stream_t *dump_stream,
+ const char *uuid,
+ apr_pool_t *pool);
+
/* Write a revision record to DUMP_STREAM for revision REVISION with revision
* properies REVPROPS, creating appropriate headers.
*
@@ -349,6 +369,27 @@ svn_repos__dump_node_record(svn_stream_t *dump_stream,
svn_boolean_t content_length_always,
apr_pool_t *scratch_pool);
+/**
+ * Get a dump editor @a editor along with a @a edit_baton allocated in
+ * @a pool. The editor will write output to @a stream.
+ *
+ * @a update_anchor_relpath is the repository relative path of the
+ * anchor of the update-style drive which will happen on @a *editor;
+ * if a replay-style drive will instead be used, it should be passed
+ * as @c NULL.
+ *
+ * In contrast to the dump editor used inside svn_repos_dump_fs4(), this
+ * one supports only deltas mode.
+ *
+ * ### TODO: Unify with the dump editor inside svn_repos_dump_fs4().
+ */
+svn_error_t *
+svn_repos__get_dump_editor(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ svn_stream_t *stream,
+ const char *update_anchor_relpath,
+ apr_pool_t *pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/subversion/include/private/svn_sorts_private.h b/subversion/include/private/svn_sorts_private.h
index 2d5f1887f1b7..d0fddc0c6488 100644
--- a/subversion/include/private/svn_sorts_private.h
+++ b/subversion/include/private/svn_sorts_private.h
@@ -120,26 +120,29 @@ svn_sort__array_lookup(const apr_array_header_t *array,
* @a insert_index, growing the array and shuffling existing elements along to
* make room.
*
+ * Raise an error if @a insert_index is less than 0 or greater than the length
+ * of the array.
+ *
* @note Private. For use by Subversion's own code only.
*/
-void
-svn_sort__array_insert(apr_array_header_t *array,
- const void *new_element,
- int insert_index);
+svn_error_t *
+svn_sort__array_insert2(apr_array_header_t *array,
+ const void *new_element,
+ int insert_index);
/* Remove @a elements_to_delete elements starting at @a delete_index from the
- * array @a arr. If @a delete_index is not a valid element of @a arr,
- * @a elements_to_delete is not greater than zero, or
- * @a delete_index + @a elements_to_delete is greater than @a arr->nelts,
- * then do nothing.
+ * array @a arr.
+ *
+ * Raise an error if the indexes to delete extends outside the array bounds
+ * or if @a elements_to_delete is not greater than zero.
*
* @note Private. For use by Subversion's own code only.
*/
-void
-svn_sort__array_delete(apr_array_header_t *arr,
- int delete_index,
- int elements_to_delete);
+svn_error_t *
+svn_sort__array_delete2(apr_array_header_t *arr,
+ int delete_index,
+ int elements_to_delete);
/* Reverse the order of elements in @a array, in place.
*
@@ -190,7 +193,7 @@ 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
+ * contents remains unchanged. If the @a queue is empty, NULL will be
* returned.
*/
void *
@@ -212,7 +215,7 @@ 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.
+ * 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);
diff --git a/subversion/include/private/svn_subr_private.h b/subversion/include/private/svn_subr_private.h
index d18c564748d0..468b7cc459f8 100644
--- a/subversion/include/private/svn_subr_private.h
+++ b/subversion/include/private/svn_subr_private.h
@@ -389,27 +389,27 @@ svn_hash__make(apr_pool_t *pool);
/** Struct that represents a key value pair read from a serialized hash
* representation. There are special cases that can also be represented:
- * a #NULL @a key signifies the end of the hash, a #NULL @a val for non-
+ * a NULL @a key signifies the end of the hash, a NULL @a val for non-
* NULL keys is only possible in incremental mode describes a deletion.
*
* @since New in 1.9.
*/
typedef struct svn_hash__entry_t
{
- /** 0-terminated Key. #NULL if this contains no data at all because we
+ /** 0-terminated Key. NULL if this contains no data at all because we
* encountered the end of the hash. */
char *key;
- /** Length of @a key. Must be 0 if @a key is #NULL. */
+ /** Length of @a key. Must be 0 if @a key is NULL. */
apr_size_t keylen;
- /** 0-terminated value stored with the key. If this is #NULL for a
+ /** 0-terminated value stored with the key. If this is NULL for a
* non-NULL @a key, then this means that the key shall be removed from
- * the hash (only used in incremental mode). Must be #NULL if @a key is
- * #NULL. */
+ * the hash (only used in incremental mode). Must be NULL if @a key is
+ * NULL. */
char *val;
- /** Length of @a val. Must be 0 if @a val is #NULL. */
+ /** Length of @a val. Must be 0 if @a val is NULL. */
apr_size_t vallen;
} svn_hash__entry_t;
diff --git a/subversion/include/private/svn_wc_private.h b/subversion/include/private/svn_wc_private.h
index 521d092be692..9e316cda3b8c 100644
--- a/subversion/include/private/svn_wc_private.h
+++ b/subversion/include/private/svn_wc_private.h
@@ -348,19 +348,21 @@ svn_wc__get_wcroot(const char **wcroot_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/** Set @a *dir to the abspath of the directory in which shelved patches
- * are stored, which is inside the WC's administrative directory, and ensure
- * the directory exists.
+/** Set @a *dir to the abspath of the directory in which administrative
+ * data for experimental features may be stored. This directory is inside
+ * the WC's administrative directory. Ensure the directory exists.
*
* @a local_abspath is any path in the WC, and is used to find the WC root.
+ *
+ * @warning EXPERIMENTAL.
*/
SVN_EXPERIMENTAL
svn_error_t *
-svn_wc__get_shelves_dir(char **dir,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__get_experimental_dir(char **dir,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/**
* The following are temporary APIs to aid in the transition from wc-1 to
@@ -537,7 +539,7 @@ svn_wc__node_get_origin(svn_boolean_t *is_copy,
* If @a base_only is TRUE then only the base node will be examined,
* otherwise the current base or working node will be examined.
*
- * If a value is not interesting you can pass #NULL.
+ * If a value is not interesting you can pass NULL.
*
* If @a local_abspath is not in the working copy, return
* @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
@@ -615,6 +617,42 @@ svn_wc__node_get_base(svn_node_kind_t *kind,
apr_pool_t *scratch_pool);
+/* Return an array of const char * elements, which represent local absolute
+ * paths for nodes, within the working copy indicated by WRI_ABSPATH, which
+ * have a basename matching BASENAME and have node kind KIND.
+ * If no such nodes exist, return an empty array.
+ *
+ * This function returns only paths to nodes which are present in the highest
+ * layer of the WC. In other words, paths to deleted and/or excluded nodes are
+ * never returned.
+ */
+svn_error_t *
+svn_wc__find_working_nodes_with_basename(apr_array_header_t **abspaths,
+ const char *wri_abspath,
+ const char *basename,
+ svn_node_kind_t kind,
+ svn_wc_context_t *wc_ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Return an array of const char * elements, which represent local absolute
+ * paths for nodes, within the working copy indicated by WRI_ABSPATH, which
+ * are copies of REPOS_RELPATH and have node kind KIND.
+ * If no such nodes exist, return an empty array.
+ *
+ * This function returns only paths to nodes which are present in the highest
+ * layer of the WC. In other words, paths to deleted and/or excluded nodes are
+ * never returned.
+ */
+svn_error_t *
+svn_wc__find_copies_of_repos_path(apr_array_header_t **abspaths,
+ const char *wri_abspath,
+ const char *repos_relpath,
+ svn_node_kind_t kind,
+ svn_wc_context_t *wc_ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Get the working revision of @a local_abspath using @a wc_ctx. If @a
* local_abspath is not in the working copy, return @c
* SVN_ERR_WC_PATH_NOT_FOUND.
@@ -1762,7 +1800,7 @@ svn_wc__resolve_conflicts(svn_wc_context_t *wc_ctx,
void *notify_baton,
apr_pool_t *scratch_pool);
-/**
+/**
* Resolve the text conflict at LOCAL_ABSPATH as per CHOICE, and then
* mark the conflict resolved.
* The working copy must already be locked for resolving, e.g. by calling
@@ -1779,7 +1817,7 @@ svn_wc__conflict_text_mark_resolved(svn_wc_context_t *wc_ctx,
void *notify_baton,
apr_pool_t *scratch_pool);
-/**
+/**
* Resolve the conflicted property PROPNAME at LOCAL_ABSPATH as per CHOICE,
* and then mark the conflict resolved. If MERGED_VALUE is not NULL, this is
* the new merged property, used when choosing #svn_wc_conflict_choose_merged.
@@ -1810,7 +1848,7 @@ svn_wc__conflict_prop_mark_resolved(svn_wc_context_t *wc_ctx,
*
* The tree conflict at LOCAL_ABSPATH must have the following properties or
* SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
- *
+ *
* operation: svn_wc_operation_update or svn_wc_operation_switch
* local change: svn_wc_conflict_reason_deleted or
* svn_wc_conflict_reason_replaced or
@@ -1847,7 +1885,7 @@ svn_wc__conflict_tree_update_break_moved_away(svn_wc_context_t *wc_ctx,
*
* The tree conflict at LOCAL_ABSPATH must have the following properties or
* SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
- *
+ *
* operation: svn_wc_operation_update or svn_wc_operation_switch
* local change: svn_wc_conflict_reason_deleted or
* svn_wc_conflict_reason_replaced
@@ -1883,7 +1921,7 @@ svn_wc__conflict_tree_update_raise_moved_away(svn_wc_context_t *wc_ctx,
*
* The tree conflict at LOCAL_ABSPATH must have the following properties or
* SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
- *
+ *
* operation: svn_wc_operation_update or svn_wc_operation_switch
* local change: svn_wc_conflict_reason_moved_away
* incoming change: svn_wc_conflict_action_edit
@@ -2044,15 +2082,19 @@ svn_wc__acquire_write_lock_for_resolve(const char **lock_root_abspath,
/* The implemementation of svn_wc_diff6(), but reporting to a diff processor
*
- * If ROOT_RELPATH is not NULL, set *ROOT_RELPATH to the target of the diff
- * within the diff namespace. ("" or a single path component).
+ * New mode, when ANCHOR_AT_GIVEN_PATHS is true:
+ *
+ * Anchor the DIFF_PROCESSOR at LOCAL_ABSPATH.
+ *
+ * Backward compatibility mode for svn_wc_diff6(),
+ * when ANCHOR_AT_GIVEN_PATHS is false:
*
- * If ROOT_IS_FILE is NOT NULL set it
- * the first processor call. (The anchor is LOCAL_ABSPATH or an ancestor of it)
+ * Send diff processor relpaths relative to LOCAL_ABSPATH if it is a
+ * directory; otherwise, relative to the parent of LOCAL_ABSPATH.
+ * This matches the "anchor and target" semantics of svn_wc_diff6().
*/
svn_error_t *
-svn_wc__diff7(const char **root_relpath,
- svn_boolean_t *root_is_dir,
+svn_wc__diff7(svn_boolean_t anchor_at_given_paths,
svn_wc_context_t *wc_ctx,
const char *local_abspath,
svn_depth_t depth,