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/06/30 03:03:14 UTC
svn commit: r1498045 [3/8] - in /subversion/branches/fsfs-format7: ./ build/
build/generator/ build/generator/templates/ notes/tree-conflicts/
subversion/bindings/cxxhl/include/
subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/cxxhl/src/...
Modified: subversion/branches/fsfs-format7/subversion/include/private/svn_io_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/private/svn_io_private.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/private/svn_io_private.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/private/svn_io_private.h Sun Jun 30 01:03:10 2013
@@ -90,6 +90,11 @@ svn_stream__set_is_buffered(svn_stream_t
svn_boolean_t
svn_stream__is_buffered(svn_stream_t *stream);
+/** Return the underlying file, if any, associated with the stream, or
+ * NULL if not available. Accessing the file bypasses the stream.
+ */
+apr_file_t *
+svn_stream__aprfile(svn_stream_t *stream);
#ifdef __cplusplus
}
Modified: subversion/branches/fsfs-format7/subversion/include/private/svn_ra_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/private/svn_ra_private.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/private/svn_ra_private.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/private/svn_ra_private.h Sun Jun 30 01:03:10 2013
@@ -39,15 +39,23 @@
extern "C" {
#endif /* __cplusplus */
-/* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error
- message referencing PATH_OR_URL, if the "server" pointed to by
- RA_SESSION doesn't support Merge Tracking (e.g. is pre-1.5).
- Perform temporary allocations in POOL. */
+/* Equivalent to svn_ra__assert_capable_server()
+ for SVN_RA_CAPABILITY_MERGEINFO. */
svn_error_t *
svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session,
const char *path_or_url,
apr_pool_t *pool);
+/* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error
+ message referencing PATH_OR_URL, if the "server" pointed to by
+ RA_SESSION doesn't support CAPABILITY (an SVN_RA_CAPABILITY_* constant).
+ Perform temporary allocations in POOL. */
+svn_error_t *
+svn_ra__assert_capable_server(svn_ra_session_t *ra_session,
+ const char *capability,
+ const char *path_or_url,
+ apr_pool_t *pool);
+
/*** Operational Locks ***/
Modified: subversion/branches/fsfs-format7/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/private/svn_repos_private.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/private/svn_repos_private.h Sun Jun 30 01:03:10 2013
@@ -38,10 +38,21 @@ extern "C" {
#endif /* __cplusplus */
-/** Validate that property @a name is valid for use in a Subversion
- * repository; return @c SVN_ERR_REPOS_BAD_ARGS if it isn't. For some
- * "svn:" properties, also validate the @a value, and return
- * @c SVN_ERR_BAD_PROPERTY_VALUE if it is not valid.
+/** Validate that property @a name with @a value is valid (as an addition
+ * or edit or deletion) in a Subversion repository. Return an error if not.
+ *
+ * If @a value is NULL, return #SVN_NO_ERROR to indicate that any property
+ * may be deleted, even an invalid one. Otherwise, if the @a name is not
+ * of kind #svn_prop_regular_kind (see #svn_prop_kind_t), return
+ * #SVN_ERR_REPOS_BAD_ARGS. Otherwise, for some "svn:" properties, also
+ * perform some validations on the @a value (e.g., for such properties,
+ * typically the @a value must be in UTF-8 with LF linefeeds), and return
+ * #SVN_ERR_BAD_PROPERTY_VALUE if it is not valid.
+ *
+ * Validations may be added in future releases, for example, for
+ * newly-added #SVN_PROP_PREFIX properties. However, user-defined
+ * (non-#SVN_PROP_PREFIX) properties will never have their @a value
+ * validated in any way.
*
* Use @a pool for temporary allocations.
*
Modified: subversion/branches/fsfs-format7/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/private/svn_wc_private.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/private/svn_wc_private.h Sun Jun 30 01:03:10 2013
@@ -354,6 +354,25 @@ svn_wc__get_wcroot(const char **wcroot_a
* before the 1.7 release.
*/
+/*
+ * Convert from svn_wc_conflict_description3_t to
+ * svn_wc_conflict_description2_t.
+ *
+ * Allocate the result in RESULT_POOL.
+ */
+svn_wc_conflict_description2_t *
+svn_wc__cd3_to_cd2(const svn_wc_conflict_description3_t *conflict,
+ apr_pool_t *result_pool);
+
+/*
+ * Convert an array of svn_wc_conflict_description3_t * elements to an
+ * array of * svn_wc_conflict_description2_t * elements.
+ *
+ * Allocate the result in RESULT_POOL.
+ */
+apr_array_header_t *
+svn_wc__cd3_array_to_cd2_array(const apr_array_header_t *conflicts,
+ apr_pool_t *result_pool);
/*
* Convert from svn_wc_conflict_description2_t to
Modified: subversion/branches/fsfs-format7/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_client.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_client.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_client.h Sun Jun 30 01:03:10 2013
@@ -2814,6 +2814,11 @@ svn_client_log(const apr_array_header_t
* in which case blame information will be generated regardless of the
* MIME types of the revisions.
*
+ * @a start may resolve to a revision number greater (younger) than @a end
+ * only if the server is 1.8.0 or greater (supports
+ * #SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE) and the client is 1.9.0 or
+ * newer.
+ *
* Use @a diff_options to determine how to compare different revisions of the
* target.
*
@@ -4020,12 +4025,41 @@ svn_client_mergeinfo_log_eligible(const
/** Recursively cleanup a working copy directory @a dir, finishing any
* incomplete operations, removing lockfiles, etc.
*
+ * If @a include_externals is @c TRUE, recurse into externals and clean
+ * them up as well.
+ *
+ * If @a remove_unversioned_items is @c TRUE, remove unversioned items
+ * in @a dir after successfull working copy cleanup.
+ * If @a remove_ignored_items is @c TRUE, remove ignored unversioned items
+ * in @a dir after successfull working copy cleanup.
+ *
+ * When asked to remove unversioned or ignored items, and the working copy
+ * is already locked via a different client or WC context than @a ctx, return
+ * #SVN_ERR_WC_LOCKED. This prevents accidental working copy corruption in
+ * case users run the cleanup operation to remove unversioned items while
+ * another client is performing some other operation on the working copy.
+ *
* If @a ctx->cancel_func is non-NULL, invoke it with @a
* ctx->cancel_baton at various points during the operation. If it
* returns an error (typically #SVN_ERR_CANCELLED), return that error
* immediately.
*
* Use @a scratch_pool for any temporary allocations.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_client_cleanup2(const char *dir,
+ 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);
+
+/* Like svn_client_cleanup2(), but no support for removing unversioned items
+ * and cleaning up externals.
+ *
+ * @deprecated Provided for limited backwards compatibility with the 1.8 API.
*/
svn_error_t *
svn_client_cleanup(const char *dir,
@@ -6457,7 +6491,7 @@ svn_client_open_ra_session2(svn_ra_sessi
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/** Similar to svn_client_open_ra_session(), but with @ wri_abspath
+/** Similar to svn_client_open_ra_session2(), but with @ wri_abspath
* always passed as NULL, and with the same pool used as both @a
* result_pool and @a scratch_pool.
*
Modified: subversion/branches/fsfs-format7/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_config.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_config.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_config.h Sun Jun 30 01:03:10 2013
@@ -95,6 +95,8 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates"
/** @since New in 1.8. */
#define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections"
+/** @since New in 1.9. */
+#define SVN_CONFIG_OPTION_BUSTED_PROXY "busted-proxy"
#define SVN_CONFIG_CATEGORY_CONFIG "config"
#define SVN_CONFIG_SECTION_AUTH "auth"
Modified: subversion/branches/fsfs-format7/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_error_codes.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_error_codes.h Sun Jun 30 01:03:10 2013
@@ -885,6 +885,11 @@ SVN_ERROR_START
SVN_ERR_REPOS_CATEGORY_START + 10,
"Repository upgrade is not supported")
+ /** @since New in 1.9. */
+ SVN_ERRDEF(SVN_ERR_REPOS_CORRUPTED,
+ SVN_ERR_REPOS_CATEGORY_START + 11,
+ "Repository is corrupt")
+
/* generic RA errors */
SVN_ERRDEF(SVN_ERR_RA_ILLEGAL_URL,
Modified: subversion/branches/fsfs-format7/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_fs.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_fs.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_fs.h Sun Jun 30 01:03:10 2013
@@ -271,6 +271,38 @@ svn_fs_open(svn_fs_t **fs_p,
apr_hash_t *fs_config,
apr_pool_t *pool);
+/** The kind of action being taken by 'upgrade'.
+ *
+ * @since New in 1.9.
+ */
+typedef enum svn_fs_upgrade_notify_action_t
+{
+ /** Packing of the revprop shard has completed.
+ * The number parameter is the shard being processed. */
+ svn_fs_upgrade_pack_revprops = 0,
+
+ /** Removal of the non-packed revprop shard is completed.
+ * The number parameter is the shard being processed */
+ svn_fs_upgrade_cleanup_revprops,
+
+ /** DB format has been set to the new value.
+ * The number parameter is the new format number. */
+ svn_fs_upgrade_format_bumped
+} svn_fs_upgrade_notify_action_t;
+
+/** The type of a upgrade notification function. @a number is specifc
+ * to @a action (see #svn_fs_upgrade_notify_action_t); @a action is the
+ * type of action being performed. @a baton is the corresponding baton
+ * for the notification function, and @a pool can be used for temporary
+ * allocations, but will be cleared between invocations.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_fs_upgrade_notify_t)(void *baton,
+ apr_uint64_t number,
+ svn_fs_upgrade_notify_action_t action,
+ apr_pool_t *pool);
+
/**
* Upgrade the Subversion filesystem located in the directory @a path
* to the latest version supported by this library. Return
@@ -278,11 +310,37 @@ svn_fs_open(svn_fs_t **fs_p,
* filesystem if the requested upgrade is not supported. Use @a pool
* for necessary allocations.
*
+ * The optional @a notify_func callback is only a general feedback that
+ * the operation is still in process but may be called in e.g. random shard
+ * order and more than once for the same shard.
+ *
+ * The optional @a cancel_func callback will be invoked as usual to allow
+ * the user to preempt this potentially lengthy operation.
+ *
* @note You probably don't want to use this directly. Take a look at
* svn_repos_upgrade() instead.
*
+ * @note Canceling an upgrade is legal but may leave remnants of previous
+ * format data that may not be cleaned up automatically by later calls.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_fs_upgrade2(const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool);
+
+/**
+ * Like svn_fs_upgrade2 but with notify_func, notify_baton, cancel_func
+ * and cancel_baton being set to NULL.
+ *
+ * @deprecated Provided for backward compatibility with the 1.8 API.
* @since New in 1.5.
*/
+SVN_DEPRECATED
svn_error_t *
svn_fs_upgrade(const char *path,
apr_pool_t *pool);
Modified: subversion/branches/fsfs-format7/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_ra.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_ra.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_ra.h Sun Jun 30 01:03:10 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);
Modified: subversion/branches/fsfs-format7/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_repos.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_repos.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_repos.h Sun Jun 30 01:03:10 2013
@@ -251,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.
@@ -295,7 +306,8 @@ 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. */
@@ -304,6 +316,8 @@ typedef struct svn_repos_notify_t
/** 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;
@@ -323,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(). */
@@ -2592,12 +2611,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,
Modified: subversion/branches/fsfs-format7/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/include/svn_wc.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/include/svn_wc.h (original)
+++ subversion/branches/fsfs-format7/subversion/include/svn_wc.h Sun Jun 30 01:03:10 2013
@@ -1255,7 +1255,11 @@ 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,
} svn_wc_notify_action_t;
@@ -1745,11 +1749,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 +2038,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 +2050,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 +2081,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 +2092,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 +2141,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 +2190,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,
@@ -2145,7 +2308,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,
@@ -4077,6 +4254,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.
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/blame.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/blame.c Sun Jun 30 01:03:10 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;
}
@@ -578,6 +591,7 @@ svn_client_blame5(const char *target,
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)
@@ -599,10 +613,23 @@ svn_client_blame5(const char *target,
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"));
+ if (start_revnum > end_revnum)
+ {
+ /* Repeat the last bit of svn_client__ra_session_from_path2(), to end
+ up where we would have ended up if we had passed 'start' rather than
+ 'end' to it.
+ ### Should we try calling
+ ### svn_client__open_ra_session_internal(peg_revision, start)
+ ### if calling it with (peg_revision, end) fails?
+ */
+ svn_client__pathrev_t *start_loc;
+ SVN_ERR(svn_client__resolve_rev_and_url(&start_loc, ra_session,
+ target, peg_revision, start,
+ ctx, pool));
+
+ /* Make the session point to the real URL. */
+ SVN_ERR(svn_ra_reparent(ra_session, start_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/fsfs-format7/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/cleanup.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/cleanup.c Sun Jun 30 01:03:10 2013
@@ -32,32 +32,210 @@
#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/fsfs-format7/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/client.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/client.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/client.h Sun Jun 30 01:03:10 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
@@ -442,7 +475,8 @@ svn_client__make_local_parents(const cha
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/fsfs-format7/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/commit.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/commit.c Sun Jun 30 01:03:10 2013
@@ -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,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/copy.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/copy.c Sun Jun 30 01:03:10 2013
@@ -1454,7 +1454,7 @@ wc_to_repos_copy(const apr_array_header_
#ifdef ENABLE_EV2_SHIMS
if (commit_items)
{
- relpath_map = apr_hash_make(pool);
+ relpath_map = apr_hash_make(scratch_pool);
for (i = 0; i < commit_items->nelts; i++)
{
svn_client_commit_item3_t *item = APR_ARRAY_IDX(commit_items, i,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/deprecated.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/deprecated.c Sun Jun 30 01:03:10 2013
@@ -2964,3 +2964,11 @@ svn_client_commit_item2_dup(const svn_cl
return new_item;
}
+svn_error_t *
+svn_client_cleanup(const char *path,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(svn_client_cleanup2(path, FALSE, FALSE, FALSE, ctx,
+ scratch_pool));
+}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/diff.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/diff.c Sun Jun 30 01:03:10 2013
@@ -51,6 +51,7 @@
#include "private/svn_wc_private.h"
#include "private/svn_diff_private.h"
#include "private/svn_subr_private.h"
+#include "private/svn_io_private.h"
#include "svn_private_config.h"
@@ -807,14 +808,23 @@ diff_content_changed(svn_boolean_t *wrot
* ### a non-git compatible diff application.*/
/* We deal in streams, but svn_io_run_diff2() deals in file handles,
- unfortunately, so we need to make these temporary files, and then
- copy the contents to our stream. */
- SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
+ so we may need to make temporary files and then copy the contents
+ to our stream. */
+ outfile = svn_stream__aprfile(outstream);
+ if (outfile)
+ outfilename = NULL;
+ else
+ SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
+
+ errfile = svn_stream__aprfile(errstream);
+ if (errfile)
+ errfilename = NULL;
+ else
+ SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
SVN_ERR(svn_io_run_diff2(".",
diff_cmd_baton->options.for_external.argv,
@@ -824,20 +834,25 @@ diff_content_changed(svn_boolean_t *wrot
&exitcode, outfile, errfile,
diff_cmd_baton->diff_cmd, scratch_pool));
- SVN_ERR(svn_io_file_close(outfile, scratch_pool));
- SVN_ERR(svn_io_file_close(errfile, scratch_pool));
-
/* Now, open and copy our files to our output streams. */
- SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(outstream,
- scratch_pool),
- NULL, NULL, scratch_pool));
- SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(errstream,
- scratch_pool),
- NULL, NULL, scratch_pool));
+ if (outfilename)
+ {
+ SVN_ERR(svn_io_file_close(outfile, scratch_pool));
+ SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(outstream,
+ scratch_pool),
+ NULL, NULL, scratch_pool));
+ }
+ if (errfilename)
+ {
+ SVN_ERR(svn_io_file_close(errfile, scratch_pool));
+ SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(errstream,
+ scratch_pool),
+ NULL, NULL, scratch_pool));
+ }
/* We have a printed a diff for this path, mark it as visited. */
*wrote_header = TRUE;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/log.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/log.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/log.c Sun Jun 30 01:03:10 2013
@@ -712,7 +712,17 @@ run_ra_get_log(apr_array_header_t *revis
matching_segment = bsearch(&younger_rev, log_segments->elts,
log_segments->nelts, log_segments->elt_size,
compare_rev_to_segment);
- SVN_ERR_ASSERT(*matching_segment);
+ /* LOG_SEGMENTS is supposed to represent the history of PATHS from
+ the oldest to youngest revs in REVISION_RANGES. This function's
+ current sole caller svn_client_log5 *should* be providing
+ LOG_SEGMENTS that span the oldest to youngest revs in
+ REVISION_RANGES, even if one or more of the svn_location_segment_t's
+ returned have NULL path members indicating a gap in the history. So
+ MATCHING_SEGMENT should never be NULL, but clearly sometimes it is,
+ see http://svn.haxx.se/dev/archive-2013-06/0522.shtml
+ So to be safe we handle that case. */
+ if (matching_segment == NULL)
+ continue;
/* A segment with a NULL path means there is gap in the history.
We'll just proceed and let svn_ra_get_log2 fail with a useful
@@ -850,13 +860,32 @@ svn_client_log5(const apr_array_header_t
SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url, ra_session,
actual_loc->url, pool));
- /* Get the svn_location_segment_t's representing the requested log ranges. */
- SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session,
- actual_loc->url,
- actual_loc->rev, /* peg */
- actual_loc->rev, /* start */
- oldest_rev, /* end */
- ctx, pool));
+ /* Save us an RA layer round trip if we are on the repository root and
+ know the result in advance. All the revision data has already been
+ validated.
+ */
+ if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0)
+ {
+ svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment));
+ log_segments = apr_array_make(pool, 1, sizeof(segment));
+
+ segment->range_start = oldest_rev;
+ segment->range_end = actual_loc->rev;
+ segment->path = "";
+ APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment;
+ }
+ else
+ {
+ /* Get the svn_location_segment_t's representing the requested log
+ * ranges. */
+ SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session,
+ actual_loc->url,
+ actual_loc->rev, /* peg */
+ actual_loc->rev, /* start */
+ oldest_rev, /* end */
+ ctx, pool));
+ }
+
SVN_ERR(run_ra_get_log(revision_ranges, relative_targets, log_segments,
actual_loc, ra_session, targets, limit,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/merge.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/merge.c Sun Jun 30 01:03:10 2013
@@ -12031,7 +12031,7 @@ operative_rev_receiver(void *baton,
/* Wrapper around svn_client__mergeinfo_log. All arguments are as per
that private API. The discover_changed_paths, depth, and revprops args to
svn_client__mergeinfo_log are always TRUE, svn_depth_infinity_t,
- and NULL respectively.
+ and empty array respectively.
If RECEIVER raises a SVN_ERR_CEASE_INVOCATION error, but still sets
*REVISION to a valid revnum, then clear the error. Otherwise return
@@ -12051,18 +12051,22 @@ short_circuit_mergeinfo_log(svn_mergeinf
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- svn_error_t *err = svn_client__mergeinfo_log(finding_merged,
- target_path_or_url,
- target_peg_revision,
- target_mergeinfo_cat,
- source_path_or_url,
- source_peg_revision,
- source_start_revision,
- source_end_revision,
- receiver, revision,
- TRUE, svn_depth_infinity,
- NULL, ctx, result_pool,
- scratch_pool);
+ apr_array_header_t *revprops;
+ svn_error_t *err;
+
+ revprops = apr_array_make(scratch_pool, 0, sizeof(const char *));
+ err = svn_client__mergeinfo_log(finding_merged,
+ target_path_or_url,
+ target_peg_revision,
+ target_mergeinfo_cat,
+ source_path_or_url,
+ source_peg_revision,
+ source_start_revision,
+ source_end_revision,
+ receiver, revision,
+ TRUE, svn_depth_infinity,
+ revprops, ctx, result_pool,
+ scratch_pool);
if (err)
{
@@ -12304,9 +12308,13 @@ find_automatic_merge(svn_client__pathrev
&s_t->target->loc, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
s_t->target_ra_session, ctx, scratch_pool));
- SVN_ERR(svn_client__get_youngest_common_ancestor(
- &s_t->yca, s_t->source, &s_t->target->loc, s_t->source_ra_session,
- ctx, result_pool, result_pool));
+ SVN_ERR(svn_client__calc_youngest_common_ancestor(
+ &s_t->yca, s_t->source, s_t->source_branch.history,
+ s_t->source_branch.has_r0_history,
+ &s_t->target->loc, s_t->target_branch.history,
+ s_t->target_branch.has_r0_history,
+ result_pool, scratch_pool));
+
if (! s_t->yca)
return svn_error_createf(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL,
_("'%s@%ld' must be ancestrally related to "
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/ra.c Sun Jun 30 01:03:10 2013
@@ -627,6 +627,9 @@ svn_client__repos_location_segments(apr_
* END_REVNUM must be valid revision numbers except that END_REVNUM may
* be SVN_INVALID_REVNUM if END_URL is NULL.
*
+ * YOUNGEST_REV is the already retrieved youngest revision of the ra session,
+ * but can be SVN_INVALID_REVNUM if the value is not already retrieved.
+ *
* RA_SESSION is an open RA session parented at URL.
*/
static svn_error_t *
@@ -637,6 +640,7 @@ repos_locations(const char **start_url,
svn_revnum_t peg_revnum,
svn_revnum_t start_revnum,
svn_revnum_t end_revnum,
+ svn_revnum_t youngest_rev,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -644,9 +648,9 @@ repos_locations(const char **start_url,
apr_array_header_t *revs;
apr_hash_t *rev_locs;
- SVN_ERR_ASSERT(peg_revnum != SVN_INVALID_REVNUM);
- SVN_ERR_ASSERT(start_revnum != SVN_INVALID_REVNUM);
- SVN_ERR_ASSERT(end_revnum != SVN_INVALID_REVNUM || end_url == NULL);
+ SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(peg_revnum));
+ SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(start_revnum));
+ SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(end_revnum) || end_url == NULL);
/* Avoid a network request in the common easy case. */
if (start_revnum == peg_revnum
@@ -661,6 +665,27 @@ repos_locations(const char **start_url,
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_url, scratch_pool));
+ /* Handle another common case: The repository root can't move */
+ if (! strcmp(repos_url, url))
+ {
+ if (! SVN_IS_VALID_REVNUM(youngest_rev))
+ SVN_ERR(svn_ra_get_latest_revnum(ra_session, &youngest_rev,
+ scratch_pool));
+
+ if (start_revnum > youngest_rev
+ || (SVN_IS_VALID_REVNUM(end_revnum) && (end_revnum > youngest_rev)))
+ return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+ _("No such revision %ld"),
+ (start_revnum > youngest_rev)
+ ? start_revnum : end_revnum);
+
+ if (start_url)
+ *start_url = apr_pstrdup(result_pool, repos_url);
+ if (end_url)
+ *end_url = apr_pstrdup(result_pool, repos_url);
+ return SVN_NO_ERROR;
+ }
+
revs = apr_array_make(scratch_pool, 2, sizeof(svn_revnum_t));
APR_ARRAY_PUSH(revs, svn_revnum_t) = start_revnum;
if (end_revnum != start_revnum && end_revnum != SVN_INVALID_REVNUM)
@@ -716,7 +741,7 @@ svn_client__repos_location(svn_client__p
peg_loc->url, scratch_pool));
err = repos_locations(&op_url, NULL, ra_session,
peg_loc->url, peg_loc->rev,
- op_revnum, SVN_INVALID_REVNUM,
+ op_revnum, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
result_pool, scratch_pool);
SVN_ERR(svn_error_compose_create(
err, svn_ra_reparent(ra_session, old_session_url, scratch_pool)));
@@ -856,29 +881,26 @@ svn_client__repos_locations(const char *
SVN_ERR(repos_locations(start_url, end_url,
ra_session, url, peg_revnum,
- start_revnum, end_revnum,
+ start_revnum, end_revnum, youngest_rev,
pool, subpool));
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
-
svn_error_t *
-svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
- const svn_client__pathrev_t *loc1,
- const svn_client__pathrev_t *loc2,
- svn_ra_session_t *session,
- svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+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)
{
- apr_pool_t *sesspool = NULL;
- apr_hash_t *history1, *history2;
apr_hash_index_t *hi;
svn_revnum_t yc_revision = SVN_INVALID_REVNUM;
const char *yc_relpath = NULL;
- svn_boolean_t has_rev_zero_history1;
- svn_boolean_t has_rev_zero_history2;
if (strcmp(loc1->repos_root_url, loc2->repos_root_url) != 0)
{
@@ -886,32 +908,6 @@ svn_client__get_youngest_common_ancestor
return SVN_NO_ERROR;
}
- /* Open an RA session for the two locations. */
- if (session == NULL)
- {
- sesspool = svn_pool_create(scratch_pool);
- SVN_ERR(svn_client_open_ra_session2(&session, loc1->url, NULL, ctx,
- sesspool, sesspool));
- }
-
- /* We're going to cheat and use history-as-mergeinfo because it
- saves us a bunch of annoying custom data comparisons and such. */
- SVN_ERR(svn_client__get_history_as_mergeinfo(&history1,
- &has_rev_zero_history1,
- loc1,
- SVN_INVALID_REVNUM,
- SVN_INVALID_REVNUM,
- session, ctx, scratch_pool));
- SVN_ERR(svn_client__get_history_as_mergeinfo(&history2,
- &has_rev_zero_history2,
- loc2,
- SVN_INVALID_REVNUM,
- SVN_INVALID_REVNUM,
- session, ctx, scratch_pool));
- /* Close the ra session if we opened one. */
- if (sesspool)
- svn_pool_destroy(sesspool);
-
/* Loop through the first location's history, check for overlapping
paths and ranges in the second location's history, and
remembering the youngest matching location. */
@@ -965,47 +961,62 @@ svn_client__get_youngest_common_ancestor
}
svn_error_t *
-svn_client__youngest_common_ancestor(const char **ancestor_url,
- svn_revnum_t *ancestor_rev,
- const char *path_or_url1,
- const svn_opt_revision_t *revision1,
- const char *path_or_url2,
- const svn_opt_revision_t *revision2,
- svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
+ const svn_client__pathrev_t *loc1,
+ const svn_client__pathrev_t *loc2,
+ svn_ra_session_t *session,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- apr_pool_t *sesspool = svn_pool_create(scratch_pool);
- svn_ra_session_t *session;
- svn_client__pathrev_t *loc1, *loc2, *ancestor;
-
- /* Resolve the two locations */
- SVN_ERR(svn_client__ra_session_from_path2(&session, &loc1,
- path_or_url1, NULL,
- revision1, revision1,
- ctx, sesspool));
- SVN_ERR(svn_client__resolve_rev_and_url(&loc2, session,
- path_or_url2, revision2, revision2,
- ctx, scratch_pool));
-
- SVN_ERR(svn_client__get_youngest_common_ancestor(
- &ancestor, loc1, loc2, session, ctx, result_pool, scratch_pool));
+ apr_pool_t *sesspool = NULL;
+ apr_hash_t *history1, *history2;
+ svn_boolean_t has_rev_zero_history1;
+ svn_boolean_t has_rev_zero_history2;
- if (ancestor)
+ if (strcmp(loc1->repos_root_url, loc2->repos_root_url) != 0)
{
- *ancestor_url = ancestor->url;
- *ancestor_rev = ancestor->rev;
+ *ancestor_p = NULL;
+ return SVN_NO_ERROR;
}
- else
+
+ /* Open an RA session for the two locations. */
+ if (session == NULL)
{
- *ancestor_url = NULL;
- *ancestor_rev = SVN_INVALID_REVNUM;
+ sesspool = svn_pool_create(scratch_pool);
+ SVN_ERR(svn_client_open_ra_session2(&session, loc1->url, NULL, ctx,
+ sesspool, sesspool));
}
- svn_pool_destroy(sesspool);
+
+ /* We're going to cheat and use history-as-mergeinfo because it
+ saves us a bunch of annoying custom data comparisons and such. */
+ SVN_ERR(svn_client__get_history_as_mergeinfo(&history1,
+ &has_rev_zero_history1,
+ loc1,
+ SVN_INVALID_REVNUM,
+ SVN_INVALID_REVNUM,
+ session, ctx, scratch_pool));
+ SVN_ERR(svn_client__get_history_as_mergeinfo(&history2,
+ &has_rev_zero_history2,
+ loc2,
+ SVN_INVALID_REVNUM,
+ SVN_INVALID_REVNUM,
+ session, ctx, scratch_pool));
+ /* Close the ra session if we opened one. */
+ if (sesspool)
+ svn_pool_destroy(sesspool);
+
+ SVN_ERR(svn_client__calc_youngest_common_ancestor(ancestor_p,
+ loc1, history1,
+ has_rev_zero_history1,
+ loc2, history2,
+ has_rev_zero_history2,
+ result_pool,
+ scratch_pool));
+
return SVN_NO_ERROR;
}
-
struct ra_ev2_baton {
/* The working copy context, from the client context. */
svn_wc_context_t *wc_ctx;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/switch.c Sun Jun 30 01:03:10 2013
@@ -231,8 +231,6 @@ switch_internal(svn_revnum_t *result_rev
yca = NULL; /* Not versioned */
else
{
- /* ### It would be nice if this function could reuse the existing
- ra session instead of opening two for its own use. */
SVN_ERR(svn_client__get_youngest_common_ancestor(
&yca, switch_loc, target_base_loc, ra_session, ctx,
pool, pool));
Modified: subversion/branches/fsfs-format7/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_delta/compat.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_delta/compat.c Sun Jun 30 01:03:10 2013
@@ -439,8 +439,8 @@ process_actions(struct ev2_edit_baton *e
change->changing, NULL, props));
else
SVN_ERR(svn_editor_alter_file(eb->editor, repos_relpath,
- change->changing, props,
- checksum, contents));
+ change->changing,
+ checksum, contents, props));
}
return SVN_NO_ERROR;
@@ -1182,9 +1182,9 @@ static svn_error_t *
alter_file_cb(void *baton,
const char *relpath,
svn_revnum_t revision,
- apr_hash_t *props,
const svn_checksum_t *checksum,
svn_stream_t *contents,
+ apr_hash_t *props,
apr_pool_t *scratch_pool)
{
struct editor_baton *eb = baton;
@@ -1234,8 +1234,8 @@ static svn_error_t *
alter_symlink_cb(void *baton,
const char *relpath,
svn_revnum_t revision,
- apr_hash_t *props,
const char *target,
+ apr_hash_t *props,
apr_pool_t *scratch_pool)
{
/* ### should we verify the kind is truly a symlink? */
Modified: subversion/branches/fsfs-format7/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_delta/editor.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_delta/editor.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_delta/editor.c Sun Jun 30 01:03:10 2013
@@ -683,9 +683,9 @@ svn_error_t *
svn_editor_alter_file(svn_editor_t *editor,
const char *relpath,
svn_revnum_t revision,
- apr_hash_t *props,
const svn_checksum_t *checksum,
- svn_stream_t *contents)
+ svn_stream_t *contents,
+ apr_hash_t *props)
{
svn_error_t *err = SVN_NO_ERROR;
@@ -705,8 +705,8 @@ svn_editor_alter_file(svn_editor_t *edit
{
START_CALLBACK(editor);
err = editor->funcs.cb_alter_file(editor->baton,
- relpath, revision, props,
- checksum, contents,
+ relpath, revision,
+ checksum, contents, props,
editor->scratch_pool);
END_CALLBACK(editor);
}
@@ -723,8 +723,8 @@ svn_error_t *
svn_editor_alter_symlink(svn_editor_t *editor,
const char *relpath,
svn_revnum_t revision,
- apr_hash_t *props,
- const char *target)
+ const char *target,
+ apr_hash_t *props)
{
svn_error_t *err = SVN_NO_ERROR;
@@ -740,8 +740,8 @@ svn_editor_alter_symlink(svn_editor_t *e
{
START_CALLBACK(editor);
err = editor->funcs.cb_alter_symlink(editor->baton,
- relpath, revision, props,
- target,
+ relpath, revision,
+ target, props,
editor->scratch_pool);
END_CALLBACK(editor);
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs/editor.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs/editor.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs/editor.c Sun Jun 30 01:03:10 2013
@@ -488,9 +488,9 @@ static svn_error_t *
alter_file_cb(void *baton,
const char *relpath,
svn_revnum_t revision,
- apr_hash_t *props,
const svn_checksum_t *checksum,
svn_stream_t *contents,
+ apr_hash_t *props,
apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
@@ -521,8 +521,8 @@ static svn_error_t *
alter_symlink_cb(void *baton,
const char *relpath,
svn_revnum_t revision,
- apr_hash_t *props,
const char *target,
+ apr_hash_t *props,
apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.c Sun Jun 30 01:03:10 2013
@@ -481,7 +481,12 @@ svn_fs_open(svn_fs_t **fs_p, const char
}
svn_error_t *
-svn_fs_upgrade(const char *path, apr_pool_t *pool)
+svn_fs_upgrade2(const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
{
fs_library_vtable_t *vtable;
svn_fs_t *fs;
@@ -490,11 +495,20 @@ svn_fs_upgrade(const char *path, apr_poo
fs = fs_new(NULL, pool);
SVN_MUTEX__WITH_LOCK(common_pool_lock,
- vtable->upgrade_fs(fs, path, pool, common_pool));
+ vtable->upgrade_fs(fs, path,
+ notify_func, notify_baton,
+ cancel_func, cancel_baton,
+ pool, common_pool));
return SVN_NO_ERROR;
}
svn_error_t *
+svn_fs_upgrade(const char *path, apr_pool_t *pool)
+{
+ return svn_error_trace(svn_fs_upgrade2(path, NULL, NULL, NULL, NULL, pool));
+}
+
+svn_error_t *
svn_fs_verify(const char *path,
apr_hash_t *fs_config,
svn_revnum_t start,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs/fs-loader.h Sun Jun 30 01:03:10 2013
@@ -85,7 +85,13 @@ typedef struct fs_library_vtable_t
svn_error_t *(*open_fs_for_recovery)(svn_fs_t *fs, const char *path,
apr_pool_t *pool,
apr_pool_t *common_pool);
- svn_error_t *(*upgrade_fs)(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+ svn_error_t *(*upgrade_fs)(svn_fs_t *fs,
+ const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool,
apr_pool_t *common_pool);
svn_error_t *(*verify_fs)(svn_fs_t *fs, const char *path,
svn_revnum_t start,
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/env.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/env.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/env.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_base/bdb/env.c Sun Jun 30 01:03:10 2013
@@ -227,7 +227,7 @@ bdb_error_gatherer(const DB_ENV *dbenv,
SVN_BDB_ERROR_GATHERER_IGNORE(dbenv);
- new_err = svn_error_createf(APR_SUCCESS, NULL, "bdb: %s", msg);
+ new_err = svn_error_createf(SVN_ERR_FS_BERKELEY_DB, NULL, "bdb: %s", msg);
if (error_info->pending_errors)
svn_error_compose(error_info->pending_errors, new_err);
else