You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/10 20:06:33 UTC
svn commit: r984153 [12/39] - in /subversion/branches/ignore-mergeinfo: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/hudson/ build/hudson/jobs/subversion-1.6.x-solaris/
build/hudson/jobs/subversion-1.6.x-ubuntu/ build/hu...
Modified: subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h Tue Aug 10 18:06:17 2010
@@ -626,6 +626,9 @@ svn_wc_set_adm_dir(const char *name,
/** Callback for external definitions updates
*
+ * ### See implementation of #svn_wc_traversal_info_t for documentation of
+ * the parameters.
+ *
* @since New in 1.7. */
typedef svn_error_t *(*svn_wc_external_update_t)(void *baton,
const char *local_abspath,
@@ -1046,13 +1049,32 @@ typedef enum svn_wc_notify_action_t
* @since New in 1.7. */
svn_wc_notify_update_update_deleted,
- /* The mergeinfo on path was updated. @since New in 1.7. */
+ /** The mergeinfo on path was updated. @since New in 1.7. */
svn_wc_notify_merge_record_info,
/** An working copy directory was upgraded to the latest format
* @since New in 1.7. */
svn_wc_notify_upgraded_path,
+ /** Mergeinfo describing a merge was recorded.
+ * @since New in 1.7. */
+ svn_wc_notify_merge_record_info_begin,
+
+ /** Mergeinfo was removed due to elision.
+ * @since New in 1.7. */
+ svn_wc_notify_merge_elide_info,
+
+ /** A file in the working copy was patched.
+ * @since New in 1.7. */
+ svn_wc_notify_patch,
+
+ /** A hunk from a patch was applied.
+ * @since New in 1.7. */
+ svn_wc_notify_patch_applied_hunk,
+
+ /** A hunk from a patch was rejected.
+ * @since New in 1.7. */
+ svn_wc_notify_patch_rejected_hunk,
} svn_wc_notify_action_t;
@@ -1216,6 +1238,23 @@ typedef struct svn_wc_notify_t {
* @since New in 1.7 */
svn_revnum_t old_revision;
+ /* These fields are used by svn patch to identify the
+ * hunk the notification is for. They are line-based
+ * offsets and lengths parsed from the unidiff hunk header.
+ * @since New in 1.7. */
+ svn_linenum_t hunk_original_start;
+ svn_linenum_t hunk_original_length;
+ svn_linenum_t hunk_modified_start;
+ svn_linenum_t hunk_modified_length;
+
+ /* The line at which a hunk was matched (and applied).
+ * @since New in 1.7. */
+ svn_linenum_t hunk_matched_line;
+
+ /* The fuzz factor the hunk was applied with.
+ * @since New in 1.7 */
+ int hunk_fuzz;
+
/* NOTE: Add new fields at the end to preserve binary compatibility.
Also, if you add fields here, you have to update svn_wc_create_notify
and svn_wc_dup_notify. */
@@ -1241,8 +1280,8 @@ svn_wc_create_notify(const char *path,
* Allocate an #svn_wc_notify_t structure in @a pool, initialize and return
* it.
*
- * Set the @c url field of the created struct to @a url, @c action to, @c path
- * to "." and @a action. Set all other fields to their @c _unknown, @c NULL or
+ * Set the @c url field of the created struct to @a url, @c path to "." and @c
+ * action to @a action. Set all other fields to their @c _unknown, @c NULL or
* invalid value, respectively. Make only a shallow copy of the pointer
* @a url.
*
@@ -1487,7 +1526,7 @@ typedef struct svn_wc_conflict_version_t
*/
svn_wc_conflict_version_t *
svn_wc_conflict_version_create(const char *repos_url,
- const char* path_in_repos,
+ const char *path_in_repos,
svn_revnum_t peg_rev,
svn_node_kind_t node_kind,
apr_pool_t *pool);
@@ -2134,8 +2173,8 @@ typedef svn_error_t *(*svn_wc_conflict_r
/**
* A callback vtable invoked by our diff-editors, as they receive diffs
- * from the server. 'svn diff', 'svn merge' and 'svn patch' all
- * implement their own versions of this vtable.
+ * from the server. 'svn diff' and 'svn merge' implement their own versions
+ * of this vtable.
*
* Common parameters:
*
@@ -2572,16 +2611,18 @@ typedef struct svn_wc_diff_callbacks_t
/* Asking questions about a working copy. */
-/** Set @a *wc_format to @a path's working copy format version number if
- * @a path is a valid working copy directory, else set it to 0.
- * Return error @c APR_ENOENT if @a path does not exist at all.
+/** Set @a *wc_format to @a local_abspath's working copy format version
+ * number if @a local_abspath is a valid working copy directory, else set it
+ * to 0.
+ *
+ * Return error @c APR_ENOENT if @a local_abspath does not exist at all.
*
* @since New in 1.7.
*/
svn_error_t *
svn_wc_check_wc2(int *wc_format,
svn_wc_context_t *wc_ctx,
- const char *local_path,
+ const char *local_abspath,
apr_pool_t *scratch_pool);
/**
@@ -3142,7 +3183,7 @@ svn_wc_get_ancestry2(const char **url,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Similar to svn_wc_get_ancestry2(), but using an adm_access baton / relative
+/** Similar to svn_wc_get_ancestry2(), but using an adm_access baton / relative
* path parameter pair.
*
* @deprecated Provided for backward compatibility with the 1.6 API.
@@ -3271,10 +3312,17 @@ svn_wc_walk_entries(const char *path,
apr_pool_t *pool);
-/** Mark missing @a path as 'deleted' in its @a parent's list of entries.
+/** Mark missing @a path as 'deleted' in its @a parent's list of
+ * entries. @ path should be a directory that is both deleted (via
+ * svn_wc_delete4) and removed (via a system call). This function
+ * should only be called during post-commit processing following a
+ * successful commit editor drive.
*
* Return #SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
+ *
+ * @deprecated Provided for backward compatibility with the 1.6 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_mark_missing_deleted(const char *path,
svn_wc_adm_access_t *parent,
@@ -3485,10 +3533,10 @@ typedef struct svn_wc_status2_t
/** Can be @c NULL if not under version control. */
const svn_wc_entry_t *entry;
- /** The status of the entries text. */
+ /** The status of the entry itself, including its text if it is a file. */
enum svn_wc_status_kind text_status;
- /** The status of the entries properties. */
+ /** The status of the entry's properties. */
enum svn_wc_status_kind prop_status;
/** a directory can be 'locked' if a working copy update was interrupted. */
@@ -3804,6 +3852,7 @@ typedef void (*svn_wc_status_func_t)(voi
*
* If @a external_func is non-NULL, call it with @a external_baton if an
* external definition is found while walking @a local_abspath.
+ * ### call it with what other parameters?
*
* This function uses @a scratch_pool for temporary allocations.
*
@@ -3878,6 +3927,9 @@ svn_wc_walk_status(svn_wc_context_t *wc_
* state in it. (Caller should obtain @a traversal_info from
* svn_wc_init_traversal_info().)
*
+ * ### Since r879231 it's not traversal_info, it's external_func/
+ * external_baton which is ...?
+ *
* Allocate the editor itself in @a pool, but the editor does temporary
* allocations in a subpool of @a pool.
*
@@ -3897,7 +3949,7 @@ svn_wc_get_status_editor5(const svn_delt
const apr_array_header_t *ignore_patterns,
svn_wc_status_func4_t status_func,
void *status_baton,
- svn_wc_external_update_t external_update,
+ svn_wc_external_update_t external_func,
void *external_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
@@ -3950,7 +4002,7 @@ svn_wc_get_status_editor3(const svn_delt
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
- apr_array_header_t *ignore_patterns,
+ const apr_array_header_t *ignore_patterns,
svn_wc_status_func2_t status_func,
void *status_baton,
svn_cancel_func_t cancel_func,
@@ -4074,7 +4126,7 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
void *notify_baton,
apr_pool_t *scratch_pool);
-/* Similar to svn_wc_copy3(), but takes access batons and a relative path
+/** Similar to svn_wc_copy3(), but takes access batons and a relative path
* and a basename instead of absolute paths and a working copy context.
*
* @since New in 1.2.
@@ -4338,13 +4390,13 @@ svn_wc_add(const char *path,
/** Add a file to a working copy at @a local_abspath, obtaining the
*text-base's contents from @a new_base_contents, the wc file's
- * content from @a new_contents, its base properties from @a
- * new_base_props and wc properties from @a new_props. Use @a wc_ctx
- * for accessing the working copy.
- *
- * The base text and props normally come from the repository file
- * represented by the copyfrom args, see below. The new file will
- * be scheduled for addition with history.
+ * content from @a new_contents, its unmodified properties from @a
+ * new_base_props and its actual properties from @a new_props. Use
+ * @a wc_ctx for accessing the working copy.
+ *
+ * The unmodified text and props normally come from the repository
+ * file represented by the copyfrom args, see below. The new file
+ * will be marked as copy.
*
* @a new_contents and @a new_props may be NULL, in which case
* the working copy text and props are taken from the base files with
@@ -4353,8 +4405,7 @@ svn_wc_add(const char *path,
* @a new_contents must be provided in Normal Form. This is required
* in order to pass both special and non-special files through a stream.
*
- * @a adm_access, or an access baton in its associated set, must
- * contain a write lock for the parent of @a dst_path.
+ * @a wc_ctx must contain a write lock for the parent of @a dst_path.
*
* If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a
* valid revision number, and together they are the copyfrom history
@@ -4362,8 +4413,8 @@ svn_wc_add(const char *path,
*
* The @a cancel_func and @a cancel_baton are a standard cancellation
* callback, or NULL if no callback is needed. @a notify_func and
- * @a notify_baton are a notification callback, and will be notified
- * of the addition of this file.
+ * @a notify_baton are a notification callback, and (if not NULL)
+ * will be notified of the addition of this file.
*
* Use @a scratch_pool for temporary allocations.
*
@@ -4398,7 +4449,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
void *notify_baton,
apr_pool_t *scratch_pool);
-/* Similar to svn_wc_add_repos_file4, but uses access batons and a
+/** Similar to svn_wc_add_repos_file4, but uses access batons and a
* relative path instead of a working copy context and absolute path.
*
* @since New in 1.6.
@@ -4692,18 +4743,21 @@ svn_wc_committed_queue_create(apr_pool_t
/**
* Queue committed items to be processed later by
- * svn_wc_process_committed_queue().
+ * svn_wc_process_committed_queue2().
*
- * All pointer data passed to this function (@a path, @a adm_access,
- * @a wcprop_changes and @a checksum) should remain valid until the queue
- * has been processed by svn_wc_process_committed_queue().
+ * All pointer data passed to this function (@a local_abspath,
+ * @a wcprop_changes * and @a checksum) should remain valid until the
+ * queue has been processed by svn_wc_process_committed_queue2().
*
- * Record in @a queue that @a path will need to be bumped after a commit
- * succeeds. @a adm_access must hold a write lock appropriate for @a path.
+ * Record in @a queue that @a local_abspath will need to be bumped
+ * after a commit succeeds.
*
* If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt>
* changes to wc properties; if an #svn_prop_t->value is NULL, then
* that property is deleted.
+ * ### [JAF] No, a prop whose value is NULL is ignored, not deleted. This
+ * ### seems to be not a set of changes but rather the new complete set of
+ * ### props. And it's renamed to 'new_dav_cache' inside; why?
*
* If @a remove_lock is @c TRUE, any entryprops related to a repository
* lock will be removed.
@@ -4711,11 +4765,13 @@ svn_wc_committed_queue_create(apr_pool_t
* If @a remove_changelist is @c TRUE, any association with a
* changelist will be removed.
*
- * If @a path is a file and @a checksum is non-NULL, use @a checksum as
- * the checksum for the new text base. Otherwise, calculate the checksum
+ * If @a local_abspath is a file and @a checksum is non-NULL, use @a checksum
+ * as the checksum for the new text base. Otherwise, calculate the checksum
* if needed.
+ * ### [JAF] No, it doesn't calculate the checksum, it stores null in wc.db:
+ * ### see svn_wc__process_committed_internal().
*
- * If @a recurse is TRUE and @a path is a directory, then bump every
+ * If @a recurse is TRUE and @a local_abspath is a directory, then bump every
* versioned object at or under @a path. This is usually done for
* copied trees.
*
@@ -4726,8 +4782,26 @@ svn_wc_committed_queue_create(apr_pool_t
* it will bump ALL nodes under the directory, regardless of their
* actual inclusion in the new revision.
*
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc_queue_committed3(svn_wc_committed_queue_t *queue,
+ const char *local_abspath,
+ svn_boolean_t recurse,
+ const apr_array_header_t *wcprop_changes,
+ svn_boolean_t remove_lock,
+ svn_boolean_t remove_changelist,
+ const svn_checksum_t *checksum,
+ apr_pool_t *scratch_pool);
+
+/** Same as svn_wc_queue_committed3() except @a path doesn't have to be an
+ * abspath and @a adm_access is unused.
+ *
* @since New in 1.6.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.6 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_queue_committed2(svn_wc_committed_queue_t *queue,
const char *path,
@@ -4768,11 +4842,23 @@ svn_wc_queue_committed(svn_wc_committed_
* @a rev_date and @a rev_author are the (server-side) date and author
* of the new revision; one or both may be @c NULL.
*
- * @a adm_access must be associated with all affected directories, and
- * must hold a write lock in each one.
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc_process_committed_queue2(svn_wc_committed_queue_t *queue,
+ svn_wc_context_t *wc_ctx,
+ svn_revnum_t new_revnum,
+ const char *rev_date,
+ const char *rev_author,
+ apr_pool_t *scratch_pool);
+
+/** @see svn_wc_process_committed_queue2()
*
* @since New in 1.5.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.5 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_process_committed_queue(svn_wc_committed_queue_t *queue,
svn_wc_adm_access_t *adm_access,
@@ -4922,6 +5008,9 @@ svn_wc_process_committed(const char *pat
* state in it. (Caller should obtain @a traversal_info from
* svn_wc_init_traversal_info().)
*
+ * ### Since r879231 it's not traversal_info, it's external_func/
+ * external_baton which is ...?
+ *
* @since New in 1.7.
*/
svn_error_t *
@@ -5184,14 +5273,14 @@ svn_wc_get_update_editor4(const svn_delt
void **edit_baton,
svn_revnum_t *target_revision,
svn_wc_context_t *wc_ctx,
- const char *local_abspath,
+ const char *anchor_abspath,
const char *target_basename,
svn_boolean_t use_commit_times,
svn_depth_t depth,
svn_boolean_t depth_is_sticky,
svn_boolean_t allow_unver_obstructions,
const char *diff3_cmd,
- apr_array_header_t *preserved_exts,
+ const apr_array_header_t *preserved_exts,
svn_wc_get_file_t fetch_func,
void *fetch_baton,
svn_wc_conflict_resolver_func_t conflict_func,
@@ -5236,7 +5325,7 @@ svn_wc_get_update_editor3(svn_revnum_t *
svn_wc_get_file_t fetch_func,
void *fetch_baton,
const char *diff3_cmd,
- apr_array_header_t *preserved_exts,
+ const apr_array_header_t *preserved_exts,
const svn_delta_editor_t **editor,
void **edit_baton,
svn_wc_traversal_info_t *ti,
@@ -5294,65 +5383,14 @@ svn_wc_get_update_editor(svn_revnum_t *t
apr_pool_t *pool);
/**
- * A variant of svn_wc_get_update_editor().
+ * A variant of svn_wc_get_update_editor4().
*
* Set @a *editor and @a *edit_baton to an editor and baton for "switching"
* a working copy to a new @a switch_url. (Right now, this URL must be
* within the same repository that the working copy already comes
* from.) @a switch_url must not be @c NULL.
*
- * @a anchor_abspath is a local working copy directory, with a fully recursive
- * write lock in @a wc_ctx, which will be used as the root of our editor.
- *
- * @a target_basename is the entry in @a anchor_abspath that will actually be
- * updated, or the empty string if all of @a anchor_abspath should be updated.
- *
- * @a target is the entry in @a anchor that will actually be updated, or
- * empty if all of @a anchor should be updated.
- *
- * The editor invokes @a notify_func with @a notify_baton as the switch
- * progresses, if @a notify_func is non-NULL.
- *
- * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as
- * the switch progresses to determine if it should continue.
- *
- * If @a conflict_func is non-NULL, then invoke it with @a
- * conflict_baton whenever a conflict is encountered, giving the
- * callback a chance to resolve the conflict before the editor takes
- * more drastic measures (such as marking a file conflicted, or
- * bailing out of the switch).
- *
- * If @a external_func is non-NULL, then invoke it with @a external_baton
- * whenever external changes are encountered, giving the callback a chance
- * to store the external information for processing.
- *
- * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
- * a fallback for retrieving repository files whenever 'copyfrom' args
- * are sent into editor->add_file().
- *
- * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
- * any merging; otherwise, use the built-in merge code.
- *
- * @a preserved_exts is an array of filename patterns which, when
- * matched against the extensions of versioned files, determine for
- * which such files any related generated conflict files will preserve
- * the original file's extension as their own. If a file's extension
- * does not match any of the patterns in @a preserved_exts (which is
- * certainly the case if @a preserved_exts is @c NULL or empty),
- * generated conflict files will carry Subversion's custom extensions.
- *
- * @a target_revision is a pointer to a revision location which, after
- * successful completion of the drive of this editor, will be
- * populated with the revision to which the working copy was updated.
- *
- * If @a use_commit_times is TRUE, then all edited/added files will
- * have their working timestamp set to the last-committed-time. If
- * FALSE, the working files will be touched with the 'now' time.
- *
- * @a depth and @a depth_is_sticky behave as for svn_wc_get_update_editor3().
- *
- * If @a allow_unver_obstructions is TRUE, then allow unversioned
- * obstructions when adding a path.
+ * All other parameters behave as for svn_wc_get_update_editor4().
*
* @since New in 1.7.
*/
@@ -5369,7 +5407,7 @@ svn_wc_get_switch_editor4(const svn_delt
svn_boolean_t depth_is_sticky,
svn_boolean_t allow_unver_obstructions,
const char *diff3_cmd,
- apr_array_header_t *preserved_exts,
+ const apr_array_header_t *preserved_exts,
svn_wc_get_file_t fetch_func,
void *fetch_baton,
svn_wc_conflict_resolver_func_t conflict_func,
@@ -5414,7 +5452,7 @@ svn_wc_get_switch_editor3(svn_revnum_t *
svn_wc_conflict_resolver_func_t conflict_func,
void *conflict_baton,
const char *diff3_cmd,
- apr_array_header_t *preserved_exts,
+ const apr_array_header_t *preserved_exts,
const svn_delta_editor_t **editor,
void **edit_baton,
svn_wc_traversal_info_t *ti,
@@ -6043,8 +6081,7 @@ svn_wc_diff(svn_wc_adm_access_t *anchor,
* If @a original_props is non-@c NULL, then set @a *original_props to
* hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
* that represents the 'pristine' property list of @a path. This hashtable is
- * allocated in @a result_pool, and can be used to compare old and new values
- * of properties.
+ * allocated in @a result_pool.
*
* Use @a scratch_pool for temporary allocations.
*/
@@ -6353,10 +6390,24 @@ svn_wc_merge_prop_diffs(svn_wc_notify_st
apr_pool_t *pool);
-/** Given a @a path to a wc file, return a stream to the @a contents of
- * the pristine copy of the file. Use @a wc_ctx to access the working
- * copy.This is needed so clients can do diffs. If the WC has no
- * text-base, return a @c NULL instead of a stream.
+/** Given a @a path to a wc file, return in @a *contents a readonly stream to
+ * the pristine contents of the file that would serve as base content for the
+ * next commit. That means:
+ *
+ * When there is no change in node history scheduled, i.e. when there are only
+ * local text-mods, prop-mods or a delete, return the last checked-out or
+ * updated-/switched-to contents of the file.
+ *
+ * If the file is simply added or replaced (no copy-/move-here involved),
+ * set @a *contents to @c NULL.
+ *
+ * When the file has been locally copied-/moved-here, return the contents of
+ * the copy/move source (even if the copy-/move-here replaces a locally
+ * deleted file).
+ *
+ * If @a local_abspath refers to an unversioned or non-existing path, return
+ * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a wc_ctx to access the working copy.
+ * @a contents may not be @c NULL (unlike @a *contents).
*
* @since New in 1.7. */
svn_error_t *
@@ -6395,7 +6446,7 @@ svn_wc_get_pristine_copy_path(const char
/**
* Recurse from @a local_abspath, cleaning up unfinished log business. Perform
* any temporary allocations in @a scratch_pool. Any working copy locks under
- * @a local_path will be taken over and then cleared by this function.
+ * @a local_abspath will be taken over and then cleared by this function.
*
* WARNING: there is no mechanism that will protect locks that are still being
* used.
@@ -6443,6 +6494,22 @@ svn_wc_cleanup(const char *path,
void *cancel_baton,
apr_pool_t *pool);
+/** Callback for retrieving a repository root for a url from upgrade.
+ *
+ * Called by svn_wc_upgrade() when no repository root and/or repository
+ * uuid are recorded in the working copy. For normal Subversion 1.5 and
+ * later working copies, this callback will not be used.
+ *
+ * @since New in 1.7.
+ */
+typedef svn_error_t * (*svn_wc_upgrade_get_repos_info_t)(
+ const char **repos_root,
+ const char **repos_uuid,
+ void *baton,
+ const char *url,
+ apr_pool_t *scratch_pool,
+ apr_pool_t *result_pool);
+
/**
* Upgrade the working copy at @a local_abspath to the latest metadata
* storage format. @a local_abspath should be an absolute path to the
@@ -6457,11 +6524,17 @@ svn_wc_cleanup(const char *path,
* the path of the upgraded directory. @a notify_func may be @c NULL
* if this notification is not needed.
*
+ * If the old working copy doesn't contain a repository root and/or
+ * repository uuid, @a repos_info_func (if non-NULL) will be called
+ * with @a repos_info_baton to provide the missing information.
+ *
* @since New in 1.7.
*/
svn_error_t *
svn_wc_upgrade(svn_wc_context_t *wc_ctx,
const char *local_abspath,
+ svn_wc_upgrade_get_repos_info_t repos_info_func,
+ void *repos_info_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
svn_wc_notify_func2_t notify_func,
@@ -6850,15 +6923,17 @@ svn_wc_translated_stream(svn_stream_t **
* matching @a file_baton) through @a editor, then close @a file_baton
* afterwards. Use @a scratch_pool for any temporary allocation.
*
- * This process creates a copy of @a local_abspath with keywords and eol
- * untranslated. If @a tempfile is non-NULL, set @a *tempfile to the
- * absolute path to this copy, allocated in @a result_pool. Do not clean
- * up the copy; caller can do that. If @a digest is non-NULL, put the MD5
- * checksum of the temporary file into @a digest, which must point to @c
- * APR_MD5_DIGESTSIZE bytes of storage. (The purpose of handing back the
- * tmp copy is that it is usually about to become the new text base anyway,
- * but the installation of the new text base is outside the scope of this
- * function.)
+ * If @a tempfile is non-NULL, make a copy of @a local_abspath with keywords
+ * and eol translated to repository-normal form, and set @a *tempfile to the
+ * absolute path to this copy, allocated in @a result_pool. The copy will
+ * be in the temporary-text-base directory. Do not clean up the copy;
+ * caller can do that. (The purpose of handing back the tmp copy is that it
+ * is usually about to become the new text base anyway, but the installation
+ * of the new text base is outside the scope of this function.)
+ *
+ * If @a digest is non-NULL, put the MD5 checksum of (@a local_abspath
+ * translated to repository-normal form) into @a digest, which must point to
+ * @c APR_MD5_DIGESTSIZE bytes of storage.
*
* If @a fulltext, send the untranslated copy of @a local_abspath through
* @a editor as full-text; else send it as svndiff against the current text
@@ -6878,7 +6953,7 @@ svn_error_t *
svn_wc_transmit_text_deltas3(const char **tempfile,
unsigned char digest[],
svn_wc_context_t *wc_ctx,
- const char *local_path,
+ const char *local_abspath,
svn_boolean_t fulltext,
const svn_delta_editor_t *editor,
void *file_baton,
@@ -6998,7 +7073,7 @@ svn_wc_get_ignores(apr_array_header_t **
*/
svn_boolean_t
svn_wc_match_ignore_list(const char *str,
- apr_array_header_t *list,
+ const apr_array_header_t *list,
apr_pool_t *pool);
@@ -7081,7 +7156,8 @@ typedef struct svn_wc_revision_status_t
/** Set @a *result_p to point to a new #svn_wc_revision_status_t structure
* containing a summary of the revision range and status of the working copy
* at @a local_abspath (not including "externals"). @a local_abspath must
- * be absolute.
+ * be absolute. Return SVN_ERR_WC_PATH_NOT_FOUND if @a local_abspath is not
+ * a working copy path.
*
* Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the
* lowest and highest revision numbers in the working copy. If @a committed
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c Tue Aug 10 18:06:17 2010
@@ -312,8 +312,8 @@ add_file(const char *local_abspath,
for (hi = apr_hash_first(pool, properties);
hi != NULL; hi = apr_hash_next(hi))
{
- const char *pname = svn_apr_hash_index_key(hi);
- const svn_string_t *pval = svn_apr_hash_index_val(hi);
+ const char *pname = svn__apr_hash_index_key(hi);
+ const svn_string_t *pval = svn__apr_hash_index_val(hi);
svn_error_t *err;
/* It's probably best to pass 0 for force, so that if
@@ -487,39 +487,43 @@ add_dir_recursive(const char *dir_abspat
}
-/* The main logic of the public svn_client_add4; the only difference
- is that this function uses an existing access baton.
- (svn_client_add4 just generates an access baton and calls this func.) */
+struct add_with_write_lock_baton {
+ const char *local_abspath;
+ svn_depth_t depth;
+ svn_boolean_t force;
+ svn_boolean_t no_ignore;
+ svn_client_ctx_t *ctx;
+};
+
+/* The main logic of the public svn_client_add4. */
static svn_error_t *
-add(const char *local_abspath,
- svn_depth_t depth,
- svn_boolean_t force,
- svn_boolean_t no_ignore,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+add(void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
{
svn_node_kind_t kind;
svn_error_t *err;
+ struct add_with_write_lock_baton *b = baton;
- SVN_ERR(svn_io_check_path(local_abspath, &kind, pool));
+ SVN_ERR(svn_io_check_path(b->local_abspath, &kind, scratch_pool));
if (kind == svn_node_dir)
{
/* We use add_dir_recursive for all directory targets
and pass depth along no matter what it is, so that the
target's depth will be set correctly. */
- err = add_dir_recursive(local_abspath, depth,
- force, no_ignore, ctx, pool);
+ err = add_dir_recursive(b->local_abspath, b->depth,
+ b->force, b->no_ignore, b->ctx,
+ scratch_pool);
}
else if (kind == svn_node_file)
- err = add_file(local_abspath, ctx, pool);
+ err = add_file(b->local_abspath, b->ctx, scratch_pool);
else
- err = svn_wc_add4(ctx->wc_ctx, local_abspath, depth, NULL,
+ err = svn_wc_add4(b->ctx->wc_ctx, b->local_abspath, b->depth, NULL,
SVN_INVALID_REVNUM,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2, pool);
+ b->ctx->cancel_func, b->ctx->cancel_baton,
+ b->ctx->notify_func2, b->ctx->notify_baton2,
+ scratch_pool);
/* Ignore SVN_ERR_ENTRY_EXISTS when FORCE is set. */
- if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)
+ if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && b->force)
{
svn_error_clear(err);
err = SVN_NO_ERROR;
@@ -579,9 +583,9 @@ svn_client_add4(const char *path,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
- svn_error_t *err;
const char *parent_abspath;
const char *local_abspath;
+ struct add_with_write_lock_baton baton;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
@@ -606,17 +610,14 @@ svn_client_add4(const char *path,
svn_pool_destroy(subpool);
}
- SVN_ERR(svn_wc__acquire_write_lock(NULL, ctx->wc_ctx, parent_abspath,
- pool, pool));
-
- err = add(local_abspath, depth, force, no_ignore, ctx, pool);
-
- /* ### Currently we rely on the fact that this releases all our write locks
- ### recursively. */
- return svn_error_return(
- svn_error_compose_create(
- err,
- svn_wc__release_write_lock(ctx->wc_ctx, parent_abspath, pool)));
+ baton.local_abspath = local_abspath;
+ baton.depth = depth;
+ baton.force = force;
+ baton.no_ignore = no_ignore;
+ baton.ctx = ctx;
+ SVN_ERR(svn_wc__call_with_write_lock(add, &baton, ctx->wc_ctx,
+ parent_abspath, pool, pool));
+ return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c Tue Aug 10 18:06:17 2010
@@ -381,7 +381,7 @@ window_handler(svn_txdelta_window_t *win
/* Throw an SVN_ERR_CLIENT_IS_BINARY_FILE error if PROP_DIFFS indicates a
binary MIME type. Else, return SVN_NO_ERROR. */
static svn_error_t *
-check_mimetype(apr_array_header_t *prop_diffs, const char *target,
+check_mimetype(const apr_array_header_t *prop_diffs, const char *target,
apr_pool_t *pool)
{
int i;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cat.c?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cat.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cat.c Tue Aug 10 18:06:17 2010
@@ -71,7 +71,7 @@ cat_local_file(svn_wc_context_t *wc_ctx,
SVN_ERR(svn_wc__node_get_kind(&kind, wc_ctx, local_abspath, FALSE,
scratch_pool));
- if (kind == svn_node_unknown)
+ if (kind == svn_node_unknown || kind == svn_node_none)
return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
_("'%s' is not under version control"),
svn_dirent_local_style(local_abspath,
@@ -86,6 +86,12 @@ cat_local_file(svn_wc_context_t *wc_ctx,
{
SVN_ERR(svn_wc_get_pristine_contents2(&input, wc_ctx, local_abspath,
scratch_pool, scratch_pool));
+
+ if (input == NULL)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' has no base revision until it is committed"),
+ svn_dirent_local_style(local_abspath, scratch_pool));
+
SVN_ERR(svn_wc_get_prop_diffs2(NULL, &props, wc_ctx, local_abspath,
scratch_pool, scratch_pool));
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cleanup.c?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/cleanup.c Tue Aug 10 18:06:17 2010
@@ -32,9 +32,12 @@
#include "svn_client.h"
#include "svn_config.h"
#include "svn_dirent_uri.h"
+#include "svn_pools.h"
#include "client.h"
+#include "svn_props.h"
#include "svn_private_config.h"
+#include "private/svn_wc_private.h"
/*** Code. ***/
@@ -56,18 +59,143 @@ svn_client_cleanup(const char *path,
}
+/* callback baton for fetch_repos_info */
+struct repos_info_baton
+{
+ apr_pool_t *pool;
+ svn_client_ctx_t *ctx;
+ const char *last_repos;
+ const char *last_uuid;
+};
+
+/* svn_wc_upgrade_get_repos_info_t implementation for calling
+ svn_wc_upgrade() from svn_client_upgrade() */
+static svn_error_t *
+fetch_repos_info(const char **repos_root,
+ const char **repos_uuid,
+ void *baton,
+ const char *url,
+ apr_pool_t *scratch_pool,
+ apr_pool_t *result_pool)
+{
+ struct repos_info_baton *ri = baton;
+ apr_pool_t *subpool;
+ svn_ra_session_t *ra_session;
+
+ /* The same info is likely to retrieved multiple times (e.g. externals) */
+ if (ri->last_repos && svn_uri_is_child(ri->last_repos, url, NULL))
+ {
+ *repos_root = apr_pstrdup(result_pool, ri->last_repos);
+ *repos_uuid = apr_pstrdup(result_pool, ri->last_uuid);
+ return SVN_NO_ERROR;
+ }
+
+ subpool = svn_pool_create(scratch_pool);
+
+ SVN_ERR(svn_client_open_ra_session(&ra_session, url, ri->ctx, subpool));
+
+ SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
+ SVN_ERR(svn_ra_get_uuid2(ra_session, repos_uuid, result_pool));
+
+ /* Store data for further calls */
+ ri->last_repos = apr_pstrdup(ri->pool, *repos_root);
+ ri->last_uuid = apr_pstrdup(ri->pool, *repos_uuid);
+
+ svn_pool_destroy(subpool);
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
svn_client_upgrade(const char *path,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
{
const char *local_abspath;
+ apr_hash_t *externals;
+ apr_hash_index_t *hi;
+ apr_pool_t *iterpool;
+ svn_opt_revision_t rev = {svn_opt_revision_unspecified, {0}};
+ struct repos_info_baton info_baton;
+ info_baton.pool = scratch_pool;
+ info_baton.ctx = ctx;
+ info_baton.last_repos = NULL;
+ info_baton.last_uuid = NULL;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
SVN_ERR(svn_wc_upgrade(ctx->wc_ctx, local_abspath,
+ fetch_repos_info, &info_baton,
ctx->cancel_func, ctx->cancel_baton,
ctx->notify_func2, ctx->notify_baton2,
scratch_pool));
+ /* Now it's time to upgrade the externals too. We do it after the wc
+ upgrade to avoid that errors in the externals causes the wc upgrade to
+ fail. Thanks to caching the performance penalty of walking the wc a
+ second time shouldn't be too severe */
+ SVN_ERR(svn_client_propget3(&externals, SVN_PROP_EXTERNALS, path, &rev,
+ &rev, NULL, svn_depth_infinity, NULL, ctx,
+ scratch_pool));
+
+ iterpool = svn_pool_create(scratch_pool);
+
+ for (hi = apr_hash_first(scratch_pool, externals); hi;
+ hi = apr_hash_next(hi))
+ {
+ int i;
+ const char *externals_parent = svn__apr_hash_index_key(hi);
+ svn_string_t *external_desc = svn__apr_hash_index_val(hi);
+ apr_array_header_t *externals_p;
+
+ svn_pool_clear(iterpool);
+ externals_p = apr_array_make(iterpool, 1,
+ sizeof(svn_wc_external_item2_t*));
+
+ SVN_ERR(svn_wc_parse_externals_description3(&externals_p,
+ svn_dirent_dirname(path,
+ iterpool),
+ external_desc->data, TRUE,
+ iterpool));
+ for (i = 0; i < externals_p->nelts; i++)
+ {
+ svn_wc_external_item2_t *item;
+ const char *external_abspath;
+ const char *external_path;
+ svn_node_kind_t kind;
+ svn_error_t *err;
+
+ item = APR_ARRAY_IDX(externals_p, i, svn_wc_external_item2_t*);
+
+ external_path = svn_dirent_join(externals_parent, item->target_dir,
+ iterpool);
+
+ SVN_ERR(svn_dirent_get_absolute(&external_abspath, external_path,
+ iterpool));
+
+ /* This is hack. We can only send dirs to svn_wc_upgrade(). This
+ way we will get an exception saying that the wc must be
+ upgraded if it's a dir. If it's a file then the lookup is done
+ in an adm_dir belonging to the real wc and since that was
+ updated before the externals no error is returned. */
+ err = svn_wc__node_get_kind(&kind, ctx->wc_ctx, external_abspath,
+ FALSE, iterpool);
+
+ if (err && err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
+ {
+ svn_error_clear(err);
+
+ SVN_ERR(svn_wc_upgrade(ctx->wc_ctx, external_abspath,
+ fetch_repos_info, &info_baton,
+ ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
+ iterpool));
+ }
+ else
+ SVN_ERR(err);
+ }
+ }
+
+ svn_pool_destroy(iterpool);
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h Tue Aug 10 18:06:17 2010
@@ -388,7 +388,7 @@ svn_error_t *
svn_client__open_ra_session_internal(svn_ra_session_t **ra_session,
const char *base_url,
const char *base_dir,
- apr_array_header_t *commit_items,
+ const apr_array_header_t *commit_items,
svn_boolean_t use_admin,
svn_boolean_t read_only_wc,
svn_client_ctx_t *ctx,
@@ -615,9 +615,8 @@ svn_client__checkout_internal(svn_revnum
apr_pool_t *pool);
/* Switch a working copy PATH to URL@PEG_REVISION at REVISION, and (if not
- NULL) set RESULT_REV to the switch revision. ADM_ACCESS may be NULL, but
- if is not, it is a write locked working copy administrative access baton
- that has an associated baton for PATH. Only switch as deeply as DEPTH
+ NULL) set RESULT_REV to the switch revision. A write lock will be
+ acquired and released if not held. Only switch as deeply as DEPTH
indicates. If TIMESTAMP_SLEEP is NULL this function will sleep before
returning to ensure timestamp integrity. If TIMESTAMP_SLEEP is not
NULL then the function will not sleep but will set *TIMESTAMP_SLEEP
@@ -637,7 +636,6 @@ svn_client__switch_internal(svn_revnum_t
const char *url,
const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *revision,
- svn_wc_adm_access_t *adm_access,
svn_depth_t depth,
svn_boolean_t depth_is_sticky,
svn_boolean_t *timestamp_sleep,
@@ -657,7 +655,8 @@ svn_client__switch_internal(svn_revnum_t
TARGET is a working-copy path, the base of the hierarchy to be
compared. It corresponds to the URL opened in RA_SESSION below.
- WC_CTX is a context for the working copy.
+ WC_CTX is a context for the working copy and should be NULL for
+ operations that do not involve a working copy.
DIFF_CMD/DIFF_CMD_BATON represent the callback and callback argument that
implement the file comparison function
@@ -732,12 +731,9 @@ svn_client__get_diff_summarize_editor(co
*/
typedef struct
{
- /* The source path or url. */
+ /* The absolute source path or url. */
const char *src;
- /* The absolute path of the source. */
- const char *src_abs;
-
/* The base name of the object. It should be the same for both src
and dst. */
const char *base_name;
@@ -758,11 +754,11 @@ typedef struct
/* The source revision number. */
svn_revnum_t src_revnum;
- /* The destination path or url */
+ /* The absolute destination path or url */
const char *dst;
- /* The destination's parent path */
- const char *dst_parent;
+ /* The absolute source path or url of the destination's parent. */
+ const char *dst_parent_abspath;
} svn_client__copy_pair_t;
/* ---------------------------------------------------------------- */
@@ -823,12 +819,12 @@ typedef struct
#define SVN_CLIENT__SINGLE_REPOS_NAME "svn:single-repos"
-/* Recursively crawl a set of working copy paths (PARENT_DIR + each
+/* Recursively crawl a set of working copy paths (DIR_ABSPATH + each
item in the TARGETS array) looking for commit candidates, locking
working copy directories as the crawl progresses. For each
candidate found:
- - create svn_client_commit_item_t for the candidate.
+ - create svn_client_commit_item3_t for the candidate.
- add the structure to an apr_array_header_t array of commit
items that are in the same repository, creating a new array if
@@ -847,13 +843,9 @@ typedef struct
At the successful return of this function, COMMITTABLES will be an
apr_hash_t * hash of apr_array_header_t * arrays (of
- svn_client_commit_item_t * structures), keyed on const char *
+ svn_client_commit_item3_t * structures), keyed on const char *
canonical repository URLs. LOCK_TOKENS will point to a hash table
- with const char * lock tokens, keyed on const char * URLs. Also,
- LOCKED_DIRS will be an apr_hash_t * hash of svn_wc_adm_access_t *
- keyed on const char * working copy path directory names which were
- locked in the process of this crawl. These will need to be
- unlocked again post-commit.
+ with const char * lock tokens, keyed on const char * URLs.
If DEPTH is specified, descend (or not) into each target in TARGETS
as specified by DEPTH; the behavior is the same as that described
@@ -873,8 +865,8 @@ typedef struct
svn_error_t *
svn_client__harvest_committables(apr_hash_t **committables,
apr_hash_t **lock_tokens,
- svn_wc_adm_access_t *parent_dir,
- apr_array_header_t *targets,
+ const char *dir_abspath,
+ const apr_array_header_t *targets,
svn_depth_t depth,
svn_boolean_t just_locked,
const apr_array_header_t *changelists,
@@ -882,12 +874,11 @@ svn_client__harvest_committables(apr_has
apr_pool_t *pool);
-/* Recursively crawl each working copy path SRC in COPY_PAIRS, harvesting
- commit_items into a COMMITABLES hash (see the docstring for
- svn_client__harvest_committables for what that really means, and
- for the relevance of LOCKED_DIRS) as if every entry at or below
- the SRC was to be committed as a set of adds (mostly with history)
- to a new repository URL (DST in COPY_PAIRS).
+/* Recursively crawl each absolute working copy path SRC in COPY_PAIRS,
+ harvesting commit_items into a COMMITABLES hash (see the docstring for
+ svn_client__harvest_committables for what that really means) as if
+ every entry at or below the SRC was to be committed as a set of adds
+ (mostly with history) to a new repository URL (DST in COPY_PAIRS).
If CTX->CANCEL_FUNC is non-null, it will be called with
CTX->CANCEL_BATON while harvesting to determine if the client has
@@ -927,9 +918,11 @@ svn_client__condense_commit_items(const
NOTIFY_PATH_PREFIX will be passed to CTX->notify_func2() as the
common absolute path prefix of the committed paths. It can be NULL.
- If the caller wants to keep track of any outstanding temporary
- files left after the transmission of text and property mods,
- *TEMPFILES is the place to look.
+ If NEW_TEXT_BASE_ABSPATHS is not NULL, create in the temporary-text-base
+ directory a copy of the working version of each file transmitted, but
+ with keywords and eol translated to repository-normal form, and set
+ *NEW_TEXT_BASE_ABSPATHS to a hash that maps (const char *) paths (from
+ the items' paths) to the (const char *) abspaths of these files.
MD5 checksums, if available, for the new text bases of committed
files are stored in *CHECKSUMS, which maps const char* paths (from the
@@ -937,11 +930,11 @@ svn_client__condense_commit_items(const
null. */
svn_error_t *
svn_client__do_commit(const char *base_url,
- apr_array_header_t *commit_items,
+ const apr_array_header_t *commit_items,
const svn_delta_editor_t *editor,
void *edit_baton,
const char *notify_path_prefix,
- apr_hash_t **tempfiles,
+ apr_hash_t **new_text_base_abspaths,
apr_hash_t **checksums,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
@@ -951,10 +944,11 @@ svn_client__do_commit(const char *base_u
/*** Externals (Modules) ***/
/* Handle changes to the svn:externals property described by EXTERNALS_OLD,
- EXTERNALS_NEW, and AMBIENT_DEPTHS. The tree's top level
- directory is at TO_PATH and should have a write lock in ADM_ACCESS
- and corresponds to FROM_URL URL in the repository, which has a root
- URL of REPOS_ROOT_URL.
+
+ EXTERNALS_NEW, and AMBIENT_DEPTHS. The tree's top level directory
+ is at TO_PATH and corresponds to FROM_URL URL in the repository,
+ which has a root URL of REPOS_ROOT_URL. A write lock should be
+ held.
For each changed value of the property, discover the nature of the
change and behave appropriately -- either check a new "external"
@@ -984,8 +978,7 @@ svn_client__do_commit(const char *base_u
Use POOL for temporary allocation. */
svn_error_t *
-svn_client__handle_externals(svn_wc_adm_access_t *adm_access,
- apr_hash_t *externals_old,
+svn_client__handle_externals(apr_hash_t *externals_old,
apr_hash_t *externals_new,
apr_hash_t *ambient_depths,
const char *from_url,
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c Tue Aug 10 18:06:17 2010
@@ -221,8 +221,8 @@ import_file(const svn_delta_editor_t *ed
{
for (hi = apr_hash_first(pool, properties); hi; hi = apr_hash_next(hi))
{
- const char *pname = svn_apr_hash_index_key(hi);
- const svn_string_t *pval = svn_apr_hash_index_val(hi);
+ const char *pname = svn__apr_hash_index_key(hi);
+ const svn_string_t *pval = svn__apr_hash_index_val(hi);
SVN_ERR(editor->change_file_prop(file_baton, pname, pval, pool));
}
@@ -315,8 +315,8 @@ import_dir(const svn_delta_editor_t *edi
for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
{
const char *this_path, *this_edit_path, *abs_path;
- const char *filename = svn_apr_hash_index_key(hi);
- const svn_io_dirent_t *dirent = svn_apr_hash_index_val(hi);
+ const char *filename = svn__apr_hash_index_key(hi);
+ const svn_io_dirent_t *dirent = svn__apr_hash_index_val(hi);
svn_pool_clear(subpool);
@@ -478,7 +478,7 @@ import_dir(const svn_delta_editor_t *edi
*/
static svn_error_t *
import(const char *path,
- apr_array_header_t *new_entries,
+ const apr_array_header_t *new_entries,
const svn_delta_editor_t *editor,
void *edit_baton,
svn_depth_t depth,
@@ -601,7 +601,7 @@ get_ra_editor(svn_ra_session_t **ra_sess
const char *base_url,
const char *base_dir,
const char *log_msg,
- apr_array_header_t *commit_items,
+ const apr_array_header_t *commit_items,
const apr_hash_t *revprop_table,
svn_commit_info_t **commit_info_p,
svn_boolean_t is_commit,
@@ -801,6 +801,9 @@ svn_client_import3(svn_commit_info_t **c
}
+/* Remove (if it exists) each file whose path is given by a value in the
+ * hash TEMPFILES, which is a mapping from (const char *) path to (const
+ * char *) tempfile abspath. Ignore the keys of TEMPFILES. */
static svn_error_t *
remove_tmpfiles(apr_hash_t *tempfiles,
apr_pool_t *pool)
@@ -818,7 +821,7 @@ remove_tmpfiles(apr_hash_t *tempfiles,
/* Clean up any tempfiles. */
for (hi = apr_hash_first(pool, tempfiles); hi; hi = apr_hash_next(hi))
{
- const char *path = svn_apr_hash_index_key(hi);
+ const char *path = svn__apr_hash_index_val(hi);
svn_pool_clear(subpool);
@@ -914,8 +917,8 @@ collect_lock_tokens(apr_hash_t **result,
for (hi = apr_hash_first(pool, all_tokens); hi; hi = apr_hash_next(hi))
{
- const char *url = svn_apr_hash_index_key(hi);
- const char *token = svn_apr_hash_index_val(hi);
+ const char *url = svn__apr_hash_index_key(hi);
+ const char *token = svn__apr_hash_index_val(hi);
if (strncmp(base_url, url, base_len) == 0
&& (url[base_len] == '\0' || url[base_len] == '/'))
@@ -935,7 +938,7 @@ struct post_commit_baton
{
svn_wc_committed_queue_t *queue;
apr_pool_t *qpool;
- svn_wc_adm_access_t *base_dir_access;
+ svn_wc_context_t *wc_ctx;
svn_boolean_t keep_changelists;
svn_boolean_t keep_locks;
apr_hash_t *checksums;
@@ -950,35 +953,23 @@ post_process_commit_item(void *baton, vo
svn_client_commit_item3_t *item =
*(svn_client_commit_item3_t **)this_item;
svn_boolean_t loop_recurse = FALSE;
- const char *adm_access_path;
- svn_wc_adm_access_t *adm_access;
svn_boolean_t remove_lock;
- svn_error_t *bump_err;
-
- if (item->kind == svn_node_dir)
- adm_access_path = item->path;
- else
- adm_access_path = svn_dirent_dirname(item->path, pool);
- bump_err = svn_wc_adm_retrieve(&adm_access, btn->base_dir_access,
- adm_access_path, pool);
- if (bump_err
- && bump_err->apr_err == SVN_ERR_WC_NOT_LOCKED)
- {
- /* Is it a directory that was deleted in the commit?
- Then we probably committed a missing directory. */
- if (item->kind == svn_node_dir
- && item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
- {
- /* Mark it as deleted in the parent. */
- svn_error_clear(bump_err);
- return svn_wc_mark_missing_deleted(item->path,
- btn->base_dir_access, pool);
- }
+ /* Is it a missing, deleted directory?
+
+ ### Temporary: once we centralise this sort of node is just a
+ normal delete and will get handled by the post-commit queue. */
+ if (item->kind == svn_node_dir
+ && item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+ {
+ svn_boolean_t obstructed;
+
+ SVN_ERR(svn_wc__node_is_status_obstructed(&obstructed,
+ btn->wc_ctx, item->path, pool));
+ if (obstructed)
+ return svn_wc__temp_mark_missing_not_present(item->path,
+ btn->wc_ctx, pool);
}
- if (bump_err)
- return bump_err;
-
if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
&& (item->kind == svn_node_dir)
@@ -990,7 +981,7 @@ post_process_commit_item(void *baton, vo
/* Allocate the queue in a longer-lived pool than (iter)pool:
we want it to survive the next iteration. */
- return svn_wc_queue_committed2(btn->queue, item->path, adm_access,
+ return svn_wc_queue_committed3(btn->queue, item->path,
loop_recurse, item->incoming_prop_changes,
remove_lock, !btn->keep_changelists,
apr_hash_get(btn->checksums,
@@ -1013,7 +1004,6 @@ commit_item_is_changed(void *baton, void
struct check_dir_delete_baton
{
- svn_wc_adm_access_t *base_dir_access;
svn_wc_context_t *wc_ctx;
svn_depth_t depth;
};
@@ -1022,17 +1012,24 @@ static svn_error_t *
check_nonrecursive_dir_delete(void *baton, void *this_item, apr_pool_t *pool)
{
struct check_dir_delete_baton *btn = baton;
- const char *target_abspath;
+ const char *target_abspath, *lock_abspath;
+ svn_boolean_t locked_here;
+ svn_node_kind_t kind;
SVN_ERR(svn_dirent_get_absolute(&target_abspath, *(const char **)this_item,
pool));
- {
- svn_wc_adm_access_t *adm_access;
- SVN_ERR_W(svn_wc_adm_probe_retrieve(&adm_access, btn->base_dir_access,
- target_abspath, pool),
- _("Are all the targets part of the same working copy?"));
- }
+ SVN_ERR(svn_wc__node_get_kind(&kind, btn->wc_ctx, target_abspath, FALSE,
+ pool));
+ if (kind == svn_node_dir)
+ lock_abspath = target_abspath;
+ else
+ lock_abspath = svn_dirent_dirname(target_abspath, pool);
+
+ SVN_ERR(svn_wc_locked2(&locked_here, NULL, btn->wc_ctx, lock_abspath, pool));
+ if (!locked_here)
+ return svn_error_create(SVN_ERR_WC_LOCKED, NULL,
+ _("Are all targets part of the same working copy?"));
/* ### TODO(sd): This check is slightly too strict. It should be
### possible to:
@@ -1052,13 +1049,10 @@ check_nonrecursive_dir_delete(void *bato
*/
if (btn->depth != svn_depth_infinity)
{
- svn_wc_status2_t *status;
- svn_node_kind_t kind;
-
- SVN_ERR(svn_io_check_path(target_abspath, &kind, pool));
-
if (kind == svn_node_dir)
{
+ svn_wc_status2_t *status;
+
/* ### Looking at schedule is probably enough, no need for
pristine compare etc. */
SVN_ERR(svn_wc_status3(&status, btn->wc_ctx, target_abspath, pool,
@@ -1106,7 +1100,6 @@ svn_client_commit4(svn_commit_info_t **c
apr_hash_t *lock_tokens;
apr_hash_t *tempfiles = NULL;
apr_hash_t *checksums;
- svn_wc_adm_access_t *base_dir_access;
apr_array_header_t *commit_items;
svn_error_t *cmt_err = SVN_NO_ERROR, *unlock_err = SVN_NO_ERROR;
svn_error_t *bump_err = SVN_NO_ERROR, *cleanup_err = SVN_NO_ERROR;
@@ -1164,13 +1157,7 @@ svn_client_commit4(svn_commit_info_t **c
}
}
- SVN_ERR(svn_wc__adm_open_in_context(&base_dir_access,
- ctx->wc_ctx,
- base_dir,
- TRUE, /* Write lock */
- -1, /* recursive lock */
- ctx->cancel_func, ctx->cancel_baton,
- pool));
+ SVN_ERR(svn_wc__acquire_write_lock(NULL, ctx->wc_ctx, base_dir, pool, pool));
/* One day we might support committing from multiple working copies, but
we don't yet. This check ensures that we don't silently commit a
@@ -1181,7 +1168,6 @@ svn_client_commit4(svn_commit_info_t **c
{
struct check_dir_delete_baton btn;
- btn.base_dir_access = base_dir_access;
btn.wc_ctx = ctx->wc_ctx;
btn.depth = depth;
SVN_ERR(svn_iter_apr_array(NULL, targets,
@@ -1192,7 +1178,7 @@ svn_client_commit4(svn_commit_info_t **c
/* Crawl the working copy for commit items. */
if ((cmt_err = svn_client__harvest_committables(&committables,
&lock_tokens,
- base_dir_access,
+ base_dir,
rel_targets,
depth,
! keep_locks,
@@ -1282,7 +1268,7 @@ svn_client_commit4(svn_commit_info_t **c
btn.queue = queue;
btn.qpool = pool;
- btn.base_dir_access = base_dir_access;
+ btn.wc_ctx = ctx->wc_ctx;
btn.keep_changelists = keep_changelists;
btn.keep_locks = keep_locks;
btn.checksums = checksums;
@@ -1298,7 +1284,7 @@ svn_client_commit4(svn_commit_info_t **c
SVN_ERR_ASSERT(*commit_info_p);
bump_err
- = svn_wc_process_committed_queue(queue, base_dir_access,
+ = svn_wc_process_committed_queue2(queue, ctx->wc_ctx,
(*commit_info_p)->revision,
(*commit_info_p)->date,
(*commit_info_p)->author,
@@ -1320,7 +1306,7 @@ svn_client_commit4(svn_commit_info_t **c
clean-up. */
if (! bump_err)
{
- unlock_err = svn_wc_adm_close2(base_dir_access, pool);
+ unlock_err = svn_wc__release_write_lock(ctx->wc_ctx, base_dir, pool);
if (! unlock_err)
cleanup_err = remove_tmpfiles(tempfiles, pool);
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c?rev=984153&r1=984152&r2=984153&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c Tue Aug 10 18:06:17 2010
@@ -163,7 +163,7 @@ look_up_committable(apr_hash_t *committa
for (hi = apr_hash_first(pool, committables); hi; hi = apr_hash_next(hi))
{
- apr_array_header_t *these_committables = svn_apr_hash_index_val(hi);
+ apr_array_header_t *these_committables = svn__apr_hash_index_val(hi);
int i;
for (i = 0; i < these_committables->nelts; i++)
@@ -195,19 +195,23 @@ add_lock_token(const char *local_abspath
{
struct add_lock_token_baton *altb = walk_baton;
apr_pool_t *token_pool = apr_hash_pool_get(altb->lock_tokens);
- const svn_wc_entry_t *entry;
-
- SVN_ERR(svn_wc__maybe_get_entry(&entry, altb->wc_ctx, local_abspath,
- svn_node_unknown, FALSE, FALSE,
- scratch_pool, scratch_pool));
+ const char* lock_token;
+ const char* url;
/* I want every lock-token I can get my dirty hands on!
If this entry is switched, so what. We will send an irrelevant lock
token. */
- if (entry && entry->url && entry->lock_token)
- apr_hash_set(altb->lock_tokens, apr_pstrdup(token_pool, entry->url),
+ SVN_ERR(svn_wc__node_get_lock_token(&lock_token, altb->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
+ if (!lock_token)
+ return SVN_NO_ERROR;
+
+ SVN_ERR(svn_wc__node_get_url(&url, altb->wc_ctx, local_abspath,
+ token_pool, scratch_pool));
+ if (url)
+ apr_hash_set(altb->lock_tokens, url,
APR_HASH_KEY_STRING,
- apr_pstrdup(token_pool, entry->lock_token));
+ apr_pstrdup(token_pool, lock_token));
return SVN_NO_ERROR;
}
@@ -253,7 +257,7 @@ bail_on_tree_conflicted_children(svn_wc_
for (hi = apr_hash_first(pool, conflicts); hi; hi = apr_hash_next(hi))
{
const svn_wc_conflict_description_t *conflict =
- svn_apr_hash_index_val(hi);
+ svn__apr_hash_index_val(hi);
if ((conflict->node_kind == svn_node_dir) &&
(depth == svn_depth_files))
@@ -322,15 +326,15 @@ bail_on_tree_conflicted_ancestor(svn_wc_
}
-/* Recursively search for commit candidates in (and under) PATH (with
- entry ENTRY and ancestry URL), and add those candidates to
+/* Recursively search for commit candidates in (and under) LOCAL_ABSPATH
+ (with entry ENTRY and ancestry URL), and add those candidates to
COMMITTABLES. If in ADDS_ONLY modes, only new additions are
recognized. COPYFROM_URL is the default copyfrom-url for children
of copied directories.
- DEPTH indicates how to treat files and subdirectories of PATH when
- PATH is itself a directory; see svn_client__harvest_committables()
- for its behavior.
+ DEPTH indicates how to treat files and subdirectories of LOCAL_ABSPATH
+ when LOCAL_ABSPATH is itself a directory; see
+ svn_client__harvest_committables() for its behavior.
Lock tokens of candidates will be added to LOCK_TOKENS, if
non-NULL. JUST_LOCKED indicates whether to treat non-modified items with
@@ -353,7 +357,7 @@ bail_on_tree_conflicted_ancestor(svn_wc_
static svn_error_t *
harvest_committables(apr_hash_t *committables,
apr_hash_t *lock_tokens,
- const char *path,
+ const char *local_abspath,
const char *url,
const char *copyfrom_url,
const svn_wc_entry_t *entry,
@@ -369,19 +373,17 @@ harvest_committables(apr_hash_t *committ
svn_boolean_t text_mod = FALSE, prop_mod = FALSE;
apr_byte_t state_flags = 0;
svn_node_kind_t kind;
- const char *p_path;
const char *cf_url = NULL;
svn_revnum_t cf_rev = entry->copyfrom_rev;
const svn_string_t *propval;
svn_boolean_t is_special;
apr_pool_t *token_pool = (lock_tokens ? apr_hash_pool_get(lock_tokens)
: NULL);
- const char *local_abspath;
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
/* Early out if the item is already marked as committable. */
- if (look_up_committable(committables, path, scratch_pool))
+ if (look_up_committable(committables, local_abspath, scratch_pool))
return SVN_NO_ERROR;
SVN_ERR_ASSERT(entry);
@@ -390,18 +392,16 @@ harvest_committables(apr_hash_t *committ
if (ctx->cancel_func)
SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
- /* Make P_PATH the parent dir. */
- p_path = svn_dirent_dirname(path, scratch_pool);
-
/* Return error on unknown path kinds. We check both the entry and
the node itself, since a path might have changed kind since its
entry was written. */
if ((entry->kind != svn_node_file) && (entry->kind != svn_node_dir))
return svn_error_createf
(SVN_ERR_NODE_UNKNOWN_KIND, NULL, _("Unknown entry kind for '%s'"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
- SVN_ERR(svn_io_check_special_path(path, &kind, &is_special, scratch_pool));
+ SVN_ERR(svn_io_check_special_path(local_abspath, &kind, &is_special,
+ scratch_pool));
if ((kind != svn_node_file)
&& (kind != svn_node_dir)
@@ -410,7 +410,7 @@ harvest_committables(apr_hash_t *committ
return svn_error_createf
(SVN_ERR_NODE_UNKNOWN_KIND, NULL,
_("Unknown entry kind for '%s'"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
}
/* Verify that the node's type has not changed before attempting to
@@ -427,7 +427,7 @@ harvest_committables(apr_hash_t *committ
return svn_error_createf
(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("Entry '%s' has unexpectedly changed special status"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
}
if (entry->file_external_path && copy_mode)
@@ -466,7 +466,7 @@ harvest_committables(apr_hash_t *committ
return svn_error_createf(
SVN_ERR_WC_FOUND_CONFLICT, NULL,
_("Aborting commit: '%s' remains in conflict"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
}
}
@@ -544,7 +544,7 @@ harvest_committables(apr_hash_t *committ
return svn_error_createf
(SVN_ERR_WC_CORRUPT, NULL,
_("Did not expect '%s' to be a working copy root"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
/* If the ENTRY's revision differs from that of its parent, we
have to explicitly commit ENTRY as a copy. */
@@ -562,7 +562,7 @@ harvest_committables(apr_hash_t *committ
return svn_error_createf
(SVN_ERR_BAD_URL, NULL,
_("Commit item '%s' has copy flag but no copyfrom URL"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
}
}
@@ -575,13 +575,13 @@ harvest_committables(apr_hash_t *committ
/* First of all, the working file or directory must exist.
See issue #3198. */
- SVN_ERR(svn_io_check_path(path, &working_kind, scratch_pool));
+ SVN_ERR(svn_io_check_path(local_abspath, &working_kind, scratch_pool));
if (working_kind == svn_node_none)
{
return svn_error_createf
(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
_("'%s' is scheduled for addition, but is missing"),
- svn_dirent_local_style(path, scratch_pool));
+ svn_dirent_local_style(local_abspath, scratch_pool));
}
/* See if there are property modifications to send. */
@@ -649,7 +649,7 @@ harvest_committables(apr_hash_t *committ
scratch_pool))
{
/* Finally, add the committable item. */
- add_committable(committables, path, entry->kind, url,
+ add_committable(committables, local_abspath, entry->kind, url,
entry->revision,
cf_url,
cf_rev,
@@ -767,9 +767,10 @@ harvest_committables(apr_hash_t *committ
this_entry->schedule == svn_wc_schedule_delete)
continue;
- full_path = svn_dirent_join(path, name, iterpool);
+ full_path = svn_dirent_join(local_abspath, name, iterpool);
if (this_cf_url)
- this_cf_url = svn_path_url_add_component2(this_cf_url, name, iterpool);
+ this_cf_url = svn_path_url_add_component2(this_cf_url, name,
+ iterpool);
/* We'll use the entry's URL if it has one and if we aren't
in copy_mode, else, we'll just extend the parent's URL
@@ -921,8 +922,8 @@ validate_dangler(void *baton,
svn_error_t *
svn_client__harvest_committables(apr_hash_t **committables,
apr_hash_t **lock_tokens,
- svn_wc_adm_access_t *parent_adm,
- apr_array_header_t *targets,
+ const char *dir_abspath,
+ const apr_array_header_t *targets,
svn_depth_t depth,
svn_boolean_t just_locked,
const apr_array_header_t *changelists,
@@ -957,6 +958,8 @@ svn_client__harvest_committables(apr_has
*/
apr_hash_t *danglers = apr_hash_make(pool);
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
+
/* Create the COMMITTABLES hash. */
*committables = apr_hash_make(pool);
@@ -971,7 +974,6 @@ svn_client__harvest_committables(apr_has
do
{
const svn_wc_entry_t *entry;
- const char *target;
const char *target_abspath;
svn_error_t *err;
@@ -981,13 +983,12 @@ svn_client__harvest_committables(apr_has
relative paths, TARGET will just be PARENT_ADM for a single
iteration). */
if (targets->nelts)
- target = svn_dirent_join(svn_wc_adm_access_path(parent_adm),
- APR_ARRAY_IDX(targets, i, const char *),
- subpool);
+ target_abspath = svn_dirent_join(dir_abspath,
+ APR_ARRAY_IDX(targets, i,
+ const char *),
+ subpool);
else
- target = svn_wc_adm_access_path(parent_adm);
-
- SVN_ERR(svn_dirent_get_absolute(&target_abspath, target, subpool));
+ target_abspath = dir_abspath;
/* No entry? This TARGET isn't even under version control! */
err = svn_wc__get_entry_versioned(&entry, ctx->wc_ctx, target_abspath,
@@ -1015,7 +1016,7 @@ svn_client__harvest_committables(apr_has
if (! entry->url)
return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
_("Entry for '%s' has no URL"),
- svn_dirent_local_style(target, pool));
+ svn_dirent_local_style(target_abspath, pool));
/* We have to be especially careful around entries scheduled for
addition or replacement. */
@@ -1034,7 +1035,7 @@ svn_client__harvest_committables(apr_has
return svn_error_createf(
SVN_ERR_WC_CORRUPT, NULL,
_("'%s' is scheduled for addition within unversioned parent"),
- svn_dirent_local_style(target, pool));
+ svn_dirent_local_style(target_abspath, pool));
}
SVN_ERR(err);
@@ -1043,9 +1044,9 @@ svn_client__harvest_committables(apr_has
/* Copy the parent and target into pool; subpool
lasts only for this loop iteration, and we check
danglers after the loop is over. */
- apr_hash_set(danglers, svn_dirent_dirname(target, pool),
+ apr_hash_set(danglers, svn_dirent_dirname(target_abspath, pool),
APR_HASH_KEY_STRING,
- apr_pstrdup(pool, target));
+ apr_pstrdup(pool, target_abspath));
}
}
@@ -1058,7 +1059,7 @@ svn_client__harvest_committables(apr_has
_("Entry for '%s' is marked as 'copied' but is not itself scheduled"
"\nfor addition. Perhaps you're committing a target that is\n"
"inside an unversioned (or not-yet-versioned) directory?"),
- svn_dirent_local_style(target, pool));
+ svn_dirent_local_style(target_abspath, pool));
/* Handle our TARGET. */
/* Make sure this isn't inside a working copy subtree that is
@@ -1070,7 +1071,7 @@ svn_client__harvest_committables(apr_has
target_abspath, subpool)),
subpool));
- SVN_ERR(harvest_committables(*committables, *lock_tokens, target,
+ SVN_ERR(harvest_committables(*committables, *lock_tokens, target_abspath,
entry->url, NULL,
entry, NULL, FALSE, FALSE, depth,
just_locked, changelist_hash,
@@ -1265,7 +1266,6 @@ struct file_mod_t
/* A baton for use with the path-based editor driver */
struct path_driver_cb_baton
{
- svn_wc_adm_access_t *adm_access; /* top-level access baton */
const svn_delta_editor_t *editor; /* commit editor */
void *edit_baton; /* commit editor's baton */
apr_hash_t *file_mods; /* hash: path->file_mod_t */
@@ -1276,7 +1276,12 @@ struct path_driver_cb_baton
};
-/* This implements svn_delta_path_driver_cb_func_t */
+/* This implements svn_delta_path_driver_cb_func_t.
+ * Act on the item of CALLBACK_BATON->commit_items keyed by PATH.
+ * CALLBACK_BATON->commit_items is an input.
+ * If the item is a file with text mods, then add a mapping of "item-url =>
+ * (commit-item, file-baton)" into CALLBACK_BATON->file_mods.
+ * (That is the sole use of CALLBACK_BATON->file_mods.) */
static svn_error_t *
do_item_commit(void **dir_baton,
void *parent_baton,
@@ -1574,11 +1579,11 @@ static svn_error_t *get_test_editor(cons
svn_error_t *
svn_client__do_commit(const char *base_url,
- apr_array_header_t *commit_items,
+ const apr_array_header_t *commit_items,
const svn_delta_editor_t *editor,
void *edit_baton,
const char *notify_path_prefix,
- apr_hash_t **tempfiles,
+ apr_hash_t **new_text_base_abspaths,
apr_hash_t **checksums,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
@@ -1602,8 +1607,8 @@ svn_client__do_commit(const char *base_u
/* If the caller wants us to track temporary file creation, create a
hash to store those paths in. */
- if (tempfiles)
- *tempfiles = apr_hash_make(pool);
+ if (new_text_base_abspaths)
+ *new_text_base_abspaths = apr_hash_make(pool);
/* Ditto for the md5 checksums. */
if (checksums)
@@ -1636,7 +1641,7 @@ svn_client__do_commit(const char *base_u
/* Transmit outstanding text deltas. */
for (hi = apr_hash_first(pool, file_mods); hi; hi = apr_hash_next(hi))
{
- struct file_mod_t *mod = svn_apr_hash_index_val(hi);
+ struct file_mod_t *mod = svn__apr_hash_index_val(hi);
svn_client_commit_item3_t *item;
void *file_baton;
const char *tempfile;
@@ -1668,15 +1673,14 @@ svn_client__do_commit(const char *base_u
if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
fulltext = TRUE;
- SVN_ERR(svn_wc_transmit_text_deltas3(tempfiles ? &tempfile : NULL,
+ SVN_ERR(svn_wc_transmit_text_deltas3(new_text_base_abspaths ? &tempfile
+ : NULL,
digest, ctx->wc_ctx, item_abspath,
fulltext, editor, file_baton,
iterpool, iterpool));
- if (tempfiles && tempfile)
- {
- tempfile = apr_pstrdup(pool, tempfile);
- apr_hash_set(*tempfiles, tempfile, APR_HASH_KEY_STRING, (void *)1);
- }
+ if (new_text_base_abspaths && tempfile)
+ apr_hash_set(*new_text_base_abspaths, item->path, APR_HASH_KEY_STRING,
+ apr_pstrdup(pool, tempfile));
if (checksums)
apr_hash_set(*checksums, item->path, APR_HASH_KEY_STRING,
svn_checksum__from_digest(digest, svn_checksum_md5,