You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ar...@apache.org on 2011/11/21 08:08:07 UTC
svn commit: r1204374 [4/29] - in /subversion/branches/svn-bisect: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/ build/win32/
contrib/client-side/ contrib/client-side/emacs/ notes/ notes/wc-ng/
subversion/bindings/javahl/native/...
Modified: subversion/branches/svn-bisect/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/include/svn_repos.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/include/svn_repos.h (original)
+++ subversion/branches/svn-bisect/subversion/include/svn_repos.h Mon Nov 21 07:07:56 2011
@@ -242,7 +242,10 @@ typedef enum svn_repos_notify_action_t
svn_repos_notify_recover_start,
/** Upgrade has started. */
- svn_repos_notify_upgrade_start
+ svn_repos_notify_upgrade_start,
+
+ /** A revision was skipped during loading. @since New in 1.8. */
+ svn_repos_notify_load_skipped_rev
} svn_repos_notify_action_t;
@@ -300,10 +303,10 @@ typedef struct svn_repos_notify_t
#svn_repos_notify_pack_shard_end_revprop, the shard processed. */
apr_int64_t shard;
- /** For #svn_repos_notify_load_committed_rev, the revision committed. */
+ /** For #svn_repos_notify_load_node_done, the revision committed. */
svn_revnum_t new_revision;
- /** For #svn_repos_notify_load_committed_rev, the source revision, if
+ /** For #svn_repos_notify_load_node_done, the source revision, if
different from @a new_revision, otherwise #SVN_INVALID_REVNUM.
For #svn_repos_notify_load_txn_start, the source revision. */
svn_revnum_t old_revision;
@@ -1628,8 +1631,9 @@ svn_repos_node_location_segments(svn_rep
* filesystem, as limited by @a paths. In the latter case those revisions
* are skipped and @a receiver is not invoked.
*
- * If @a revprops is NULL, retrieve all revprops; else, retrieve only the
- * revprops named in the array (i.e. retrieve none if the array is empty).
+ * If @a revprops is NULL, retrieve all revision properties; else, retrieve
+ * only the revision properties named by the (const char *) array elements
+ * (i.e. retrieve none if the array is empty).
*
* If any invocation of @a receiver returns error, return that error
* immediately and without wrapping it.
@@ -1746,11 +1750,6 @@ svn_repos_get_logs(svn_repos_t *repos,
* @a inherit indicates whether explicit, explicit or inherited, or
* only inherited mergeinfo for @a paths is fetched.
*
- * If the mergeinfo for any path is inherited and
- * @a validate_inherited_mergeinfo is TRUE, then the mergeinfo for
- * that path in @a *catalog will only contain merge source
- * path-revisions that actually exist in repository.
- *
* If @a revision is #SVN_INVALID_REVNUM, it defaults to youngest.
*
* If @a include_descendants is TRUE, then additionally return the
@@ -1767,27 +1766,8 @@ svn_repos_get_logs(svn_repos_t *repos,
*
* Use @a pool for all allocations.
*
- * @since New in 1.7.
- */
-svn_error_t *
-svn_repos_fs_get_mergeinfo2(svn_mergeinfo_catalog_t *catalog,
- svn_repos_t *repos,
- const apr_array_header_t *paths,
- svn_revnum_t revision,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
- svn_boolean_t include_descendants,
- svn_repos_authz_func_t authz_read_func,
- void *authz_read_baton,
- apr_pool_t *pool);
-
-/**
- * Similar to svn_repos_fs_get_mergeinfo2(), but with
- * @a validate_inherited_mergeinfo always passed as FALSE.
- *
- * @deprecated Provided for backward compatibility with the 1.6 API.
+ * @since New in 1.5.
*/
-SVN_DEPRECATED
svn_error_t *
svn_repos_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog,
svn_repos_t *repos,
@@ -2474,7 +2454,7 @@ svn_repos_verify_fs(svn_repos_t *repos,
* revision up through @a end_rev. Use @a pool for all allocation. If
* non-@c NULL, send feedback to @a feedback_stream. If @a dumpstream is
* @c NULL, this is effectively a primitive verify. It is not complete,
- * however; see svn_fs_verify instead.
+ * however; svn_repos_verify_fs2() and svn_fs_verify().
*
* If @a start_rev is #SVN_INVALID_REVNUM, then start dumping at revision
* 0. If @a end_rev is #SVN_INVALID_REVNUM, then dump through the @c HEAD
@@ -2570,6 +2550,13 @@ svn_repos_dump_fs(svn_repos_t *repos,
* If the dumpstream contains no UUID, then @a uuid_action is
* ignored and the repository UUID is not touched.
*
+ * @a start_rev and @a end_rev act as filters, the lower and upper
+ * (inclusive) range values of revisions in @a dumpstream which will
+ * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
+ * which case no revision-based filtering occurs at all), or both are
+ * valid revisions (where @a start_rev is older than or equivalent to
+ * @a end_rev).
+ *
* If @a parent_dir is not NULL, then the parser will reparent all the
* loaded nodes, from root to @a parent_dir. The directory @a parent_dir
* must be an existing directory in the repository.
@@ -2591,8 +2578,38 @@ svn_repos_dump_fs(svn_repos_t *repos,
* @a cancel_baton as argument to see if the client wishes to cancel
* the load.
*
+ * @note If @a start_rev and @a end_rev are valid revisions, this
+ * function presumes the revisions as numbered in @a dumpstream only
+ * increase from the beginning of the stream to the end. Gaps in the
+ * number sequence are ignored, but upon finding a revision number
+ * younger than the specified range, this function may stop loading
+ * new revisions regardless of their number.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_repos_load_fs4(svn_repos_t *repos,
+ svn_stream_t *dumpstream,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t validate_props,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool);
+
+/** Similar to svn_repos_load_fs4(), but with @a start_rev and @a
+ * end_rev always passed as #SVN_INVALID_REVNUM.
+ *
* @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_repos_load_fs3(svn_repos_t *repos,
svn_stream_t *dumpstream,
@@ -2781,6 +2798,13 @@ svn_repos_parse_dumpstream2(svn_stream_t
* UUID records in a manner consistent with @a uuid_action. Use @a pool
* to operate on the fs.
*
+ * @a start_rev and @a end_rev act as filters, the lower and upper
+ * (inclusive) range values of revisions in @a dumpstream which will
+ * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
+ * which case no revision-based filtering occurs at all), or both are
+ * valid revisions (where @a start_rev is older than or equivalent to
+ * @a end_rev).
+ *
* If @a use_history is set, then the parser will require relative
* 'copyfrom' history to exist in the repository when it encounters
* nodes that are added-with-history.
@@ -2793,10 +2817,37 @@ svn_repos_parse_dumpstream2(svn_stream_t
* loaded nodes, from root to @a parent_dir. The directory @a parent_dir
* must be an existing directory in the repository.
*
- * Print all parsing feedback to @a outstream (if non-@c NULL).
+ * @note If @a start_rev and @a end_rev are valid revisions, this
+ * function presumes the revisions as numbered in @a dumpstream only
+ * increase from the beginning of the stream to the end. Gaps in the
+ * number sequence are ignored, but upon finding a revision number
+ * younger than the specified range, this function may stop loading
+ * new revisions regardless of their number.
*
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_repos_get_fs_build_parser4(const svn_repos_parse_fns2_t **parser,
+ void **parse_baton,
+ svn_repos_t *repos,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ svn_boolean_t use_history,
+ svn_boolean_t validate_props,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_repos_get_fs_build_parser4(), but with @a start_rev
+ * and @a end_rev always passed as #SVN_INVALID_REVNUM.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
* @since New in 1.7.
*/
+SVN_DEPRECATED
svn_error_t *
svn_repos_get_fs_build_parser3(const svn_repos_parse_fns2_t **parser,
void **parse_baton,
@@ -2940,6 +2991,9 @@ svn_repos_authz_read(svn_authz_t **authz
* to TRUE if at least one path is accessible with the @a
* required_access.
*
+ * For compatibility with 1.6, and earlier, @a repos_name can be NULL
+ * in which case it is equivalent to a @a repos_name of "".
+ *
* @since New in 1.3.
*/
svn_error_t *
Modified: subversion/branches/svn-bisect/subversion/include/svn_sorts.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/include/svn_sorts.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/include/svn_sorts.h (original)
+++ subversion/branches/svn-bisect/subversion/include/svn_sorts.h Mon Nov 21 07:07:56 2011
@@ -145,7 +145,7 @@ svn_sort_compare_ranges(const void *a,
/** Sort @a ht according to its keys, return an @c apr_array_header_t
* containing @c svn_sort__item_t structures holding those keys and values
* (i.e. for each @c svn_sort__item_t @a item in the returned array,
- * @a item->key and @a item->size are the hash key, and @a item->data points to
+ * @a item->key and @a item->size are the hash key, and @a item->value points to
* the hash value).
*
* Storage is shared with the original hash, not copied.
@@ -164,24 +164,43 @@ svn_sort__hash(apr_hash_t *ht,
const svn_sort__item_t *),
apr_pool_t *pool);
-/* Return the lowest index at which the element *KEY should be inserted into
- the array ARRAY, according to the ordering defined by COMPARE_FUNC.
- The array must already be sorted in the ordering defined by COMPARE_FUNC.
- COMPARE_FUNC is defined as for the C stdlib function bsearch(). */
+/* Return the lowest index at which the element @a *key should be inserted into
+ * the array @a array, according to the ordering defined by @a compare_func.
+ * The array must already be sorted in the ordering defined by @a compare_func.
+ * @a compare_func is defined as for the C stdlib function bsearch().
+ *
+ * @note Private. For use by Subversion's own code only.
+ */
int
svn_sort__bsearch_lower_bound(const void *key,
const apr_array_header_t *array,
int (*compare_func)(const void *, const void *));
-/* Insert a shallow copy of *NEW_ELEMENT into the array ARRAY at the index
- INSERT_INDEX, growing the array and shuffling existing elements along to
- make room. */
+/* Insert a shallow copy of @a *new_element into the array @a array at the index
+ * @a insert_index, growing the array and shuffling existing elements along to
+ * make room.
+ *
+ * @note Private. For use by Subversion's own code only.
+ */
void
svn_sort__array_insert(const void *new_element,
apr_array_header_t *array,
int insert_index);
+/* Remove @a elements_to_delete elements starting at @a delete_index from the
+ * array @a arr. If @a delete_index is not a valid element of @a arr,
+ * @a elements_to_delete is not greater than zero, or
+ * @a delete_index + @a elements_to_delete is greater than @a arr->nelts,
+ * then do nothing.
+ *
+ * @note Private. For use by Subversion's own code only.
+ */
+void
+svn_sort__array_delete(apr_array_header_t *arr,
+ int delete_index,
+ int elements_to_delete);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/svn-bisect/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/include/svn_string.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/include/svn_string.h (original)
+++ subversion/branches/svn-bisect/subversion/include/svn_string.h Mon Nov 21 07:07:56 2011
@@ -129,6 +129,12 @@ typedef struct svn_stringbuf_t
svn_string_t *
svn_string_create(const char *cstring, apr_pool_t *pool);
+/** Create a truely empty string object (length is 0)
+ * @since New in 1.8.
+ */
+svn_string_t *
+svn_string_create_empty(apr_pool_t *pool);
+
/** Create a new bytestring containing a generic string of bytes
* (NOT NULL-terminated) */
svn_string_t *
@@ -194,6 +200,12 @@ svn_stringbuf_create(const char *cstring
svn_stringbuf_t *
svn_stringbuf_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool);
+/** Create a truely empty string object (length and blocksize are 0)
+ * @since New in 1.8.
+ */
+svn_stringbuf_t *
+svn_stringbuf_create_empty(apr_pool_t *pool);
+
/** Create a new empty bytestring with at least @a minimum_size bytes of
* space available in the memory block.
*
Modified: subversion/branches/svn-bisect/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/include/svn_types.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/include/svn_types.h (original)
+++ subversion/branches/svn-bisect/subversion/include/svn_types.h Mon Nov 21 07:07:56 2011
@@ -81,6 +81,22 @@ extern "C" {
# endif
#endif
+
+
+/** YABT: Yet Another Boolean Type */
+typedef int svn_boolean_t;
+
+#ifndef TRUE
+/** uhh... true */
+#define TRUE 1
+#endif /* TRUE */
+
+#ifndef FALSE
+/** uhh... false */
+#define FALSE 0
+#endif /* FALSE */
+
+
/** Subversion error object.
*
@@ -131,9 +147,13 @@ typedef struct svn_error_t
} svn_error_t;
+
+
/* See svn_version.h.
Defined here to avoid including svn_version.h from all public headers. */
typedef struct svn_version_t svn_version_t;
+
+
/** @defgroup APR_ARRAY_compat_macros APR Array Compatibility Helper Macros
* These macros are provided by APR itself from version 1.3.
@@ -152,6 +172,8 @@ typedef struct svn_version_t svn_version
#endif
/** @} */
+
+
/** @defgroup apr_hash_utilities APR Hash Table Helpers
* These functions enable the caller to dereference an APR hash table index
@@ -173,6 +195,10 @@ svn__apr_hash_index_klen(const apr_hash_
void *
svn__apr_hash_index_val(const apr_hash_index_t *hi);
+/** @} */
+
+
+
/** On Windows, APR_STATUS_IS_ENOTDIR includes several kinds of
* invalid-pathname error but not ERROR_INVALID_NAME, so we include it.
* We also include ERROR_DIRECTORY as that was not included in apr versions
@@ -187,8 +213,36 @@ svn__apr_hash_index_val(const apr_hash_i
#endif
/** @} */
+
+
-/** The various types of nodes in the Subversion filesystem. */
+/** A node kind.
+ *
+ * @since New in 1.8. Replaces svn_node_kind_t.
+ */
+typedef enum svn_kind_t
+{
+ /** something's here, but we don't know what */
+ svn_kind_unknown,
+
+ /** absent */
+ svn_kind_none,
+
+ /** regular file */
+ svn_kind_file,
+
+ /** directory */
+ svn_kind_dir,
+
+ /** symbolic link */
+ svn_kind_symlink
+
+} svn_kind_t;
+
+/** The various types of nodes in the Subversion filesystem.
+ *
+ * This type is superseded by #svn_kind_t and will be deprecated when
+ * transition to the new type is complete. */
typedef enum svn_node_kind_t
{
/** absent */
@@ -223,6 +277,25 @@ svn_node_kind_to_word(svn_node_kind_t ki
svn_node_kind_t
svn_node_kind_from_word(const char *word);
+/** Return the #svn_node_kind_t corresponding to the given #svn_kind_t;
+ * #svn_kind_symlink will become #svn_node_file.
+ *
+ * @since New in 1.8.
+ */
+svn_node_kind_t
+svn__node_kind_from_kind(svn_kind_t kind);
+
+/** Return the #svn_kind_t corresponding to the given #svn_node_kind_t,
+ * or #svn_kind_symlink if @a is_symlink is true.
+ *
+ * @since New in 1.8.
+ */
+svn_kind_t
+svn__kind_from_node_kind(svn_node_kind_t kind,
+ svn_boolean_t is_symlink);
+
+
+
/** Generic three-state property to represent an unknown value for values
* that are just like booleans. The values have been set deliberately to
* make tristates disjoint from #svn_boolean_t.
@@ -256,6 +329,7 @@ svn_tristate_t
svn_tristate__from_word(const char * word);
+
/** About Special Files in Subversion
*
* Subversion denotes files that cannot be portably created or
@@ -293,6 +367,8 @@ svn_tristate__from_word(const char * wor
* routines from 1.
*/
+
+
/** A revision number. */
typedef long int svn_revnum_t;
@@ -339,6 +415,7 @@ svn_revnum_parse(svn_revnum_t *rev,
#define SVN_REVNUM_T_FMT "ld"
+
/** The size of a file in the Subversion FS. */
typedef apr_int64_t svn_filesize_t;
@@ -356,20 +433,7 @@ typedef apr_int64_t svn_filesize_t;
#endif
-/** YABT: Yet Another Boolean Type */
-typedef int svn_boolean_t;
-
-#ifndef TRUE
-/** uhh... true */
-#define TRUE 1
-#endif /* TRUE */
-
-#ifndef FALSE
-/** uhh... false */
-#define FALSE 0
-#endif /* FALSE */
-
-
+
/** An enum to indicate whether recursion is needed. */
enum svn_recurse_kind
{
@@ -427,7 +491,6 @@ typedef enum svn_depth_t
} svn_depth_t;
-
/** Return a constant string expressing @a depth as an English word,
* e.g., "infinity", "immediates", etc. The string is not localized,
* as it may be used for client<->server communications.
@@ -437,7 +500,6 @@ typedef enum svn_depth_t
const char *
svn_depth_to_word(svn_depth_t depth);
-
/** Return the appropriate depth for @a depth_str. @a word is as
* returned from svn_depth_to_word(). If @a depth_str does not
* represent a recognized depth, return #svn_depth_unknown.
@@ -447,7 +509,6 @@ svn_depth_to_word(svn_depth_t depth);
svn_depth_t
svn_depth_from_word(const char *word);
-
/* Return #svn_depth_infinity if boolean @a recurse is TRUE, else
* return #svn_depth_files.
*
@@ -459,7 +520,6 @@ svn_depth_from_word(const char *word);
#define SVN_DEPTH_INFINITY_OR_FILES(recurse) \
((recurse) ? svn_depth_infinity : svn_depth_files)
-
/* Return #svn_depth_infinity if boolean @a recurse is TRUE, else
* return #svn_depth_immediates.
*
@@ -471,7 +531,6 @@ svn_depth_from_word(const char *word);
#define SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse) \
((recurse) ? svn_depth_infinity : svn_depth_immediates)
-
/* Return #svn_depth_infinity if boolean @a recurse is TRUE, else
* return #svn_depth_empty.
*
@@ -483,7 +542,6 @@ svn_depth_from_word(const char *word);
#define SVN_DEPTH_INFINITY_OR_EMPTY(recurse) \
((recurse) ? svn_depth_infinity : svn_depth_empty)
-
/* Return a recursion boolean based on @a depth.
*
* Although much code has been converted to use depth, some code still
@@ -496,6 +554,7 @@ svn_depth_from_word(const char *word);
? TRUE : FALSE)
+
/**
* It is sometimes convenient to indicate which parts of an #svn_dirent_t
* object you are actually interested in, so that calculating and sending
@@ -553,7 +612,6 @@ typedef struct svn_dirent_t
/* IMPORTANT: If you extend this struct, check svn_dirent_dup(). */
} svn_dirent_t;
-
/** Return a deep copy of @a dirent, allocated in @a pool.
*
* @since New in 1.4.
@@ -562,8 +620,8 @@ svn_dirent_t *
svn_dirent_dup(const svn_dirent_t *dirent,
apr_pool_t *pool);
-
+
/** Keyword substitution.
*
* All the keywords Subversion recognizes.
@@ -640,6 +698,7 @@ svn_dirent_dup(const svn_dirent_t *diren
/** @} */
+
/** All information about a commit.
*
@@ -668,7 +727,6 @@ typedef struct svn_commit_info_t
} svn_commit_info_t;
-
/**
* Allocate an object of type #svn_commit_info_t in @a pool and
* return it.
@@ -686,7 +744,6 @@ typedef struct svn_commit_info_t
svn_commit_info_t *
svn_create_commit_info(apr_pool_t *pool);
-
/**
* Return a deep copy @a src_commit_info allocated in @a pool.
*
@@ -696,6 +753,7 @@ svn_commit_info_t *
svn_commit_info_dup(const svn_commit_info_t *src_commit_info,
apr_pool_t *pool);
+
/**
* A structure to represent a path that changed for a log entry.
@@ -757,7 +815,7 @@ svn_log_changed_path2_dup(const svn_log_
/**
* A structure to represent a path that changed for a log entry. Same as
- * #svn_log_changed_path2_t, but without the node kind.
+ * the first three fields of #svn_log_changed_path2_t.
*
* @deprecated Provided for backward compatibility with the 1.5 API.
*/
@@ -774,7 +832,6 @@ typedef struct svn_log_changed_path_t
} svn_log_changed_path_t;
-
/**
* Return a deep copy of @a changed_path, allocated in @a pool.
*
@@ -810,7 +867,8 @@ typedef struct svn_log_entry_t
svn_revnum_t revision;
/** The hash of requested revision properties, which may be NULL if it
- * would contain no revprops. */
+ * would contain no revprops. Maps (const char *) property name to
+ * (svn_string_t *) property value. */
apr_hash_t *revprops;
/**
@@ -923,7 +981,6 @@ svn_log_entry_dup(const svn_log_entry_t
*
* @since New in 1.5.
*/
-
typedef svn_error_t *(*svn_log_entry_receiver_t)(
void *baton,
svn_log_entry_t *log_entry,
@@ -944,6 +1001,7 @@ typedef svn_error_t *(*svn_log_message_r
const char *message,
apr_pool_t *pool);
+
/** Callback function type for commits.
*
@@ -969,6 +1027,7 @@ typedef svn_error_t *(*svn_commit_callba
const char *author,
void *baton);
+
/** A buffer size that may be used when processing a stream of data.
*
@@ -1021,7 +1080,6 @@ svn_error_t *
svn_mime_type_validate(const char *mime_type,
apr_pool_t *pool);
-
/** Return FALSE iff @a mime_type is a textual type.
*
* All mime types that start with "text/" are textual, plus some special
@@ -1092,6 +1150,8 @@ svn_lock_create(apr_pool_t *pool);
svn_lock_t *
svn_lock_dup(const svn_lock_t *lock, apr_pool_t *pool);
+
+
/**
* Return a formatted Universal Unique IDentifier (UUID) string.
*
@@ -1100,6 +1160,8 @@ svn_lock_dup(const svn_lock_t *lock, apr
const char *
svn_uuid_generate(apr_pool_t *pool);
+
+
/**
* Mergeinfo representing a merge of a range of revisions.
*
@@ -1165,7 +1227,6 @@ typedef struct svn_location_segment_t
} svn_location_segment_t;
-
/**
* A callback invoked by generators of #svn_location_segment_t
* objects, used to report information about a versioned object's
@@ -1177,7 +1238,6 @@ typedef svn_error_t *(*svn_location_segm
void *baton,
apr_pool_t *pool);
-
/**
* Return a deep copy of @a segment, allocated in @a pool.
*
@@ -1189,6 +1249,8 @@ svn_location_segment_dup(const svn_locat
/** @} */
+
+
/** A line number, such as in a file or a stream.
*
* @since New in 1.7.
@@ -1202,6 +1264,7 @@ typedef unsigned long svn_linenum_t;
#define SVN_LINENUM_MAX_VALUE ULONG_MAX
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/svn-bisect/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/include/svn_wc.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/include/svn_wc.h (original)
+++ subversion/branches/svn-bisect/subversion/include/svn_wc.h Mon Nov 21 07:07:56 2011
@@ -781,7 +781,7 @@ svn_wc_traversed_depths(apr_hash_t **dep
* canonicalized.
*
* In order to avoid backwards compatibility problems clients should use
- * svn_wc_external_item_create() to allocate and initialize this structure
+ * svn_wc_external_item2_create() to allocate and initialize this structure
* instead of doing so themselves.
*
* @since New in 1.5.
@@ -822,8 +822,20 @@ typedef struct svn_wc_external_item2_t
* The current implementation never returns error, but callers should
* still check for error, for compatibility with future versions.
*
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc_external_item2_create(svn_wc_external_item2_t **item,
+ apr_pool_t *pool);
+
+/* Same as svn_wc_external_item2_create() except the pointer to the new
+ * empty item is 'const' which is stupid since the next thing you need to do
+ * is fill in its fields.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
* @since New in 1.5.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_external_item_create(const svn_wc_external_item2_t **item,
apr_pool_t *pool);
@@ -1207,7 +1219,7 @@ typedef enum svn_wc_notify_action_t
/** The operation skipped the path because it was conflicted.
* @since New in 1.7. */
- svn_wc_notify_skip_conflicted,
+ svn_wc_notify_skip_conflicted
} svn_wc_notify_action_t;
@@ -1271,7 +1283,7 @@ typedef enum svn_wc_notify_lock_state_t
* @c kind, @c content_state, @c prop_state and @c lock_state are from
* after @c action, not before.
*
- * @note If @c action is #svn_wc_notify_update (### what?), then @c path has
+ * @note If @c action is #svn_wc_notify_update_completed, then @c path has
* already been installed, so it is legitimate for an implementation of
* #svn_wc_notify_func2_t to examine @c path in the working copy.
*
@@ -1295,7 +1307,7 @@ typedef struct svn_wc_notify_t {
/** Path, either absolute or relative to the current working directory
* (i.e., not relative to an anchor). @c path is "." or another valid path
- * value for compatibility reasons when the real target is an url that
+ * value for compatibility reasons when the real target is a url that
* is available in @c url. */
const char *path;
@@ -1551,7 +1563,13 @@ typedef enum svn_wc_conflict_reason_t
/** Object is already added or schedule-add. @since New in 1.6. */
svn_wc_conflict_reason_added,
/** Object is already replaced. @since New in 1.7. */
- svn_wc_conflict_reason_replaced
+ svn_wc_conflict_reason_replaced,
+ /** Object is moved away. @since New in 1.8. */
+ svn_wc_conflict_reason_moved_away,
+ /** Object is moved away and was edited post-move. @since New in 1.8. */
+ svn_wc_conflict_reason_moved_away_and_edited,
+ /** Object is moved here. @since New in 1.8. */
+ svn_wc_conflict_reason_moved_here
} svn_wc_conflict_reason_t;
@@ -2056,7 +2074,7 @@ svn_wc_create_conflict_result(svn_wc_con
*
* The values #svn_wc_conflict_choose_mine_conflict and
* #svn_wc_conflict_choose_theirs_conflict are not legal for conflicts
- * in binary files or properties.
+ * in binary files or binary properties.
*
* Implementations of this callback are free to present the conflict
* using any user interface. This may include simple contextual
@@ -3039,12 +3057,25 @@ svn_wc_entry_dup(const svn_wc_entry_t *e
*/
typedef struct svn_wc_info_t
{
- /* ### Do we still need schedule? */
+ /** The schedule of this item
+ * ### Do we still need schedule? */
svn_wc_schedule_t schedule;
+
+ /** If copied, the URL from which the copy was made, else @c NULL. */
const char *copyfrom_url;
+
+ /** If copied, the revision from which the copy was made,
+ * else #SVN_INVALID_REVNUM. */
svn_revnum_t copyfrom_rev;
+
+ /** The checksum of the node, if it is a file. */
const svn_checksum_t *checksum;
+
+ /** A changelist the item is in, @c NULL if this node is not in a
+ * changelist. */
const char *changelist;
+
+ /** The depth of the item, see #svn_depth_t */
svn_depth_t depth;
/**
@@ -3618,17 +3649,41 @@ typedef struct svn_wc_status3_t
/** @} */
/** Set to the local absolute path that this node was moved from, if this
- * file or directory has been moved here locally. */
+ * file or directory has been moved here locally and is the root of that
+ * move. Otherwise set to NULL.
+ *
+ * This will be NULL for moved-here nodes that are just part of a subtree
+ * that was moved along (and are not themselves a root of a different move
+ * operation).
+ *
+ * @since New in 1.8. */
const char *moved_from_abspath;
/** Set to the local absolute path that this node was moved to, if this file
- * or directory has been moved away locally. */
+ * or directory has been moved away locally and corresponds to the root
+ * of the destination side of the move. Otherwise set to NULL.
+ *
+ * Note: Saying just "root" here could be misleading. For example:
+ * svn mv A AA;
+ * svn mv AA/B BB;
+ * creates a situation where A/B is moved-to BB, but one could argue that
+ * the move source's root actually was AA/B. Note that, as far as the
+ * working copy is concerned, above case is exactly identical to:
+ * svn mv A/B BB;
+ * svn mv A AA;
+ * In both situations, @a moved_to_abspath would be set for nodes A (moved
+ * to AA) and A/B (moved to BB), only.
+ *
+ * This will be NULL for moved-away nodes that were just part of a subtree
+ * that was moved along (and are not themselves a root of a different move
+ * operation).
+ *
+ * @since New in 1.8. */
const char *moved_to_abspath;
- /* If this file or directory has been moved away locally, set this to the
- * local absolute path that was the root of the move-away, i.e. to the
- * op-root of the delete-half of the move operation. */
- const char *moved_to_op_root_abspath;
+ /* TRUE iff the item is a file brought in by an svn:externals definition.
+ * @since New in 1.8. */
+ svn_boolean_t file_external;
/* NOTE! Please update svn_wc_dup_status3() when adding new fields here. */
} svn_wc_status3_t;
@@ -6510,7 +6565,8 @@ typedef enum svn_wc_merge_outcome_t
* control, then set @a *merge_outcome to #svn_wc_merge_no_merge and
* return success without merging anything. (The reasoning is that if
* the file is not versioned, then it is probably unrelated to the
- * changes being considered, so they should not be merged into it.)
+ * changes being considered, so they should not be merged into it.
+ * Furtheremore, merging into an unversioned file is a lossy operation.)
*
* @a dry_run determines whether the working copy is modified. When it
* is @c FALSE the merge will cause @a target_abspath to be modified, when
@@ -6957,7 +7013,7 @@ typedef svn_error_t *(*svn_wc_relocation
* the @a root argument.
*
* If @a root is TRUE, then the implementation should make sure that @a url
- * is the repository root. Else, it can be an URL inside the repository.
+ * is the repository root. Else, it can be a URL inside the repository.
*
* @deprecated Provided for backwards compatibility with the 1.4 API.
*/
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/add.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/add.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/add.c Mon Nov 21 07:07:56 2011
@@ -293,7 +293,7 @@ svn_client__get_auto_props(apr_hash_t **
if (executable)
apr_hash_set(autoprops.properties, SVN_PROP_EXECUTABLE,
strlen(SVN_PROP_EXECUTABLE),
- svn_string_create("", pool));
+ svn_string_create_empty(pool));
}
*mimetype = autoprops.mimetype;
@@ -494,31 +494,27 @@ add_dir_recursive(const char *dir_abspat
}
-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;
-
- /* Absolute path to the first existing parent directory of local_abspath.
- * If not NULL, all missing parents of local_abspath must be created
- * before local_abspath can be added. */
- const char *existing_parent_abspath;
-};
-
-/* The main logic of the public svn_client_add4. */
+/* The main logic of the public svn_client_add4.
+ *
+ * EXISTING_PARENT_ABSPATH is the absolute path to the first existing
+ * parent directory of local_abspath. If not NULL, all missing parents
+ * of LOCAL_ABSPATH must be created before LOCAL_ABSPATH can be added. */
static svn_error_t *
-add(void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
+add(const char *local_abspath,
+ svn_depth_t depth,
+ svn_boolean_t force,
+ svn_boolean_t no_ignore,
+ const char *existing_parent_abspath,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
{
svn_node_kind_t kind;
svn_error_t *err;
- struct add_with_write_lock_baton *b = baton;
svn_magic__cookie_t *magic_cookie;
svn_magic__init(&magic_cookie, scratch_pool);
- if (b->existing_parent_abspath)
+ if (existing_parent_abspath)
{
const char *parent_abspath;
const char *child_relpath;
@@ -526,9 +522,9 @@ add(void *baton, apr_pool_t *result_pool
int i;
apr_pool_t *iterpool;
- parent_abspath = b->existing_parent_abspath;
- child_relpath = svn_dirent_is_child(b->existing_parent_abspath,
- b->local_abspath, NULL);
+ parent_abspath = existing_parent_abspath;
+ child_relpath = svn_dirent_is_child(existing_parent_abspath,
+ local_abspath, NULL);
components = svn_path_decompose(child_relpath, scratch_pool);
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < components->nelts - 1; i++)
@@ -538,8 +534,8 @@ add(void *baton, apr_pool_t *result_pool
svn_pool_clear(iterpool);
- if (b->ctx->cancel_func)
- SVN_ERR(b->ctx->cancel_func(b->ctx->cancel_baton));
+ if (ctx->cancel_func)
+ SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
component = APR_ARRAY_IDX(components, i, const char *);
parent_abspath = svn_dirent_join(parent_abspath, component,
@@ -548,29 +544,27 @@ add(void *baton, apr_pool_t *result_pool
if (disk_kind != svn_node_none && disk_kind != svn_node_dir)
return svn_error_createf(SVN_ERR_CLIENT_NO_VERSIONED_PARENT, NULL,
_("'%s' prevents creating parent of '%s'"),
- parent_abspath, b->local_abspath);
+ parent_abspath, local_abspath);
SVN_ERR(svn_io_make_dir_recursively(parent_abspath, scratch_pool));
- SVN_ERR(svn_wc_add_from_disk(b->ctx->wc_ctx, parent_abspath,
- b->ctx->notify_func2,
- b->ctx->notify_baton2,
+ SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, parent_abspath,
+ ctx->notify_func2, ctx->notify_baton2,
scratch_pool));
}
svn_pool_destroy(iterpool);
}
- SVN_ERR(svn_io_check_path(b->local_abspath, &kind, scratch_pool));
+ SVN_ERR(svn_io_check_path(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(b->local_abspath, b->depth,
- b->force, b->no_ignore, magic_cookie, b->ctx,
- scratch_pool);
+ err = add_dir_recursive(local_abspath, depth, force, no_ignore,
+ magic_cookie, ctx, scratch_pool);
}
else if (kind == svn_node_file)
- err = add_file(b->local_abspath, magic_cookie, b->ctx, scratch_pool);
+ err = add_file(local_abspath, magic_cookie, ctx, scratch_pool);
else if (kind == svn_node_none)
{
svn_boolean_t tree_conflicted;
@@ -578,7 +572,7 @@ add(void *baton, apr_pool_t *result_pool
/* Provide a meaningful error message if the node does not exist
* on disk but is a tree conflict victim. */
err = svn_wc_conflicted_p3(NULL, NULL, &tree_conflicted,
- b->ctx->wc_ctx, b->local_abspath,
+ ctx->wc_ctx, local_abspath,
scratch_pool);
if (err)
svn_error_clear(err);
@@ -587,22 +581,22 @@ add(void *baton, apr_pool_t *result_pool
_("'%s' is an existing item in conflict; "
"please mark the conflict as resolved "
"before adding a new item here"),
- svn_dirent_local_style(b->local_abspath,
+ svn_dirent_local_style(local_abspath,
scratch_pool));
return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
_("'%s' not found"),
- svn_dirent_local_style(b->local_abspath,
+ svn_dirent_local_style(local_abspath,
scratch_pool));
}
else
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Unsupported node kind for path '%s'"),
- svn_dirent_local_style(b->local_abspath,
+ svn_dirent_local_style(local_abspath,
scratch_pool));
/* Ignore SVN_ERR_ENTRY_EXISTS when FORCE is set. */
- if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && b->force)
+ if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)
{
svn_error_clear(err);
err = SVN_NO_ERROR;
@@ -621,16 +615,24 @@ find_existing_parent(const char **existi
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- int format;
+ svn_node_kind_t kind;
const char *parent_abspath;
svn_wc_context_t *wc_ctx = ctx->wc_ctx;
- SVN_ERR(svn_wc_check_wc2(&format, wc_ctx, local_abspath, scratch_pool));
+ SVN_ERR(svn_wc_read_kind(&kind, wc_ctx, local_abspath, FALSE, scratch_pool));
- if (format > 0)
+ if (kind == svn_node_dir)
{
- *existing_parent_abspath = apr_pstrdup(result_pool, local_abspath);
- return SVN_NO_ERROR;
+ svn_boolean_t is_deleted;
+
+ SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted,
+ wc_ctx, local_abspath,
+ scratch_pool));
+ if (!is_deleted)
+ {
+ *existing_parent_abspath = apr_pstrdup(result_pool, local_abspath);
+ return SVN_NO_ERROR;
+ }
}
if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
@@ -667,7 +669,7 @@ svn_client_add4(const char *path,
{
const char *parent_abspath;
const char *local_abspath;
- struct add_with_write_lock_baton baton;
+ const char *existing_parent_abspath;
if (svn_path_is_url(path))
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
@@ -687,30 +689,26 @@ svn_client_add4(const char *path,
else
parent_abspath = svn_dirent_dirname(local_abspath, pool);
- baton.existing_parent_abspath = NULL;
+ existing_parent_abspath = NULL;
if (add_parents)
{
apr_pool_t *subpool;
- const char *existing_parent_abspath;
+ const char *existing_parent_abspath2;
subpool = svn_pool_create(pool);
- SVN_ERR(find_existing_parent(&existing_parent_abspath, ctx,
+ SVN_ERR(find_existing_parent(&existing_parent_abspath2, ctx,
parent_abspath, pool, subpool));
- if (strcmp(existing_parent_abspath, parent_abspath) != 0)
- baton.existing_parent_abspath = existing_parent_abspath;
+ if (strcmp(existing_parent_abspath2, parent_abspath) != 0)
+ existing_parent_abspath = existing_parent_abspath2;
svn_pool_destroy(subpool);
}
- 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,
- baton.existing_parent_abspath
- ? baton.existing_parent_abspath
- : parent_abspath,
- FALSE, pool, pool));
+ SVN_WC__CALL_WITH_WRITE_LOCK(
+ add(local_abspath, depth, force, no_ignore, existing_parent_abspath,
+ ctx, pool),
+ ctx->wc_ctx,
+ existing_parent_abspath ? existing_parent_abspath : parent_abspath,
+ FALSE /* lock_anchor */, pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/blame.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/blame.c Mon Nov 21 07:07:56 2011
@@ -592,7 +592,6 @@ svn_client_blame5(const char *target,
{
struct file_rev_baton frb;
svn_ra_session_t *ra_session;
- const char *url;
svn_revnum_t start_revnum, end_revnum;
struct blame *walk, *walk_merged = NULL;
apr_pool_t *iterpool;
@@ -611,9 +610,8 @@ svn_client_blame5(const char *target,
SVN_ERR(svn_dirent_get_absolute(&target_abspath_or_url, target, pool));
/* Get an RA plugin for this filesystem object. */
- SVN_ERR(svn_client__ra_session_from_path(&ra_session, &end_revnum,
- &url, target, NULL,
- peg_revision, end,
+ SVN_ERR(svn_client__ra_session_from_path(&ra_session, &end_revnum, NULL,
+ target, NULL, peg_revision, end,
ctx, pool));
SVN_ERR(svn_client__get_revision_number(&start_revnum, NULL, ctx->wc_ctx,
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/cat.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/cat.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/cat.c Mon Nov 21 07:07:56 2011
@@ -50,6 +50,7 @@ svn_client__get_normalized_stream(svn_st
const char *local_abspath,
const svn_opt_revision_t *revision,
svn_boolean_t expand_keywords,
+ svn_boolean_t normalize_eols,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool,
@@ -163,8 +164,10 @@ svn_client__get_normalized_stream(svn_st
/* Wrap the output stream if translation is needed. */
if (eol != NULL || kw != NULL)
- input = svn_subst_stream_translated(input, eol, FALSE, kw, expand_keywords,
- result_pool);
+ input = svn_subst_stream_translated(
+ input,
+ (eol_style && normalize_eols) ? SVN_SUBST_NATIVE_EOL_STR : eol,
+ FALSE, kw, expand_keywords, result_pool);
*normal_stream = input;
@@ -211,7 +214,7 @@ svn_client_cat2(svn_stream_t *out,
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url, pool));
SVN_ERR(svn_client__get_normalized_stream(&normal_stream, ctx->wc_ctx,
- local_abspath, revision, TRUE,
+ local_abspath, revision, TRUE, FALSE,
ctx->cancel_func, ctx->cancel_baton,
pool, pool));
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/cleanup.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/cleanup.c Mon Nov 21 07:07:56 2011
@@ -88,7 +88,7 @@ fetch_repos_info(const char **repos_root
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))
+ if (ri->last_repos && svn_uri__is_ancestor(ri->last_repos, url))
{
*repos_root = apr_pstrdup(result_pool, ri->last_repos);
*repos_uuid = apr_pstrdup(result_pool, ri->last_uuid);
@@ -120,6 +120,7 @@ svn_client_upgrade(const char *path,
apr_hash_t *externals;
apr_hash_index_t *hi;
apr_pool_t *iterpool;
+ apr_pool_t *iterpool2;
svn_opt_revision_t rev = {svn_opt_revision_unspecified, {0}};
struct repos_info_baton info_baton;
@@ -148,62 +149,220 @@ svn_client_upgrade(const char *path,
scratch_pool, scratch_pool));
iterpool = svn_pool_create(scratch_pool);
+ iterpool2 = 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_abspath;
+ const char *externals_parent_url;
+ const char *externals_parent_repos_root_url;
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_error_t *err;
svn_pool_clear(iterpool);
externals_p = apr_array_make(iterpool, 1,
sizeof(svn_wc_external_item2_t*));
- SVN_ERR(svn_wc_parse_externals_description3(
+ /* In this loop, an error causes the respective externals definition, or
+ * the external (inner loop), to be skipped, so that upgrade carries on
+ * with the other externals. */
+
+ err = svn_dirent_get_absolute(&externals_parent_abspath,
+ externals_parent, iterpool);
+
+ if (!err)
+ err = svn_wc__node_get_url(&externals_parent_url, ctx->wc_ctx,
+ externals_parent_abspath,
+ iterpool, iterpool);
+ if (!err)
+ err = svn_wc__node_get_repos_info(&externals_parent_repos_root_url,
+ NULL,
+ ctx->wc_ctx,
+ externals_parent_abspath,
+ iterpool, iterpool);
+ if (!err)
+ err = svn_wc_parse_externals_description3(
&externals_p, svn_dirent_dirname(path, iterpool),
- external_desc->data, TRUE, iterpool));
+ external_desc->data, FALSE, iterpool);
+ if (err)
+ {
+ svn_wc_notify_t *notify =
+ svn_wc_create_notify(externals_parent,
+ svn_wc_notify_failed_external,
+ scratch_pool);
+ notify->err = err;
+
+ ctx->notify_func2(ctx->notify_baton2,
+ notify, scratch_pool);
+
+ svn_error_clear(err);
+
+ /* Next externals definition, please... */
+ continue;
+ }
+
for (i = 0; i < externals_p->nelts; i++)
{
svn_wc_external_item2_t *item;
+ const char *resolved_url;
const char *external_abspath;
- const char *external_path;
- svn_node_kind_t kind;
- svn_error_t *err;
+ const char *repos_relpath;
+ const char *repos_root_url;
+ const char *repos_uuid;
+ svn_node_kind_t external_kind;
+ svn_revnum_t peg_revision;
+ svn_revnum_t revision;
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));
+ svn_pool_clear(iterpool2);
+ external_abspath = svn_dirent_join(externals_parent_abspath,
+ item->target_dir,
+ iterpool2);
+
+ err = svn_wc__resolve_relative_external_url(
+ &resolved_url,
+ item,
+ externals_parent_repos_root_url,
+ externals_parent_url,
+ scratch_pool, scratch_pool);
+ if (err)
+ goto handle_error;
+
+ /* This is a hack. We only need to call svn_wc_upgrade() on external
+ * dirs, as file externals are upgraded along with their defining
+ * WC. Reading the kind will throw an exception on an external dir,
+ * saying that the wc must be upgraded. If it's a file, the lookup
+ * is done in an adm_dir belonging to the defining wc (which has
+ * already been upgraded) and no error is returned. If it doesn't
+ * exist (external that isn't checked out yet), we'll just get
+ * svn_node_none. */
+ err = svn_wc_read_kind(&external_kind, ctx->wc_ctx,
+ external_abspath, FALSE, iterpool2);
+ if (err && err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
+ {
+ svn_error_clear(err);
- /* 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_read_kind(&kind, ctx->wc_ctx, external_abspath, FALSE,
- iterpool);
+ err = svn_client_upgrade(external_abspath, ctx, iterpool2);
+ if (err)
+ goto handle_error;
+ }
+ else if (err)
+ goto handle_error;
- if (err && err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
+ /* The upgrade of any dir should be done now, get the now reliable
+ * kind. */
+ err = svn_wc_read_kind(&external_kind, ctx->wc_ctx, external_abspath,
+ FALSE, iterpool2);
+ if (err)
+ goto handle_error;
+
+ /* Update the EXTERNALS table according to the root URL,
+ * relpath and uuid known in the upgraded external WC. */
+
+ /* We should probably have a function that provides all three
+ * of root URL, repos relpath and uuid at once, but here goes... */
+
+ /* First get the relpath, as that returns SVN_ERR_WC_PATH_NOT_FOUND
+ * when the node is not present in the file system.
+ * svn_wc__node_get_repos_info() would try to derive the URL. */
+ err = svn_wc__node_get_repos_relpath(&repos_relpath,
+ ctx->wc_ctx,
+ external_abspath,
+ iterpool2, iterpool2);
+ if (! err)
+ {
+ /* We got a repos relpath from a WC. So also get the root. */
+ err = svn_wc__node_get_repos_info(&repos_root_url,
+ &repos_uuid,
+ ctx->wc_ctx,
+ external_abspath,
+ iterpool2, iterpool2);
+ if (err)
+ goto handle_error;
+ }
+ else if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
{
+ /* The external is not currently checked out. Try to figure out
+ * the URL parts via the defined URL and fetch_repos_info(). */
svn_error_clear(err);
+ repos_relpath = NULL;
+ repos_root_url = NULL;
+ repos_uuid = NULL;
+ }
+ else if (err)
+ goto handle_error;
+
+ /* If we haven't got any information from the checked out external,
+ * or if the URL information mismatches the external's definition,
+ * ask fetch_repos_info() to find out the repos root. */
+ if (! repos_relpath || ! repos_root_url
+ || 0 != strcmp(resolved_url,
+ svn_path_url_add_component2(repos_root_url,
+ repos_relpath,
+ scratch_pool)))
+ {
+ err = fetch_repos_info(&repos_root_url,
+ &repos_uuid,
+ &info_baton,
+ resolved_url,
+ scratch_pool, scratch_pool);
+ if (err)
+ goto handle_error;
+
+ repos_relpath = svn_uri_skip_ancestor(repos_root_url,
+ resolved_url,
+ iterpool2);
+
+ /* There's just the URL, no idea what kind the external is.
+ * That's fine, as the external isn't even checked out yet.
+ * The kind will be set during the next 'update'. */
+ external_kind = svn_node_unknown;
+ }
+
+ if (err)
+ goto handle_error;
- 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));
+ peg_revision = (item->peg_revision.kind == svn_opt_revision_number
+ ? item->peg_revision.value.number
+ : SVN_INVALID_REVNUM);
+
+ revision = (item->revision.kind == svn_opt_revision_number
+ ? item->revision.value.number
+ : SVN_INVALID_REVNUM);
+
+ err = svn_wc__upgrade_add_external_info(ctx->wc_ctx,
+ external_abspath,
+ external_kind,
+ externals_parent,
+ repos_relpath,
+ repos_root_url,
+ repos_uuid,
+ peg_revision,
+ revision,
+ iterpool2);
+handle_error:
+ if (err)
+ {
+ svn_wc_notify_t *notify =
+ svn_wc_create_notify(external_abspath,
+ svn_wc_notify_failed_external,
+ scratch_pool);
+ notify->err = err;
+ ctx->notify_func2(ctx->notify_baton2,
+ notify, scratch_pool);
+ svn_error_clear(err);
+ /* Next external node, please... */
}
- else
- SVN_ERR(err);
}
}
svn_pool_destroy(iterpool);
+ svn_pool_destroy(iterpool2);
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/client.h?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/client.h (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/client.h Mon Nov 21 07:07:56 2011
@@ -105,10 +105,14 @@ svn_error_t *svn_client__get_copy_source
specify the point(s) of interest (typically the revisions referred
to as the "operative range" for a given operation) along that history.
- END may be of kind svn_opt_revision_unspecified (in which case
+ START_REVISION and/or END_REVISION may be NULL if not wanted.
+ END may be NULL or of kind svn_opt_revision_unspecified (in either case
END_URL and END_REVISION are not touched by the function);
START and REVISION may not.
+ If PATH is a WC path and REVISION is of kind svn_opt_revision_working,
+ then look at the PATH's copy-from URL instead of its base URL.
+
RA_SESSION should be an open RA session pointing at the URL of PATH,
or NULL, in which case this function will open its own temporary session.
@@ -128,9 +132,9 @@ svn_error_t *svn_client__get_copy_source
Use POOL for all allocations. */
svn_error_t *
svn_client__repos_locations(const char **start_url,
- svn_opt_revision_t **start_revision,
+ svn_revnum_t *start_revision,
const char **end_url,
- svn_opt_revision_t **end_revision,
+ svn_revnum_t *end_revision,
svn_ra_session_t *ra_session,
const char *path,
const svn_opt_revision_t *revision,
@@ -139,6 +143,22 @@ svn_client__repos_locations(const char *
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+/* Trace a line of history of a particular versioned resource back to a
+ * specific revision.
+ *
+ * Set *OP_URL to the URL that the object PEG_URL@PEG_REVNUM had in
+ * revision OP_REVNUM.
+ * RA_SESSION is required. */
+svn_error_t *
+svn_client__repos_location(const char **start_url,
+ svn_ra_session_t *ra_session,
+ const char *peg_url,
+ svn_revnum_t peg_revnum,
+ svn_revnum_t op_revnum,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Set *SEGMENTS to an array of svn_location_segment_t * objects, each
representing a reposition location segment for the history of PATH
@@ -191,14 +211,16 @@ svn_client__get_youngest_common_ancestor
is not, then @c SVN_ERR_CLIENT_UNRELATED_RESOURCES is returned.
BASE_DIR_ABSPATH is the working copy path the ra_session corresponds to,
- should only be used if PATH_OR_URL is a url.
+ and should only be used if PATH_OR_URL is a url
+ ### else NULL? what's it for?
- If PEG_REVISION's kind is svn_opt_revision_unspecified, it is
- interpreted as "head" for a URL or "working" for a working-copy path.
+ If PEG_REVISION->kind is 'unspecified', the peg revision is 'head'
+ for a URL or 'working' for a WC path. If REVISION->kind is
+ 'unspecified', the operative revision is the peg revision.
Store the resulting ra_session in *RA_SESSION_P. Store the actual
revision number of the object in *REV_P, and the final resulting
- URL in *URL_P.
+ URL in *URL_P. REV_P and/or URL_P may be NULL if not wanted.
Use authentication baton cached in CTX to authenticate against the
repository.
@@ -244,28 +266,13 @@ svn_client__ensure_ra_session_url(const
const char *session_url,
apr_pool_t *pool);
-/* Set REPOS_ROOT, allocated in RESULT_POOL to the URL which represents
- the root of the repository in with ABSPATH_OR_URL is versioned.
- Use the authentication baton and working copy context cached in CTX as
- necessary.
-
- Use SCRATCH_POOL for temporary allocations. */
-svn_error_t *
-svn_client__get_repos_root(const char **repos_root,
- const char *abspath_or_url,
- svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Return the path of ABSPATH_OR_URL relative to the repository root
- (REPOS_ROOT) in REL_PATH (URI-decoded), both allocated in RESULT_POOL.
+ in REL_PATH (URI-decoded), allocated in RESULT_POOL.
If INCLUDE_LEADING_SLASH is set, the returned result will have a leading
slash; otherwise, it will not.
- The remaining parameters are used to procure the repository root.
- Either REPOS_ROOT or RA_SESSION -- but not both -- may be NULL.
- REPOS_ROOT should be passed when available as an optimization (in
- that order of preference).
+ REPOS_ROOT and RA_SESSION may be NULL if ABSPATH_OR_URL is a WC path,
+ otherwise at least one of them must be non-null.
CAUTION: While having a leading slash on a so-called relative path
might work out well for functionality that interacts with
@@ -395,6 +402,19 @@ svn_error_t * svn_client__wc_delete(cons
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+
+/* Like svn_client__wc_delete(), but deletes mulitple TARGETS efficiently. */
+svn_error_t *
+svn_client__wc_delete_many(const apr_array_header_t *targets,
+ svn_boolean_t force,
+ svn_boolean_t dry_run,
+ svn_boolean_t keep_local,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+
/* Make PATH and add it to the working copy, optionally making all the
intermediate parent directories if MAKE_PARENTS is TRUE. */
svn_error_t *
@@ -584,22 +604,28 @@ svn_client__switch_internal(svn_revnum_t
/* Create an editor for a pure repository comparison, i.e. comparing one
repository version against the other.
- 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 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
DEPTH is the depth to recurse.
- RA_SESSION defines the additional RA session for requesting file
- contents.
+ RA_SESSION is an RA session through which this editor may fetch
+ properties, file contents and directory listings of the 'old' side of the
+ diff. It is a separate RA session from the one through which this editor
+ is being driven.
REVISION is the start revision in the comparison.
+ For each deleted directory, if WALK_DELETED_DIRS is true then just call
+ the 'dir_deleted' callback once, otherwise call the 'file_deleted' or
+ 'dir_deleted' callback for each individual node in that subtree.
+
+ If TEXT_DELTAS is FALSE, then do not expect text deltas from the edit
+ drive, nor send the 'before' and 'after' texts to the diff callbacks;
+ instead, send empty files to the diff callbacks if there was a change.
+ This must be FALSE if the edit producer is not sending text deltas,
+ otherwise the file content checksum comparisons will fail.
+
If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
file and directory operated on during the edit.
@@ -607,12 +633,11 @@ svn_client__switch_internal(svn_revnum_t
svn_error_t *
svn_client__get_diff_editor(const svn_delta_editor_t **editor,
void **edit_baton,
- svn_wc_context_t *wc_ctx,
- const char *target,
svn_depth_t depth,
svn_ra_session_t *ra_session,
svn_revnum_t revision,
svn_boolean_t walk_deleted_dirs,
+ svn_boolean_t text_deltas,
const svn_wc_diff_callbacks4_t *diff_callbacks,
void *diff_cmd_baton,
svn_cancel_func_t cancel_func,
@@ -626,29 +651,23 @@ svn_client__get_diff_editor(const svn_de
/*** Editor for diff summary ***/
-/* Create an editor for a repository diff summary, i.e. comparing one
- repository version against the other and only providing information
- about the changed items without the text deltas.
+/* Set *CALLBACKS and *CALLBACK_BATON to a set of diff callbacks that will
+ report a diff summary, i.e. only providing information about the changed
+ items without the text deltas.
- TARGET is the target of the diff, relative to the root of the edit.
+ TARGET is the target path, relative to the anchor, of the diff.
SUMMARIZE_FUNC is called with SUMMARIZE_BATON as parameter by the
- created svn_delta_editor_t for each changed item.
-
- See svn_client__get_diff_editor() for a description of the other
- parameters. */
+ created callbacks for each changed item.
+*/
svn_error_t *
-svn_client__get_diff_summarize_editor(const char *target,
- svn_client_diff_summarize_func_t
- summarize_func,
- void *summarize_baton,
- svn_ra_session_t *ra_session,
- svn_revnum_t revision,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- const svn_delta_editor_t **editor,
- void **edit_baton,
- apr_pool_t *pool);
+svn_client__get_diff_summarize_callbacks(
+ svn_wc_diff_callbacks4_t **callbacks,
+ void **callback_baton,
+ const char *target,
+ svn_client_diff_summarize_func_t summarize_func,
+ void *summarize_baton,
+ apr_pool_t *pool);
/* ---------------------------------------------------------------- */
@@ -1051,13 +1070,21 @@ svn_client__ensure_revprop_table(apr_has
/* Return a potentially translated version of local file LOCAL_ABSPATH
in NORMAL_STREAM. REVISION must be one of the following: BASE, COMMITTED,
- WORKING. Uses SCRATCH_POOL for temporary allocations. */
+ WORKING.
+
+ EXPAND_KEYWORDS operates as per the EXPAND argument to
+ svn_subst_stream_translated, which see. If NORMALIZE_EOLS is TRUE and
+ LOCAL_ABSPATH requires translation, then normalize the line endings in
+ *NORMAL_STREAM.
+
+ Uses SCRATCH_POOL for temporary allocations. */
svn_error_t *
svn_client__get_normalized_stream(svn_stream_t **normal_stream,
svn_wc_context_t *wc_ctx,
const char *local_abspath,
const svn_opt_revision_t *revision,
svn_boolean_t expand_keywords,
+ svn_boolean_t normalize_eols,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool,
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/cmdline.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/cmdline.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/cmdline.c Mon Nov 21 07:07:56 2011
@@ -114,8 +114,8 @@ check_root_url_of_target(const char **ro
if (!svn_path_is_url(truepath))
SVN_ERR(svn_dirent_get_absolute(&truepath, truepath, pool));
- err = svn_client__get_repos_root(&tmp_root_url, truepath,
- ctx, pool, pool);
+ err = svn_client_get_repos_root(&tmp_root_url, NULL, truepath,
+ ctx, pool, pool);
if (err)
{
@@ -125,7 +125,7 @@ check_root_url_of_target(const char **ro
*
* If the target itself is a URL to a repository that does not exist,
* that's fine, too. The callers will deal with this argument in an
- * appropriate manter if it does not make any sense.
+ * appropriate manner if it does not make any sense.
*
* Also tolerate locally added targets ("bad revision" error).
*/
@@ -142,7 +142,7 @@ check_root_url_of_target(const char **ro
return svn_error_trace(err);
}
- if (*root_url != NULL)
+ if (*root_url && tmp_root_url)
{
if (strcmp(*root_url, tmp_root_url) != 0)
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
@@ -347,7 +347,11 @@ svn_client_args_to_target_array2(apr_arr
*/
if (root_url == NULL)
{
- err = svn_client_root_url_from_path(&root_url, "", ctx, pool);
+ const char *current_abspath;
+
+ SVN_ERR(svn_dirent_get_absolute(¤t_abspath, "", pool));
+ err = svn_client_get_repos_root(&root_url, NULL /* uuid */,
+ current_abspath, ctx, pool, pool);
if (err || root_url == NULL)
return svn_error_create(SVN_ERR_WC_NOT_WORKING_COPY, err,
_("Resolving '^/': no repository root "
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/commit.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/commit.c Mon Nov 21 07:07:56 2011
@@ -667,10 +667,12 @@ get_ra_editor(svn_ra_session_t **ra_sess
log_msg, ctx, pool));
/* Fetch RA commit editor. */
- return svn_ra_get_commit_editor3(*ra_session, editor, edit_baton,
- commit_revprops, commit_callback,
- commit_baton, lock_tokens, keep_locks,
- pool);
+ SVN_ERR(svn_ra_get_commit_editor3(*ra_session, editor, edit_baton,
+ commit_revprops, commit_callback,
+ commit_baton, lock_tokens, keep_locks,
+ pool));
+
+ return SVN_NO_ERROR;
}
@@ -899,12 +901,11 @@ collect_lock_tokens(apr_hash_t **result,
{
const char *url = svn__apr_hash_index_key(hi);
const char *token = svn__apr_hash_index_val(hi);
+ const char *relpath = svn_uri_skip_ancestor(base_url, url, pool);
- if (svn_uri__is_ancestor(base_url, url))
+ if (relpath)
{
- url = svn_uri_skip_ancestor(base_url, url, pool);
-
- apr_hash_set(*result, url, APR_HASH_KEY_STRING, token);
+ apr_hash_set(*result, relpath, APR_HASH_KEY_STRING, token);
}
}
@@ -1166,12 +1167,113 @@ check_url_kind(void *baton,
kind, scratch_pool));
}
+/* Recurse into every target in REL_TARGETS, finding committable externals
+ * nested within. Append these to REL_TARGETS itself. The paths in REL_TARGETS
+ * are assumed to be / will be created relative to BASE_ABSPATH. The remaining
+ * arguments correspond to those of svn_client_commit6(). */
+static svn_error_t*
+append_externals_as_explicit_targets(apr_array_header_t *rel_targets,
+ const char *base_abspath,
+ svn_boolean_t include_file_externals,
+ svn_boolean_t include_dir_externals,
+ svn_depth_t depth,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ int rel_targets_nelts_fixed;
+ int i;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+ /* Easy part of applying DEPTH to externals. */
+ if (depth == svn_depth_empty)
+ {
+ /* Don't recurse. */
+ return SVN_NO_ERROR;
+ }
+ else if (depth != svn_depth_infinity)
+ {
+ include_dir_externals = FALSE;
+ /* We slip in dir externals as explicit targets. When we do that,
+ * depth_immediates should become depth_empty for dir externals targets.
+ * But adding the dir external to the list of targets makes it get
+ * handled with depth_immediates itself, and thus will also include the
+ * immediate children of the dir external. So do dir externals only with
+ * depth_infinity or not at all.
+ * ### TODO: Maybe rework this (and svn_client_commit6()) into separate
+ * ### target lists, "duplicating" REL_TARGETS: one for the user's
+ * ### targets and one for the overlayed externals targets, and pass an
+ * ### appropriate depth for the externals targets in a separate call to
+ * ### svn_client__harvest_committables(). The only gain is correct
+ * ### handling of this very specific case: during 'svn commit
+ * ### --depth=immediates --include-externals', commit dir externals
+ * ### (only immediate children of a target) with depth_empty instead of
+ * ### not at all. No other effect. So not doing that for now. */
+ }
+
+ if (! (include_file_externals || include_dir_externals))
+ return SVN_NO_ERROR;
+
+ /* Iterate *and* grow REL_TARGETS at the same time. */
+ rel_targets_nelts_fixed = rel_targets->nelts;
+
+ for (i = 0; i < rel_targets_nelts_fixed; i++)
+ {
+ int j;
+ const char *target;
+ apr_array_header_t *externals = NULL;
+
+ svn_pool_clear(iterpool);
+
+ target = svn_dirent_join(base_abspath,
+ APR_ARRAY_IDX(rel_targets, i, const char *),
+ iterpool);
+
+ /* ### TODO: Possible optimization: No need to do this for file targets.
+ * ### But what's cheaper, stat'ing the file system or querying the db?
+ * ### --> future. */
+
+ SVN_ERR(svn_wc__committable_externals_below(&externals, ctx->wc_ctx,
+ target, depth,
+ iterpool, iterpool));
+
+ if (externals != NULL)
+ {
+ const char *rel_target;
+
+ for (j = 0; j < externals->nelts; j++)
+ {
+ svn_wc__committable_external_info_t *xinfo =
+ APR_ARRAY_IDX(externals, j,
+ svn_wc__committable_external_info_t *);
+
+ if ((xinfo->kind == svn_kind_file && ! include_file_externals)
+ || (xinfo->kind == svn_kind_dir && ! include_dir_externals))
+ continue;
+
+ rel_target = svn_dirent_skip_ancestor(base_abspath,
+ xinfo->local_abspath);
+
+ SVN_ERR_ASSERT(rel_target != NULL && *rel_target != '\0');
+
+ APR_ARRAY_PUSH(rel_targets, const char *) =
+ apr_pstrdup(result_pool, rel_target);
+ }
+ }
+ }
+
+ svn_pool_destroy(iterpool);
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
-svn_client_commit5(const apr_array_header_t *targets,
+svn_client_commit6(const apr_array_header_t *targets,
svn_depth_t depth,
svn_boolean_t keep_locks,
svn_boolean_t keep_changelists,
svn_boolean_t commit_as_operations,
+ svn_boolean_t include_file_externals,
+ svn_boolean_t include_dir_externals,
const apr_array_header_t *changelists,
const apr_hash_t *revprop_table,
svn_commit_callback2_t commit_callback,
@@ -1231,6 +1333,12 @@ svn_client_commit5(const apr_array_heade
if (rel_targets->nelts == 0)
APR_ARRAY_PUSH(rel_targets, const char *) = "";
+ SVN_ERR(append_externals_as_explicit_targets(rel_targets, base_abspath,
+ include_file_externals,
+ include_dir_externals,
+ depth, ctx,
+ pool, pool));
+
SVN_ERR(determine_lock_targets(&lock_targets, ctx->wc_ctx, base_abspath,
rel_targets, pool, iterpool));
@@ -1601,3 +1709,25 @@ svn_client_commit5(const apr_array_heade
return svn_error_trace(reconcile_errors(cmt_err, unlock_err, bump_err,
pool));
}
+
+svn_error_t *
+svn_client_commit5(const apr_array_header_t *targets,
+ svn_depth_t depth,
+ svn_boolean_t keep_locks,
+ svn_boolean_t keep_changelists,
+ svn_boolean_t commit_as_operations,
+ const apr_array_header_t *changelists,
+ const apr_hash_t *revprop_table,
+ svn_commit_callback2_t commit_callback,
+ void *commit_baton,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ return svn_client_commit6(targets, depth, keep_locks, keep_changelists,
+ commit_as_operations,
+ TRUE, /* include_file_externals */
+ FALSE, /* include_dir_externals */
+ changelists, revprop_table, commit_callback,
+ commit_baton, ctx, pool);
+}
+
Modified: subversion/branches/svn-bisect/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_client/commit_util.c?rev=1204374&r1=1204373&r2=1204374&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_client/commit_util.c Mon Nov 21 07:07:56 2011
@@ -402,7 +402,7 @@ bail_on_tree_conflicted_ancestor(svn_wc_
If COMMIT_RELPATH is not NULL, treat not-added nodes as if it is destined to
be added as COMMIT_RELPATH, and add 'deleted' entries to COMMITTABLES as
items to delete in the copy destination. COPY_MODE_ROOT should be set TRUE
- for the first call for which COPY_MODE is TRUE, i.e. not for for the
+ for the first call for which COPY_MODE is TRUE, i.e. not for the
recursive calls, and FALSE otherwise.
If CHANGELISTS is non-NULL, it is a hash whose keys are const char *
@@ -410,6 +410,12 @@ bail_on_tree_conflicted_ancestor(svn_wc_
when harvesting committables; that is, don't add a path to
COMMITTABLES unless it's a member of one of those changelists.
+ IS_EXPLICIT_TARGET should always be passed as TRUE, except when
+ harvest_committables() calls itself in recursion. This provides a way to
+ tell whether LOCAL_ABSPATH was an original target or whether it was reached
+ by recursing deeper into a dir target. (This is used to skip all file
+ externals that aren't explicit commit targets.)
+
If CANCEL_FUNC is non-null, call it with CANCEL_BATON to see
if the user has cancelled the operation.
@@ -428,6 +434,7 @@ harvest_committables(svn_wc_context_t *w
apr_hash_t *changelists,
svn_boolean_t skip_files,
svn_boolean_t skip_dirs,
+ svn_boolean_t is_explicit_target,
svn_client__check_url_kind_t check_url_func,
void *check_url_baton,
svn_cancel_func_t cancel_func,
@@ -543,12 +550,26 @@ harvest_committables(svn_wc_context_t *w
svn_dirent_local_style(local_abspath, scratch_pool));
}
- if (copy_mode
- && is_update_root
- && db_kind == svn_node_file)
+ /* Handle file externals.
+ * (IS_UPDATE_ROOT is more generally defined, but at the moment this
+ * condition matches only file externals.)
+ *
+ * Don't copy files that svn:externals brought into the WC. So in copy_mode,
+ * even explicit targets are skipped.
+ *
+ * Exclude file externals from recursion. Hande file externals only when
+ * passed as explicit target. Note that svn_client_commit6() passes all
+ * committable externals in as explicit targets iff they count.
+ *
+ * Also note that dir externals will never be reached recursively by this
+ * function, since svn_wc__node_get_children_of_working_node() (used below
+ * to recurse) does not return switched subdirs. */
+ if (is_update_root
+ && db_kind == svn_node_file
+ && (copy_mode
+ || ! is_explicit_target))
{
- if (copy_mode)
- return SVN_NO_ERROR;
+ return SVN_NO_ERROR;
}
/* If NODE is in our changelist, then examine it for conflicts. We
@@ -841,6 +862,7 @@ harvest_committables(svn_wc_context_t *w
changelists,
(depth < svn_depth_files),
(depth < svn_depth_immediates),
+ FALSE, /* IS_EXPLICIT_TARGET */
check_url_func, check_url_baton,
cancel_func, cancel_baton,
notify_func, notify_baton,
@@ -1125,6 +1147,7 @@ svn_client__harvest_committables(svn_cli
FALSE /* COPY_MODE_ROOT */,
depth, just_locked, changelist_hash,
FALSE, FALSE,
+ TRUE /* IS_EXPLICIT_TARGET */,
check_url_func, check_url_baton,
ctx->cancel_func, ctx->cancel_baton,
ctx->notify_func2, ctx->notify_baton2,
@@ -1218,6 +1241,7 @@ harvest_copy_committables(void *baton, v
FALSE, /* JUST_LOCKED */
NULL,
FALSE, FALSE, /* skip files, dirs */
+ TRUE, /* IS_EXPLICIT_TARGET (don't care) */
btn->check_url_func,
btn->check_url_baton,
btn->ctx->cancel_func,
@@ -1341,14 +1365,9 @@ svn_client__condense_commit_items(const
{
svn_client_commit_item3_t *this_item
= APR_ARRAY_IDX(ci, i, svn_client_commit_item3_t *);
- size_t url_len = strlen(this_item->url);
- size_t base_url_len = strlen(*base_url);
- if (url_len > base_url_len)
- this_item->session_relpath = svn_uri__is_child(*base_url,
- this_item->url, pool);
- else
- this_item->session_relpath = "";
+ this_item->session_relpath = svn_uri_skip_ancestor(*base_url,
+ this_item->url, pool);
}
#ifdef SVN_CLIENT_COMMIT_DEBUG
/* ### TEMPORARY CODE ### */