Modified: subversion/branches/fsx-1.10/subversion/include/svn_fs.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_fs.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_fs.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_fs.h Sun Jun 14 20:58:10 2015 @@ -65,6 +65,30 @@ svn_fs_version(void); /** An object representing a Subversion filesystem. */ typedef struct svn_fs_t svn_fs_t; +/** + * @defgroup svn_fs_backend_names Built-in back-ends + * Constants defining the currently supported built-in filesystem backends. + * + * @see svn_fs_type + * @{ + */ +/** @since New in 1.1. */ +#define SVN_FS_TYPE_BDB "bdb" +/** @since New in 1.1. */ +#define SVN_FS_TYPE_FSFS "fsfs" + +/** + * EXPERIMENTAL filesystem backend. + * + * It is not ready for general production use. Please consult the + * respective release notes on suggested usage scenarios. + * + * @since New in 1.9. + */ +#define SVN_FS_TYPE_FSX "fsx" + +/** @} */ + /** * @name Filesystem configuration options @@ -89,7 +113,7 @@ typedef struct svn_fs_t svn_fs_t; * * "2" is allowed, too and means "enable if efficient", * i.e. this will not create warning at runtime if there - * if no efficient support for revprop caching. + * is no efficient support for revprop caching. * * @since New in 1.8. */ @@ -139,23 +163,10 @@ typedef struct svn_fs_t svn_fs_t; /* Note to maintainers: if you add further SVN_FS_CONFIG_FSFS_CACHE_* knobs, update fs_fs.c:verify_as_revision_before_current_plus_plus(). */ -/* See also svn_fs_type(). */ -/** @since New in 1.1. */ -#define SVN_FS_CONFIG_FS_TYPE "fs-type" -/** @since New in 1.1. */ -#define SVN_FS_TYPE_BDB "bdb" -/** @since New in 1.1. */ -#define SVN_FS_TYPE_FSFS "fsfs" - -/** - * EXPERIMENTAL filesystem backend. +/** Select the filesystem type. See also #svn_fs_type(). * - * It is not ready for general production use. Please consult the - * respective release notes on suggested usage scenarios. - * - * @since New in 1.9. - */ -#define SVN_FS_TYPE_FSX "fsx" + * @since New in 1.1. */ +#define SVN_FS_CONFIG_FS_TYPE "fs-type" /** Create repository format compatible with Subversion versions * earlier than 1.4. @@ -185,9 +196,9 @@ typedef struct svn_fs_t svn_fs_t; */ #define SVN_FS_CONFIG_PRE_1_8_COMPATIBLE "pre-1.8-compatible" -/** Create repository format compatible with Subversion versions - * earlier than 1.9. The value must be a version in the same format - * as #SVN_VER_NUMBER. +/** Create repository format compatible with the specified Subversion + * release. The value must be a version in the same format as + * #SVN_VER_NUMBER and cannot exceed the current version. * * @note The @c patch component would often be ignored, due to our forward * compatibility promises within minor release lines. It should therefore @@ -291,8 +302,9 @@ svn_fs_create(svn_fs_t **fs_p, * return a pointer to it in @a *fs_p. If @a fs_config is not @c * NULL, the options it contains modify the behavior of the * filesystem. The interpretation of @a fs_config is specific to the - * filesystem back-end. The opened filesystem may be closed by - * destroying @a result_pool. + * filesystem back-end. The opened filesystem will be allocated in + * @a result_pool may be closed by clearing or destroying that pool. + * Use @a scratch_pool for temporary allocations. * * @note The lifetime of @a fs_config must not be shorter than @a * result_pool's. It's a good idea to allocate @a fs_config from @@ -346,25 +358,25 @@ typedef enum svn_fs_upgrade_notify_actio svn_fs_upgrade_format_bumped } svn_fs_upgrade_notify_action_t; -/** The type of a upgrade notification function. @a number is specifc +/** The type of an upgrade notification function. @a number is specifc * to @a action (see #svn_fs_upgrade_notify_action_t); @a action is the * type of action being performed. @a baton is the corresponding baton - * for the notification function, and @a pool can be used for temporary - * allocations, but will be cleared between invocations. - * + * for the notification function, and @a scratch_pool can be used for + * temporary allocations, but will be cleared between invocations. + * * @since New in 1.9. */ typedef svn_error_t *(*svn_fs_upgrade_notify_t)(void *baton, apr_uint64_t number, svn_fs_upgrade_notify_action_t action, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** * Upgrade the Subversion filesystem located in the directory @a path * to the latest version supported by this library. Return * #SVN_ERR_FS_UNSUPPORTED_UPGRADE and make no changes to the - * filesystem if the requested upgrade is not supported. Use @a pool - * for necessary allocations. + * filesystem if the requested upgrade is not supported. Use + * @a scratch_pool for temporary allocations. * * The optional @a notify_func callback is only a general feedback that * the operation is still in process but may be called in e.g. random shard @@ -374,7 +386,7 @@ typedef svn_error_t *(*svn_fs_upgrade_no * the user to preempt this potentially lengthy operation. * * @note You probably don't want to use this directly. Take a look at - * svn_repos_upgrade() instead. + * svn_repos_upgrade2() instead. * * @note Canceling an upgrade is legal but may leave remnants of previous * format data that may not be cleaned up automatically by later calls. @@ -387,13 +399,13 @@ svn_fs_upgrade2(const char *path, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** * Like svn_fs_upgrade2 but with notify_func, notify_baton, cancel_func * and cancel_baton being set to NULL. * - * @deprecated Provided for backward compatibility with the 1.8 API. + * @deprecated Provided for backward compatibility with the 1.8 API. * @since New in 1.5. */ SVN_DEPRECATED @@ -449,7 +461,7 @@ svn_fs_path(svn_fs_t *fs, * Return a shallow copy of the configuration parameters used to open * @a fs, allocated in @a pool. It may be @c NULL. The contents of the * hash contents remains valid only for @a fs's lifetime. - * + * * @note This is just what was passed to svn_fs_create() or svn_fs_open(). * You may not modify it. * @@ -474,13 +486,14 @@ svn_fs_delete_fs(const char *path, /** The type of a hotcopy notification function. @a start_revision and * @a end_revision indicate the copied revision range. @a baton is the - * corresponding baton for the notification function, and @a pool can be - * used for temporary allocations, but will be cleared between invocations. + * corresponding baton for the notification function, and @a scratch_pool + * can be used for temporary allocations, but will be cleared between + * invocations. */ typedef void (*svn_fs_hotcopy_notify_t)(void *baton, svn_revnum_t start_revision, svn_revnum_t end_revision, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** * Copy a possibly live Subversion filesystem from @a src_path to @@ -497,9 +510,13 @@ typedef void (*svn_fs_hotcopy_notify_t)( * For each revision range copied, @a notify_func will be called with * staring and ending revision numbers (both inclusive and not necessarily * different) and with the @a notify_baton. Currently, this notification - * is only supported in the FSFS backend. @a notify_func may be @c NULL + * is not triggered by the BDB backend. @a notify_func may be @c NULL * if this notification is not required. * + * The optional @a cancel_func callback will be invoked with + * @a cancel_baton as usual to allow the user to preempt this potentially + * lengthy operation. + * * Use @a scratch_pool for temporary allocations. * * @since New in 1.9. @@ -871,27 +888,39 @@ svn_fs_access_add_lock_token(svn_fs_acce * @{ */ -/** Defines the possible ways two arbitrary nodes may be related. - * +/** Defines the possible ways two arbitrary (root, path)-pairs may be + * related. + * * @since New in 1.9. */ typedef enum svn_fs_node_relation_t { - /** The nodes are not related. - * Nodes from different repositories are always unrelated. - * #svn_fs_compare_ids would return the value -1 in this case. + /** The (root, path)-pairs are not related, i.e. none of the other cases + * apply. If the roots refer to different @c svn_fs_t instances, then + * they are always considered unrelated - even if the underlying + * repository is the same. */ svn_fs_node_unrelated = 0, - /** They are the same physical node, i.e. there is no intervening change. - * However, due to lazy copying, there may be part of different parent - * copies. #svn_fs_compare_ids would return the value 0 in this case. + /** No changes have been made between the (root, path)-pairs, i.e. they + * have the same (relative) nodes in their sub-trees, corresponding sub- + * tree nodes have the same contents as well as properties and report the + * same "created-path" and "created-rev" data. This implies having a + * common ancestor. + * + * However, due to efficiency considerations, the FS implementation may + * report some combinations as merely having a common ancestor + * (@a svn_fs_node_common_ancestor) instead of actually being unchanged. */ - svn_fs_node_same, + svn_fs_node_unchanged, - /** The nodes have a common ancestor (which may be one of these nodes) - * but are not the same. - * #svn_fs_compare_ids would return the value 1 in this case. + /** The (root, path)-pairs have a common ancestor (which may be one of + * them) but there are changes between them, i.e. they don't fall into + * the @c svn_fs_node_unchanged category. + * + * Due to efficiency considerations, the FS implementation may falsely + * classify some combinations as merely having a common ancestor that + * are, in fact, unchanged (@a svn_fs_node_unchanged). */ svn_fs_node_common_ancestor @@ -904,9 +933,9 @@ typedef struct svn_fs_id_t svn_fs_id_t; /** Return -1, 0, or 1 if node revisions @a a and @a b are respectively * unrelated, equivalent, or otherwise related (part of the same node). * - * @note Using FS ID based functions is now discouraged and may be fully - * deprecated in future releases. New code should use #svn_fs_node_relation() - * and #svn_fs_node_relation_t instead. + * @note Consider using the more expressive #svn_fs_node_relation() instead. + * + * @see #svn_fs_node_relation */ int svn_fs_compare_ids(const svn_fs_id_t *a, @@ -917,9 +946,9 @@ svn_fs_compare_ids(const svn_fs_id_t *a, /** Return TRUE if node revisions @a id1 and @a id2 are related (part of the * same node), else return FALSE. * - * @note Using FS ID based functions is now discouraged and may be fully - * deprecated in future releases. New code should use #svn_fs_node_relation() - * and #svn_fs_node_relation_t instead. + * @note Consider using the more expressive #svn_fs_node_relation() instead. + * + * @see #svn_fs_node_relation */ svn_boolean_t svn_fs_check_related(const svn_fs_id_t *id1, @@ -1137,7 +1166,7 @@ svn_fs_begin_txn(svn_fs_txn_t **txn_p, * new revision will have svn:date set to the current time at some * point during the commit and any svn:date on the transaction will be * lost. - * + * * If @a conflict_p is non-zero, use it to provide details on any * conflicts encountered merging @a txn with the most recent committed * revisions. If a conflict occurs, set @a *conflict_p to the path of @@ -1396,7 +1425,7 @@ svn_fs_revision_root_revision(svn_fs_roo * Unicode canonical decomposition and ordering. No directory entry * may be named '.', '..', or the empty string. Given a directory * entry name which fails to meet these requirements, a filesystem - * function returns an SVN_ERR_FS_PATH_SYNTAX error. + * function returns an #SVN_ERR_FS_PATH_SYNTAX error. * * A directory path is a sequence of zero or more directory entry * names, separated by slash characters (U+002f), and possibly ending @@ -1404,7 +1433,7 @@ svn_fs_revision_root_revision(svn_fs_roo * characters are treated as if they were a single slash. If a path * ends with a slash, it refers to the same node it would without the * slash, but that node must be a directory, or else the function - * returns an SVN_ERR_FS_NOT_DIRECTORY error. + * may return an #SVN_ERR_FS_NOT_DIRECTORY error. * * A path consisting of the empty string, or a string containing only * slashes, refers to the root directory. @@ -1715,7 +1744,7 @@ svn_fs_node_id(const svn_fs_id_t **id_p, * are related and return the result in @a relation. There is no restriction * concerning the roots: They may refer to different repositories, be in * arbitrary revision order and any of them may pertain to a transaction. - * @a pool is used for temporary allocations. + * @a scratch_pool is used for temporary allocations. * * @note Paths from different svn_fs_t will be reported as unrelated even * if the underlying physical repository is the same. @@ -1728,7 +1757,7 @@ svn_fs_node_relation(svn_fs_node_relatio const char *path_a, svn_fs_root_t *root_b, const char *path_b, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** Set @a *revision to the revision in which @a path under @a root was * created. Use @a pool for any temporary allocations. @a *revision will @@ -1794,6 +1823,18 @@ svn_fs_node_proplist(apr_hash_t **table_ const char *path, apr_pool_t *pool); +/** Set @a *has_props to TRUE if the node @a path in @a root has properties + * and to FALSE if it doesn't have properties. Perform temporary allocations + * in @a scratch_pool. + * + * @since New in 1.9. + */ +svn_error_t * +svn_fs_node_has_props(svn_boolean_t *has_props, + svn_fs_root_t *root, + const char *path, + apr_pool_t *scratch_pool); + /** Change a node's property's value, or add/delete a property. * @@ -1818,7 +1859,7 @@ svn_fs_change_node_prop(svn_fs_root_t *r * differ from those at @a path2 under @a root2, or set it to #FALSE if they * are the same. Both paths must exist under their respective roots, and * both roots must be in the same filesystem. - * Do any necessary temporary allocation in @a pool. + * Do any necessary temporary allocation in @a scratch_pool. * * @since New in 1.9. */ @@ -1828,7 +1869,7 @@ svn_fs_props_different(svn_boolean_t *di const char *path1, svn_fs_root_t *root2, const char *path2, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** Determine if the properties of two path/root combinations are different. @@ -1847,7 +1888,7 @@ svn_fs_props_different(svn_boolean_t *di * at all. * * @note Prior to Subversion 1.9, this function would return false negatives - * as well for FSFS: If @a root1 and @a root2 were both transaction roots + * for FSFS: If @a root1 and @a root2 were both transaction roots * and the proplists of both paths had been changed in their respective * transactions, @a changed_p would be set to #FALSE. */ @@ -2069,7 +2110,8 @@ svn_fs_dir_entries(apr_hash_t **entries_ * #svn_fs_dir_entries for @a root and determine an optimized ordering * in which data access would most likely be efficient. Set @a *ordered_p * to a newly allocated APR array of pointers to these #svn_fs_dirent_t - * structures. Allocate the array (but not its contents) in @a pool. + * structures. Allocate the array (but not its contents) in @a result_pool + * and use @a scratch_pool for temporaries. * * @since New in 1.9. */ @@ -2077,7 +2119,8 @@ svn_error_t * svn_fs_dir_optimal_order(apr_array_header_t **ordered_p, svn_fs_root_t *root, apr_hash_t *entries, - apr_pool_t *pool); + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); /** Create a new directory named @a path in @a root. The new directory has * no entries, and no properties. @a root must be the root of a transaction, @@ -2373,7 +2416,7 @@ svn_fs_apply_text(svn_stream_t **content * @a root1 differ from those at @a path2 under @a root2, or set it to * #FALSE if they are the same. Both paths must exist under their * respective roots, and both roots must be in the same filesystem. - * Do any necessary temporary allocation in @a pool. + * Do any necessary temporary allocation in @a scratch_pool. * * @since New in 1.9. */ @@ -2383,7 +2426,7 @@ svn_fs_contents_different(svn_boolean_t const char *path1, svn_fs_root_t *root2, const char *path2, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** Check if the contents of two root/path combos have changed. In * contrast to #svn_fs_contents_different, we only perform a quick test @@ -2434,7 +2477,7 @@ svn_fs_youngest_rev(svn_revnum_t *younge * Set @a *supports_version to the version number of the minimum Subversion GA * release that can read and write @a fs. * - * @see svn_repos_info_format() + * @see svn_repos_info_format * * @since New in 1.9. */ @@ -2615,14 +2658,14 @@ svn_fs_set_uuid(svn_fs_t *fs, /** Lock information for use with svn_fs_lock_many() [and svn_repos_fs_...]. * - * @see svn_fs_lock_target_create(). + * @see svn_fs_lock_target_create * * @since New in 1.9. */ typedef struct svn_fs_lock_target_t svn_fs_lock_target_t; -/** Create an <tt>svn_fs_lock_target_t</tt> allocated in @a pool. @a - * token can be NULL and @a current_rev can be SVN_INVALID_REVNUM. +/** Create an <tt>svn_fs_lock_target_t</tt> allocated in @a result_pool. + * @a token can be NULL and @a current_rev can be SVN_INVALID_REVNUM. * * The @a token is not duplicated and so must have a lifetime at least as * long as the returned target object. @@ -2631,7 +2674,7 @@ typedef struct svn_fs_lock_target_t svn_ */ svn_fs_lock_target_t *svn_fs_lock_target_create(const char *token, svn_revnum_t current_rev, - apr_pool_t *pool); + apr_pool_t *result_pool); /** Update @a target changing the token to @a token, @a token can be NULL. * @@ -2651,7 +2694,12 @@ void svn_fs_lock_target_set_token(svn_fs * returns, use svn_error_dup() to preserve the error. * * If the callback returns an error no further callbacks will be made - * and svn_fs_lock_many/svn_fs_unlock_many will return an error. + * and svn_fs_lock_many/svn_fs_unlock_many will return an error. The + * caller cannot rely on any particular order for these callbacks and + * cannot rely on interrupting the underlying operation by returning + * an error. Returning an error stops the callbacks but any locks + * that would have been reported in further callbacks may, or may not, + * still be created/released. * * @since New in 1.9. */ @@ -2659,9 +2707,9 @@ typedef svn_error_t *(*svn_fs_lock_callb const char *path, const svn_lock_t *lock, svn_error_t *fs_err, - apr_pool_t *pool); + apr_pool_t *scratch_pool); -/** Lock the paths in @a targets in @a fs. +/** Lock the paths in @a lock_targets in @a fs. * * @a fs must have a username associated with it (see * #svn_fs_access_t), else return #SVN_ERR_FS_NO_USER. Set the @@ -2675,7 +2723,7 @@ typedef svn_error_t *(*svn_fs_lock_callb * to use it. If in doubt, pass 0. * * The paths to be locked are passed as the <tt>const char *</tt> keys - * of the @a targets hash. The hash values are + * of the @a lock_targets hash. The hash values are * <tt>svn_fs_lock_target_t *</tt> and provide the token and * @a current_rev for each path. The token is a lock token such as can * be generated using svn_fs_generate_lock_token() (indicating that @@ -2697,15 +2745,19 @@ typedef svn_error_t *(*svn_fs_lock_callb * If @a expiration_date is zero, then create a non-expiring lock. * Else, the lock will expire at @a expiration_date. * - * For each path in @a targets @a lock_callback will be invoked + * For each path in @a lock_targets @a lock_callback will be invoked * passing @a lock_baton and the lock and error that apply to path. - * @a lock_callback can be NULL in which case it is not called. + * @a lock_callback can be NULL in which case it is not called and any + * errors that would have been passed to the callback are not reported. * * The lock and path passed to @a lock_callback will be allocated in * @a result_pool. Use @a scratch_pool for temporary allocations. * * @note At this time, only files can be locked. * + * @note This function is not atomic. If it returns an error, some targets + * may remain unlocked while others may have been locked. + * * @note You probably don't want to use this directly. Take a look at * svn_repos_fs_lock_many() instead. * @@ -2713,7 +2765,7 @@ typedef svn_error_t *(*svn_fs_lock_callb */ svn_error_t * svn_fs_lock_many(svn_fs_t *fs, - apr_hash_t *targets, + apr_hash_t *lock_targets, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, @@ -2753,10 +2805,10 @@ svn_fs_generate_lock_token(const char ** apr_pool_t *pool); -/** Remove the locks on the paths in @a targets in @a fs. +/** Remove the locks on the paths in @a unlock_targets in @a fs. * * The paths to be unlocked are passed as <tt>const char *</tt> keys - * of the @a targets hash with the corresponding lock tokens as + * of the @a unlock_targets hash with the corresponding lock tokens as * <tt>const char *</tt> values. If the token doesn't point to a * lock, yield an #SVN_ERR_FS_BAD_LOCK_TOKEN error for this path. If * the token points to an expired lock, yield an @@ -2770,14 +2822,18 @@ svn_fs_generate_lock_token(const char ** * however, don't return error; allow the lock to be "broken" in any * case. In the latter case, the token shall be @c NULL. * - * For each path in @a targets @a lock_callback will be invoked + * For each path in @a unlock_targets @a lock_callback will be invoked * passing @a lock_baton and error that apply to path. The @a lock * passed to the callback will be NULL. @a lock_callback can be NULL - * in which case it is not called. + * in which case it is not called and any errors that would have been + * passed to the callback are not reported. * * The path passed to lock_callback will be allocated in @a result_pool. * Use @a scratch_pool for temporary allocations. * + * @note This function is not atomic. If it returns an error, some targets + * may remain locked while others may have been unlocked. + * * @note You probably don't want to use this directly. Take a look at * svn_repos_fs_unlock_many() instead. * @@ -2785,7 +2841,7 @@ svn_fs_generate_lock_token(const char ** */ svn_error_t * svn_fs_unlock_many(svn_fs_t *fs, - apr_hash_t *targets, + apr_hash_t *unlock_targets, svn_boolean_t break_lock, svn_fs_lock_callback_t lock_callback, void *lock_baton, @@ -3045,7 +3101,7 @@ typedef struct svn_fs_fsfs_info_t { * @note Zero (0) if (but not iff) the format does not support packing. */ svn_revnum_t min_unpacked_rev; - /* TRUE if logical addressing is enabled for this repository. + /** TRUE if logical addressing is enabled for this repository. * FALSE if repository uses physical addressing. */ svn_boolean_t log_addressing; /* ### TODO: information about fsfs.conf? rep-cache.db? write locks? */ @@ -3080,10 +3136,10 @@ typedef struct svn_fs_fsx_info_t { } svn_fs_fsx_info_t; -/** @see svn_fs_info() +/** @see svn_fs_info * @since New in 1.9. */ typedef struct svn_fs_info_placeholder_t { - /** @see svn_fs_type() */ + /** @see svn_fs_type */ const char *fs_type; /* Do not add new fields here, to maintain compatibility with the first @@ -3093,10 +3149,11 @@ typedef struct svn_fs_info_placeholder_t /** * Set @a *fs_info to a struct describing @a fs. The type of the * struct depends on the backend: for #SVN_FS_TYPE_FSFS, the struct will be - * of type #svn_fs_fsfs_info_t; otherwise, the struct is guaranteed to be + * of type #svn_fs_fsfs_info_t; for #SVN_FS_TYPE_FSX, it will be of type + * #svn_fs_fsx_info_t; otherwise, the struct is guaranteed to be * (compatible with) #svn_fs_info_placeholder_t. * - * @see #svn_fs_fsfs_info_t + * @see #svn_fs_fsfs_info_t, #svn_fs_fsx_info_t * * @since New in 1.9. */ @@ -3107,10 +3164,11 @@ svn_fs_info(const svn_fs_info_placeholde apr_pool_t *scratch_pool); /** - * Return a duplicate of @a info, allocated in @a pool. The returned struct - * will be of the same type as the passed-in struct, which itself must have - * been returned from svn_fs_info() or svn_fs_info_dup(). No part of the new - * structure will be shared with @a info (except static string constants). + * Return a duplicate of @a info, allocated in @a result_pool. The returned + * struct will be of the same type as the passed-in struct, which itself + * must have been returned from svn_fs_info() or svn_fs_info_dup(). No part + * of the new structure will be shared with @a info (except static string + * constants). Use @a scratch_pool for temporary allocations. * * @see #svn_fs_info_placeholder_t, #svn_fs_fsfs_info_t *
Modified: subversion/branches/fsx-1.10/subversion/include/svn_hash.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_hash.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_hash.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_hash.h Sun Jun 14 20:58:10 2015 @@ -239,19 +239,44 @@ svn_hash_from_cstring_keys(apr_hash_t ** const apr_array_header_t *keys, apr_pool_t *pool); +/* For the Subversion developers, this #define makes the svn_hash_gets and + * svn_hash_sets macros forward their parameters through functions in order to + * gain type checking for the 'key' parameter which the basic apr_hash_* APIs + * declare only as 'void *'. + */ +#ifdef SVN_DEBUG +#define SVN_HASH__GETS_SETS +#endif + +#ifdef SVN_HASH__GETS_SETS +void * +svn_hash__gets(apr_hash_t *ht, const char *key); + +#define svn_hash_gets(ht, key) \ + svn_hash__gets(ht, key) +#else /** Shortcut for apr_hash_get() with a const char * key. * * @since New in 1.8. */ #define svn_hash_gets(ht, key) \ apr_hash_get(ht, key, APR_HASH_KEY_STRING) +#endif + +#ifdef SVN_HASH__GETS_SETS +void +svn_hash__sets(apr_hash_t *ht, const char *key, const void *value); +#define svn_hash_sets(ht, key, val) \ + svn_hash__sets(ht, key, val) +#else /** Shortcut for apr_hash_set() with a const char * key. * * @since New in 1.8. */ #define svn_hash_sets(ht, key, val) \ apr_hash_set(ht, key, APR_HASH_KEY_STRING, val) +#endif /** @} */ Modified: subversion/branches/fsx-1.10/subversion/include/svn_io.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_io.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_io.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_io.h Sun Jun 14 20:58:10 2015 @@ -689,11 +689,9 @@ svn_io_files_contents_three_same_p(svn_b * closing the file, attempt to delete the file before returning the error. * * Write the data in 'binary' mode (#APR_FOPEN_BINARY). If @a contents - * is null, create an empty file. + * is @c NULL, create an empty file. * * Use @a pool for memory allocations. - * - * @since */ svn_error_t * svn_io_file_create(const char *file, @@ -707,9 +705,9 @@ svn_io_file_create(const char *file, * closing the file, attempt to delete the file before returning the error. * * Write the data in 'binary' mode (#APR_FOPEN_BINARY). If @a length is - * zero, create an empty file; in this case @a contents may be null. + * zero, create an empty file; in this case @a contents may be @c NULL. * - * Use @a pool for memory allocations. + * Use @a scratch_pool for temporary allocations. * * @since New in 1.9. */ @@ -717,20 +715,20 @@ svn_error_t * svn_io_file_create_bytes(const char *file, const void *contents, apr_size_t length, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** Create an empty file at utf8-encoded path @a file. - * + * * @a file must not already exist. If an error occurs while * closing the file, attempt to delete the file before returning the error. * - * Use @a pool for memory allocations. + * Use @a scratch_pool for temporary allocations. * * @since New in 1.9. */ svn_error_t * svn_io_file_create_empty(const char *file, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** * Lock file at @a lock_file. If @a exclusive is TRUE, @@ -1131,8 +1129,8 @@ svn_error_t * svn_stream_for_stdout(svn_stream_t **out, apr_pool_t *pool); -/** Set @a *str to a string buffer allocated in @a pool that contains all - * data from the current position in @a stream to its end. @a len_hint +/** Set @a *str to a string buffer allocated in @a result_pool that contains + * all data from the current position in @a stream to its end. @a len_hint * specifies the initial capacity of the string buffer and may be 0. The * buffer gets automatically resized to fit the actual amount of data being * read from @a stream. @@ -1143,7 +1141,7 @@ svn_error_t * svn_stringbuf_from_stream(svn_stringbuf_t **str, svn_stream_t *stream, apr_size_t len_hint, - apr_pool_t *pool); + apr_pool_t *result_pool); /** Return a generic stream connected to stringbuf @a str. Allocate the * stream in @a pool. @@ -2177,6 +2175,18 @@ svn_io_file_info_get(apr_finfo_t *finfo, apr_pool_t *pool); +/** Set @a *filesize_p to the size of @a file. Use @a pool for temporary + * allocations. + * + * @note Use svn_io_file_info_get() to get more information about + * apr_file_t. + * + * @since New in 1.10 + */ +svn_error_t * +svn_io_file_size_get(svn_filesize_t *filesize_p, apr_file_t *file, + apr_pool_t *pool); + /** Wrapper for apr_file_read(). */ svn_error_t * svn_io_file_read(apr_file_t *file, @@ -2227,12 +2237,12 @@ svn_io_file_seek(apr_file_t *file, * internal data buffer to @a block_size bytes and to read data aligned to * multiples of that value. The beginning of the block will be returned * in @a buffer_start, if that is not NULL. - * Uses @a pool for temporary allocations. + * Uses @a scratch_pool for temporary allocations. * - * @note Due to limitations of the APR API, in particular pre-1.3 APR, - * the alignment may not be successful. If you never use any other seek - * function on @a file, you are, however, virtually guaranteed to get at - * least 4kByte alignments for all reads. + * @note Due to limitations of the APR API, the alignment may not be + * successful. If you never use any other seek function on @a file, + * however, you are virtually guaranteed to get at least 4kByte alignment + * for all reads. * * @note Calling this for non-buffered files is legal but inefficient. * @@ -2243,7 +2253,7 @@ svn_io_file_aligned_seek(apr_file_t *fil apr_off_t block_size, apr_off_t *buffer_start, apr_off_t offset, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** Wrapper for apr_file_write(). */ svn_error_t * Modified: subversion/branches/fsx-1.10/subversion/include/svn_opt.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_opt.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_opt.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_opt.h Sun Jun 14 20:58:10 2015 @@ -24,8 +24,8 @@ * @brief Option and argument parsing for Subversion command lines */ -#ifndef SVN_OPTS_H -#define SVN_OPTS_H +#ifndef SVN_OPT_H +#define SVN_OPT_H #include <apr.h> #include <apr_pools.h> @@ -780,4 +780,4 @@ svn_opt_print_help(apr_getopt_t *os, } #endif /* __cplusplus */ -#endif /* SVN_OPTS_H */ +#endif /* SVN_OPT_H */ Modified: subversion/branches/fsx-1.10/subversion/include/svn_props.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_props.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_props.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_props.h Sun Jun 14 20:58:10 2015 @@ -440,13 +440,20 @@ svn_prop_name_is_valid(const char *prop_ * @verbatim /trunk: 1-6,9,37-38 /trunk/foo: 10 @endverbatim + * @since New in 1.5. */ #define SVN_PROP_MERGEINFO SVN_PROP_PREFIX "mergeinfo" -/** Property used to record inheritable configuration auto-props. */ +/** Property used to record inheritable configuration auto-props. + * + * @since New in 1.8. + */ #define SVN_PROP_INHERITABLE_AUTO_PROPS SVN_PROP_PREFIX "auto-props" -/** Property used to record inheritable configuration ignores. */ +/** Property used to record inheritable configuration ignores. + * + * @since New in 1.8. + */ #define SVN_PROP_INHERITABLE_IGNORES SVN_PROP_PREFIX "global-ignores" /** Meta-data properties. Modified: subversion/branches/fsx-1.10/subversion/include/svn_ra.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_ra.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_ra.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_ra.h Sun Jun 14 20:58:10 2015 @@ -289,7 +289,7 @@ typedef svn_boolean_t (*svn_ra_check_tun * This function will be called when the pool that owns the tunnel * connection is cleared or destroyed. * - * @a tunnel_context is the baton as returned from the + * @a close_baton is the baton as returned from the * svn_ra_open_tunnel_func_t. * * @a tunnel_baton was returned by the open-tunnel callback. @@ -1094,11 +1094,10 @@ svn_ra_get_file(svn_ra_session_t *sessio * callers want to know, and some don't.) * * If @a props is non @c NULL, set @a *props to contain the properties of - * the directory. This means @em all properties: not just ones controlled by - * the user and stored in the repository fs, but non-tweakable ones - * generated by the SCM system itself (e.g. 'wcprops', 'entryprops', - * etc.) The keys are <tt>const char *</tt>, values are - * <tt>@c svn_string_t *</tt>. + * the directory, including properties that are non-tweakable and + * generated by the SCM system itself (such as #svn_prop_wc_kind and + * #svn_prop_entry_kind properties). The keys are <tt>const char *</tt>, + * values are <tt>@c svn_string_t *</tt>. * * @since New in 1.4. */ @@ -1551,7 +1550,7 @@ svn_ra_do_diff(svn_ra_session_t *session * revisions in which at least one of @a paths was changed (i.e., if * file, text or props changed; if dir, props changed or an entry * was added or deleted). Each path is an <tt>const char *</tt>, relative - * to the @a session's common parent. + * to the repository root of @a session. * * If @a limit is greater than zero only invoke @a receiver on the first * @a limit logs. @@ -1718,9 +1717,10 @@ svn_ra_get_repos_root(svn_ra_session_t * /** * Set @a *locations to the locations (at the repository revisions * @a location_revisions) of the file identified by @a path in - * @a peg_revision. @a path is relative to the URL to which - * @a session was opened. @a location_revisions is an array of - * @c svn_revnum_t's. @a *locations will be a mapping from the revisions to + * @a peg_revision (passing @c SVN_INVALID_REVNUM is an error). + * @a path is relative to the URL to which @a session was opened. + * @a location_revisions is an array of @c svn_revnum_t's. + * @a *locations will be a mapping from the revisions to * their appropriate absolute paths. If the file doesn't exist in a * location_revision, that revision will be ignored. * @@ -1797,7 +1797,7 @@ svn_ra_get_location_segments(svn_ra_sess * to support reversion of the revision range for @a include_merged_revision * @c FALSE reporting by switching @a end with @a start. * - * @note Prior to Subversion 1.9, this function may accept delta handlers + * @note Prior to Subversion 1.9, this function may request delta handlers * from @a handler even for empty text deltas. Starting with 1.9, the * delta handler / baton return arguments passed to @a handler will be * #NULL unless there is an actual difference in the file contents between @@ -1967,7 +1967,7 @@ svn_ra_get_locks(svn_ra_session_t *sessi /** * Replay the changes from a range of revisions between @a start_revision - * and @a end_revision. + * and @a end_revision (inclusive). * * When receiving information for one revision, a callback @a revstart_func is * called; this callback will provide an editor and baton through which the Modified: subversion/branches/fsx-1.10/subversion/include/svn_repos.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_repos.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_repos.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_repos.h Sun Jun 14 20:58:10 2015 @@ -250,7 +250,7 @@ typedef enum svn_repos_notify_action_t svn_repos_notify_hotcopy_rev_range } svn_repos_notify_action_t; -/** The type of error occurring. +/** The type of warning occurring. * * @since New in 1.7. */ @@ -559,15 +559,18 @@ svn_repos_has_capability(svn_repos_t *re apr_pool_t *pool); /** - * Return a set capabilities supported by the running Subversion library and by - * @a repos. (Capabilities supported by this version of Subversion but not by - * @a repos are not listed. This may happen when svn_repos_upgrade2() has not - * been called after a software upgrade.) + * Return a set of @a capabilities supported by the running Subversion + * library and by @a repos. (Capabilities supported by this version of + * Subversion but not by @a repos are not listed. This may happen when + * svn_repos_upgrade2() has not been called after a software upgrade.) * - * The set is represented as a hash whose keys are the set members. The values - * are not defined. + * The set is represented as a hash whose const char * keys are the set + * members. The values are not defined. * - * @see svn_repos_info_format() + * Allocate @a capabilities in @a result_pool and use @a scratch_pool for + * temporary allocations. + * + * @see svn_repos_info_format * * @since New in 1.9. */ @@ -626,12 +629,15 @@ svn_fs_t * svn_repos_fs(svn_repos_t *repos); /** Return the type of filesystem associated with repository object - * @a repos allocated in @a pool. + * @a repos allocated in @a result_pool. + * + * @see #svn_fs_backend_names * * @since New in 1.9. */ const char * -svn_repos_fs_type(svn_repos_t *repos, apr_pool_t *pool); +svn_repos_fs_type(svn_repos_t *repos, + apr_pool_t *result_pool); /** Make a hot copy of the Subversion repository found at @a src_path * to @a dst_path. @@ -650,10 +656,16 @@ svn_repos_fs_type(svn_repos_t *repos, ap * called with the @a notify_baton and a notification structure containing * appropriate values in @c start_revision and @c end_revision (both * inclusive). @c start_revision might be equal to @c end_revision in - * case the copied range consists of a single revision. Currently, this - * notification is only supported for FSFS repositories. @a notify_func + * case the copied range consists of a single revision. Currently, this + * notification is not triggered by the BDB backend. @a notify_func * may be @c NULL if this notification is not required. * + * The optional @a cancel_func callback will be invoked with + * @a cancel_baton as usual to allow the user to preempt this potentially + * lengthy operation. + * + * Use @a scratch_pool for temporary allocations. + * * @since New in 1.9. */ svn_error_t * @@ -665,7 +677,7 @@ svn_repos_hotcopy3(const char *src_path, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, - apr_pool_t *pool); + apr_pool_t *scratch_pool); /** * Like svn_repos_hotcopy3(), but with @a notify_func and @a notify_baton @@ -1522,19 +1534,20 @@ svn_repos_replay(svn_fs_root_t *root, * If @a commit_callback is non-NULL, then before @c close_edit returns (but * after the commit has succeeded) @c close_edit will invoke * @a commit_callback with a filled-in #svn_commit_info_t *, @a commit_baton, - * and @a pool or some subpool thereof as arguments. If @a commit_callback + * and @a pool or some subpool thereof as arguments. The @c repos_root field + * of the #svn_commit_info_t is @c NULL. If @a commit_callback * returns an error, that error will be returned from @c close_edit, * otherwise if there was a post-commit hook failure, then that error * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED. - * (Note that prior to Subversion 1.6, @a commit_callback cannot be NULL; if - * you don't need a callback, pass a dummy function.) + * (Note that prior to Subversion 1.6, @a commit_callback cannot be @c NULL; + * if you don't need a callback, pass a dummy function.) * * Calling @a (*editor)->abort_edit aborts the commit, and will also * abort the commit transaction unless @a txn was supplied (not @c * NULL). Callers who supply their own transactions are responsible * for cleaning them up (either by committing them, or aborting them). * - * @since New in 1.5. + * @since New in 1.5. Since 1.6, @a commit_callback can be @c NULL. * * @note Yes, @a repos_url_decoded is a <em>decoded</em> URL. We realize * that's sorta wonky. Sorry about that. @@ -2082,7 +2095,7 @@ svn_repos_fs_get_mergeinfo(svn_mergeinfo * the revision range for @a include_merged_revision @c FALSE reporting by * switching @a start with @a end. * - * @note Prior to Subversion 1.9, this function may accept delta handlers + * @note Prior to Subversion 1.9, this function may request delta handlers * from @a handler even for empty text deltas. Starting with 1.9, the * delta handler / baton return arguments passed to @a handler will be * #NULL unless there is an actual difference in the file contents between @@ -2252,10 +2265,12 @@ svn_repos_fs_begin_txn_for_update(svn_fs * The pre-lock is run for every path in @a targets. Those targets for * which the pre-lock is successful are passed to svn_fs_lock_many and * the post-lock is run for those that are successfully locked. + * Pre-lock hook errors are passed to @a lock_callback. * * For each path in @a targets @a lock_callback will be invoked * passing @a lock_baton and the lock and error that apply to path. - * @a lock_callback can be NULL in which case it is not called. + * @a lock_callback can be NULL in which case it is not called and any + * errors that would have been passed to the callback are not reported. * * If an error occurs when running the post-lock hook the error is * returned wrapped with #SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED. If the @@ -2268,11 +2283,16 @@ svn_repos_fs_begin_txn_for_update(svn_fs * The lock and path passed to @a lock_callback will be allocated in * @a result_pool. Use @a scratch_pool for temporary allocations. * + * @note This function is not atomic. If it returns an error, some targets + * may remain unlocked while others may have been locked. + * + * @see svn_fs_lock_many + * * @since New in 1.9. */ svn_error_t * svn_repos_fs_lock_many(svn_repos_t *repos, - apr_hash_t *targets, + apr_hash_t *lock_targets, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, @@ -2305,12 +2325,14 @@ svn_repos_fs_lock(svn_lock_t **lock, * The pre-unlock hook is run for every path in @a targets. Those * targets for which the pre-unlock is successful are passed to * svn_fs_unlock_many and the post-unlock is run for those that are - * successfully unlocked. + * successfully unlocked. Pre-unlock hook errors are passed to @a + * lock_callback. * * For each path in @a targets @a lock_callback will be invoked * passing @a lock_baton and error that apply to path. The lock * passed to the callback will be NULL. @a lock_callback can be NULL - * in which case it is not called. + * in which case it is not called and any errors that would have been + * passed to the callback are not reported. * * If an error occurs when running the post-unlock hook, return the * original error wrapped with #SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED. @@ -2320,11 +2342,16 @@ svn_repos_fs_lock(svn_lock_t **lock, * The path passed to @a lock_callback will be allocated in @a result_pool. * Use @a scratch_pool for temporary allocations. * + * @note This function is not atomic. If it returns an error, some targets + * may remain locked while others may have been unlocked. + * + * @see svn_fs_unlock_many + * * @since New in 1.9. */ svn_error_t * svn_repos_fs_unlock_many(svn_repos_t *repos, - apr_hash_t *targets, + apr_hash_t *unlock_targets, svn_boolean_t break_lock, svn_fs_lock_callback_t lock_callback, void *lock_baton, @@ -2701,12 +2728,13 @@ svn_repos_node_from_baton(void *edit_bat * * Set @a *repos_format to the repository format number of @a repos, which is * an integer that increases when incompatible changes are made (such as - * by #svn_repos_upgrade). + * by #svn_repos_upgrade2). * - * Set @a *supports_version to the version number of the minimum Subversion GA - * release that can read and write @a repos. + * Set @a *supports_version to the version number of the minimum Subversion + * GA release that can read and write @a repos; allocate it in + * @a result_pool. Use @a scratch_pool for temporary allocations. * - * @see svn_fs_info_format(), svn_repos_capabilities() + * @see svn_fs_info_format, svn_repos_capabilities * * @since New in 1.9. */ @@ -3749,7 +3777,7 @@ svn_repos_authz_check_access(svn_authz_t typedef enum svn_repos_revision_access_level_t { /** no access allowed to the revision properties and all changed-paths - * information. */ + * information. */ svn_repos_revision_access_none, /** access granted to some (svn:date and svn:author) revision properties and * changed-paths information on paths the read has access to. */ Modified: subversion/branches/fsx-1.10/subversion/include/svn_string.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_string.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_string.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_string.h Sun Jun 14 20:58:10 2015 @@ -305,7 +305,7 @@ svn_stringbuf_fillchar(svn_stringbuf_t * * The advantages extend beyond the actual call because the reduced * register pressure allows for more optimization within the caller. * - * reallocs if necessary. @a targetstr is affected, nothing else is. + * Reallocs if necessary. @a targetstr is affected, nothing else is. * @since New in 1.7. */ void @@ -314,7 +314,7 @@ svn_stringbuf_appendbyte(svn_stringbuf_t /** Append the array of bytes @a bytes of length @a count onto @a targetstr. * - * reallocs if necessary. @a targetstr is affected, nothing else is. + * Reallocs if necessary. @a targetstr is affected, nothing else is. * * @since 1.9 @a bytes can be NULL if @a count is zero. */ @@ -325,7 +325,7 @@ svn_stringbuf_appendbytes(svn_stringbuf_ /** Append @a byte @a count times onto @a targetstr. * - * reallocs if necessary. @a targetstr is affected, nothing else is. + * Reallocs if necessary. @a targetstr is affected, nothing else is. * @since New in 1.9. */ void @@ -335,7 +335,7 @@ svn_stringbuf_appendfill(svn_stringbuf_t /** Append the stringbuf @c appendstr onto @a targetstr. * - * reallocs if necessary. @a targetstr is affected, nothing else is. + * Reallocs if necessary. @a targetstr is affected, nothing else is. */ void svn_stringbuf_appendstr(svn_stringbuf_t *targetstr, @@ -343,7 +343,7 @@ svn_stringbuf_appendstr(svn_stringbuf_t /** Append the C string @a cstr onto @a targetstr. * - * reallocs if necessary. @a targetstr is affected, nothing else is. + * Reallocs if necessary. @a targetstr is affected, nothing else is. */ void svn_stringbuf_appendcstr(svn_stringbuf_t *targetstr, @@ -443,7 +443,7 @@ svn_string_compare_stringbuf(const svn_s */ /** Divide @a input into substrings, interpreting any char from @a sep - * as a token separator. + * as a token separator. * * Return an array of copies of those substrings (plain const char*), * allocating both the array and the copies in @a pool. Modified: subversion/branches/fsx-1.10/subversion/include/svn_types.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_types.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_types.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_types.h Sun Jun 14 20:58:10 2015 @@ -150,17 +150,22 @@ typedef int svn_boolean_t; -/** Declaration of the null pointer constant type. +/* Declaration of a unique type, never defined, for the SVN_VA_NULL macro. * - * @since New in 1.9. + * NOTE: Private. Not for direct use by third-party code. */ -struct svn_null_pointer_constant_stdarg_sentinel_t; +struct svn__null_pointer_constant_stdarg_sentinel_t; /** Null pointer constant used as a sentinel in variable argument lists. * + * Use of this macro ensures that the argument is of the correct size when a + * pointer is expected. (The macro @c NULL is not defined as a pointer on + * all systems, and the arguments to variadic functions are not converted + * automatically to the expected type.) + * * @since New in 1.9. */ -#define SVN_VA_NULL ((struct svn_null_pointer_constant_stdarg_sentinel_t*)0) +#define SVN_VA_NULL ((struct svn__null_pointer_constant_stdarg_sentinel_t*)0) /* See? (char*)NULL -- They have the same length, but the cast looks ugly. */ Modified: subversion/branches/fsx-1.10/subversion/include/svn_version.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_version.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_version.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_version.h Sun Jun 14 20:58:10 2015 @@ -61,7 +61,7 @@ extern "C" { * Modify when new functionality is added or new interfaces are * defined, but all changes are backward compatible. */ -#define SVN_VER_MINOR 9 +#define SVN_VER_MINOR 10 /** * Patch number. Modified: subversion/branches/fsx-1.10/subversion/include/svn_wc.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_wc.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_wc.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_wc.h Sun Jun 14 20:58:10 2015 @@ -1859,11 +1859,11 @@ typedef struct svn_wc_conflict_descripti /** Info on the "merge-right source" or "their" version of incoming change. */ const svn_wc_conflict_version_t *src_right_version; - /* For property conflicts, the absolute path to the .prej file. + /** For property conflicts, the absolute path to the .prej file. * @since New in 1.9. */ const char *prop_reject_abspath; - /* For property conflicts, the local base value of the property, i.e. the + /** For property conflicts, the local base value of the property, i.e. the * value of the property as of the BASE revision of the working copy. * For conflicts created during update/switch this contains the * post-update/switch property value. The pre-update/switch value can @@ -1872,20 +1872,20 @@ typedef struct svn_wc_conflict_descripti * @since New in 1.9. */ const svn_string_t *prop_value_base; - /* For property conflicts, the local working value of the property, + /** For property conflicts, the local working value of the property, * i.e. the value of the property in the working copy, possibly with * local modiciations. * Only set if available, so might be @c NULL. * @since New in 1.9. */ const svn_string_t *prop_value_working; - /* For property conflicts, the incoming old value of the property, + /** For property conflicts, the incoming old value of the property, * i.e. the value the property had at @c src_left_version. * Only set if available, so might be @c NULL. * @since New in 1.9 */ const svn_string_t *prop_value_incoming_old; - /* For property conflicts, the incoming new value of the property, + /** For property conflicts, the incoming new value of the property, * i.e. the value the property had at @c src_right_version. * Only set if available, so might be @c NULL. * @since New in 1.9 */ @@ -1911,8 +1911,9 @@ typedef struct svn_wc_conflict_descripti /** The path that is in conflict (for a tree conflict, it is the victim) */ const char *path; - /** The node type of the path being operated on (for a tree conflict, - * ### which version?) */ + /** The local node type of the path being operated on (for a tree conflict, + * this specifies the local node kind, which may be (and typically is) + * different than the left and right kind) */ svn_node_kind_t node_kind; /** What sort of conflict are we describing? */ @@ -2063,7 +2064,7 @@ svn_wc_conflict_description_create_prop( * * Set the @c local_abspath field of the created struct to @a local_abspath * (which must be an absolute path), the @c kind field to - * #svn_wc_conflict_kind_tree, the @c local_node_kind to @a local_node_kind, + * #svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind, * the @c operation to @a operation, the @c src_left_version field to * @a src_left_version, and the @c src_right_version field to * @a src_right_version. @@ -2104,7 +2105,7 @@ svn_wc_conflict_description_create_tree( /** Return a duplicate of @a conflict, allocated in @a result_pool. * A deep copy of all members will be made. * - * @since New in 1.7. + * @since New in 1.9. */ svn_wc_conflict_description2_t * svn_wc_conflict_description2_dup( @@ -2131,8 +2132,11 @@ svn_wc__conflict_description2_dup( */ typedef enum svn_wc_conflict_choice_t { - /** Undefined; for internal use only. - This value is never returned in svn_wc_conflict_result_t. + /** Undefined; for private use only. + This value must never be returned in svn_wc_conflict_result_t, + but a separate value, unequal to all other pre-defined values may + be useful in conflict resolver implementations to signal that no + choice is made yet. * @since New in 1.9 */ svn_wc_conflict_choose_undefined = -1, @@ -2185,6 +2189,14 @@ typedef struct svn_wc_conflict_result_t NULL) in the user's working copy. */ svn_boolean_t save_merged; + /** If not NULL, this is the new merged property, used when choosing + * #svn_wc_conflict_choose_merged. This value is prefered over using + * merged_file. + * + * @since New in 1.9. + */ + const svn_string_t *merged_value; + } svn_wc_conflict_result_t; @@ -2194,7 +2206,8 @@ typedef struct svn_wc_conflict_result_t * * Set the @c choice field of the structure to @a choice, @c merged_file * to @a merged_file, and @c save_merged to false. Make only a shallow - * copy of the pointer argument @a merged_file. + * copy of the pointer argument @a merged_file. @a merged_file may be + * NULL if setting merged_file is not needed. * * @since New in 1.5. */ @@ -3826,6 +3839,13 @@ typedef struct svn_wc_status3_t * @since New in 1.8. */ svn_boolean_t file_external; + + /** The actual kind of the node in the working copy. May differ from + * @a kind on obstructions, deletes, etc. #svn_node_unknown if unavailable. + * + * @since New in 1.9 */ + svn_node_kind_t actual_kind; + /* NOTE! Please update svn_wc_dup_status3() when adding new fields here. */ } svn_wc_status3_t; @@ -4641,6 +4661,9 @@ svn_wc_delete(const char *path, * If @a local_abspath does not exist as file, directory or symlink, return * #SVN_ERR_WC_PATH_NOT_FOUND. * + * If @a notify_func is non-NULL, invoke it with @a notify_baton to report + * the item being added. + * * ### TODO: Split into add_dir, add_file, add_symlink? * * @since New in 1.9. @@ -4656,7 +4679,7 @@ svn_wc_add_from_disk3(svn_wc_context_t * /** * Similar to svn_wc_add_from_disk3(), but always passes FALSE for - * @a skip_som_prop_canon + * @a skip_checks * * @since New in 1.8. * @deprecated Provided for backward compatibility with the 1.8 API. @@ -7288,6 +7311,12 @@ svn_wc_get_pristine_copy_path(const char * points during the operation. If it returns an error (typically * #SVN_ERR_CANCELLED), return that error immediately. * + * If @a notify_func is non-NULL, invoke it with @a notify_baton to report + * the progress of the operation. + * + * @note In 1.9, @a notify_func does not get called at all. This may change + * in later releases. + * * @since New in 1.9. */ svn_error_t * Modified: subversion/branches/fsx-1.10/subversion/include/svn_x509.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/include/svn_x509.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/include/svn_x509.h (original) +++ subversion/branches/fsx-1.10/subversion/include/svn_x509.h Sun Jun 14 20:58:10 2015 @@ -188,7 +188,7 @@ svn_x509_certinfo_get_hostnames(const sv * Given an @a oid return a null-terminated C string representation. * For example an OID with the bytes "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x01" * would be converted to the string "1.2.840.113549.1.9.1". Returns - * NULL if the @oid can't be represented as a string. + * NULL if the @a oid can't be represented as a string. * * @since New in 1.9. */ const char * Modified: subversion/branches/fsx-1.10/subversion/libsvn_client/add.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_client/add.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/libsvn_client/add.c (original) +++ subversion/branches/fsx-1.10/subversion/libsvn_client/add.c Sun Jun 14 20:58:10 2015 @@ -768,59 +768,6 @@ svn_client__get_all_auto_props(apr_hash_ return SVN_NO_ERROR; } -svn_error_t *svn_client__get_inherited_ignores(apr_array_header_t **ignores, - const char *path_or_url, - svn_client_ctx_t *ctx, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) -{ - svn_opt_revision_t rev; - apr_hash_t *explicit_ignores; - apr_array_header_t *inherited_ignores; - svn_boolean_t target_is_url = svn_path_is_url(path_or_url); - svn_string_t *explicit_prop; - int i; - - if (target_is_url) - rev.kind = svn_opt_revision_head; - else - rev.kind = svn_opt_revision_working; - - SVN_ERR(svn_client_propget5(&explicit_ignores, &inherited_ignores, - SVN_PROP_INHERITABLE_IGNORES, path_or_url, - &rev, &rev, NULL, svn_depth_empty, NULL, ctx, - scratch_pool, scratch_pool)); - - explicit_prop = svn_hash_gets(explicit_ignores, path_or_url); - - if (explicit_prop) - { - svn_prop_inherited_item_t *new_iprop = - apr_palloc(scratch_pool, sizeof(*new_iprop)); - new_iprop->path_or_url = path_or_url; - new_iprop->prop_hash = apr_hash_make(scratch_pool); - svn_hash_sets(new_iprop->prop_hash, SVN_PROP_INHERITABLE_IGNORES, - explicit_prop); - APR_ARRAY_PUSH(inherited_ignores, - svn_prop_inherited_item_t *) = new_iprop; - } - - *ignores = apr_array_make(result_pool, 16, sizeof(const char *)); - - for (i = 0; i < inherited_ignores->nelts; i++) - { - svn_prop_inherited_item_t *elt = APR_ARRAY_IDX( - inherited_ignores, i, svn_prop_inherited_item_t *); - svn_string_t *ignore_val = svn_hash_gets(elt->prop_hash, - SVN_PROP_INHERITABLE_IGNORES); - if (ignore_val) - svn_cstring_split_append(*ignores, ignore_val->data, "\n\r\t\v ", - FALSE, result_pool); - } - - return SVN_NO_ERROR; -} - /* The main logic of the public svn_client_add5. * * EXISTING_PARENT_ABSPATH is the absolute path to the first existing Modified: subversion/branches/fsx-1.10/subversion/libsvn_client/blame.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_client/blame.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/libsvn_client/blame.c (original) +++ subversion/branches/fsx-1.10/subversion/libsvn_client/blame.c Sun Jun 14 20:58:10 2015 @@ -34,6 +34,7 @@ #include "svn_dirent_uri.h" #include "svn_path.h" #include "svn_props.h" +#include "svn_hash.h" #include "svn_sorts.h" #include "private/svn_wc_private.h" @@ -76,6 +77,7 @@ struct diff_baton { /* The baton used for a file revision. Lives the entire operation */ struct file_rev_baton { svn_revnum_t start_rev, end_rev; + svn_boolean_t backwards; const char *target; svn_client_ctx_t *ctx; const svn_diff_file_options_t *diff_options; @@ -96,6 +98,14 @@ struct file_rev_baton { /* pools for files which may need to persist for more than one rev. */ apr_pool_t *filepool; apr_pool_t *prevfilepool; + + svn_boolean_t check_mime_type; + + /* When blaming backwards we have to use the changes + on the *next* revision, as the interesting change + happens when we move to the previous revision */ + svn_revnum_t last_revnum; + apr_hash_t *last_props; }; /* The baton used by the txdelta window handler. Allocated per revision */ @@ -431,6 +441,26 @@ file_rev_handler(void *baton, const char /* Clear the current pool. */ svn_pool_clear(frb->currpool); + if (frb->check_mime_type) + { + apr_hash_t *props = svn_prop_array_to_hash(prop_diffs, frb->currpool); + const char *value; + + frb->check_mime_type = FALSE; /* Only check first */ + + value = svn_prop_get_value(props, SVN_PROP_MIME_TYPE); + + if (value && svn_mime_type_is_binary(value)) + { + return svn_error_createf( + SVN_ERR_CLIENT_IS_BINARY_FILE, NULL, + _("Cannot calculate blame information for binary file '%s'"), + (svn_path_is_url(frb->target) + ? frb->target + : svn_dirent_local_style(frb->target, pool))); + } + } + if (frb->ctx->notify_func2) { svn_wc_notify_t *notify @@ -489,18 +519,24 @@ file_rev_handler(void *baton, const char /* Create the rev structure. */ delta_baton->rev = apr_pcalloc(frb->mainpool, sizeof(struct rev)); - if (revnum < MIN(frb->start_rev, frb->end_rev)) + if (frb->backwards) { - /* We shouldn't get more than one revision before the starting - revision (unless of including merged revisions). */ - SVN_ERR_ASSERT((frb->last_filename == NULL) - || frb->include_merged_revisions); + /* Use from last round... + SVN_INVALID_REVNUM on first, which is exactly + what we want */ + delta_baton->rev->revision = frb->last_revnum; + delta_baton->rev->rev_props = frb->last_props; - /* The file existed before start_rev; generate no blame info for - lines from this revision (or before). */ - delta_baton->rev->revision = SVN_INVALID_REVNUM; + /* Store for next delta */ + if (revnum >= MIN(frb->start_rev, frb->end_rev)) + { + frb->last_revnum = revnum; + frb->last_props = svn_prop_hash_dup(rev_props, frb->mainpool); + } + /* Else: Not needed on last rev */ } - else + else if (merged_revision + || (revnum >= MIN(frb->start_rev, frb->end_rev))) { /* 1+ for the "youngest to oldest" blame */ SVN_ERR_ASSERT(revnum <= 1 + MAX(frb->end_rev, frb->start_rev)); @@ -509,6 +545,20 @@ file_rev_handler(void *baton, const char delta_baton->rev->revision = revnum; delta_baton->rev->rev_props = svn_prop_hash_dup(rev_props, frb->mainpool); } + else + { + /* We shouldn't get more than one revision outside the + specified range (unless we alsoe receive merged revisions) */ + SVN_ERR_ASSERT((frb->last_filename == NULL) + || frb->include_merged_revisions); + + /* The file existed before start_rev; generate no blame info for + lines from this revision (or before). + + This revision specifies the state as it was at the start revision */ + + delta_baton->rev->revision = SVN_INVALID_REVNUM; + } if (frb->include_merged_revisions) delta_baton->rev->path = apr_pstrdup(frb->mainpool, path); @@ -626,7 +676,6 @@ svn_client_blame5(const char *target, svn_stream_t *last_stream; svn_stream_t *stream; const char *target_abspath_or_url; - svn_revnum_t youngest; if (start->kind == svn_opt_revision_unspecified || end->kind == svn_opt_revision_unspecified) @@ -662,35 +711,54 @@ svn_client_blame5(const char *target, target, peg_revision, &younger_end, ctx, pool)); - + /* Make the session point to the real URL. */ SVN_ERR(svn_ra_reparent(ra_session, loc->url, pool)); } /* We check the mime-type of the yougest revision before getting all the older revisions. */ - if (!ignore_mime_type) + if (!ignore_mime_type + && start_revnum < end_revnum) { apr_hash_t *props; - apr_hash_index_t *hi; + const char *mime_type = NULL; + + if (svn_path_is_url(target) + || start_revnum > end_revnum + || (end->kind != svn_opt_revision_working + && end->kind != svn_opt_revision_base)) + { + SVN_ERR(svn_ra_get_file(ra_session, "", end_revnum, NULL, NULL, + &props, pool)); - SVN_ERR(svn_client_propget5(&props, NULL, SVN_PROP_MIME_TYPE, - target_abspath_or_url, peg_revision, - end, NULL, svn_depth_empty, NULL, ctx, - pool, pool)); - - /* props could be keyed on URLs or paths depending on the - peg_revision and end values so avoid using the key. */ - hi = apr_hash_first(pool, props); - if (hi) + mime_type = svn_prop_get_value(props, SVN_PROP_MIME_TYPE); + } + else { - svn_string_t *value; + const svn_string_t *value; + + if (end->kind == svn_opt_revision_working) + SVN_ERR(svn_wc_prop_get2(&value, ctx->wc_ctx, + target_abspath_or_url, + SVN_PROP_MIME_TYPE, + pool, pool)); + else + { + SVN_ERR(svn_wc_get_pristine_props(&props, ctx->wc_ctx, + target_abspath_or_url, + pool, pool)); + + value = props ? svn_hash_gets(props, SVN_PROP_MIME_TYPE) + : NULL; + } - /* Should only be one value */ - SVN_ERR_ASSERT(apr_hash_count(props) == 1); + mime_type = value ? value->data : NULL; + } - value = apr_hash_this_val(hi); - if (value && svn_mime_type_is_binary(value->data)) + if (mime_type) + { + if (svn_mime_type_is_binary(mime_type)) return svn_error_createf (SVN_ERR_CLIENT_IS_BINARY_FILE, 0, _("Cannot calculate blame information for binary file '%s'"), @@ -719,6 +787,10 @@ svn_client_blame5(const char *target, frb.merged_chain->avail = NULL; frb.merged_chain->pool = pool; } + frb.backwards = (frb.start_rev > frb.end_rev); + frb.last_revnum = SVN_INVALID_REVNUM; + frb.last_props = NULL; + frb.check_mime_type = (frb.backwards && !ignore_mime_type); SVN_ERR(svn_ra_get_repos_root2(ra_session, &frb.repos_root_url, pool)); @@ -738,12 +810,11 @@ svn_client_blame5(const char *target, We need to ensure that we get one revision before the start_rev, if available so that we can know what was actually changed in the start revision. */ - SVN_ERR(svn_ra_get_latest_revnum(ra_session, &youngest, frb.currpool)); SVN_ERR(svn_ra_get_file_revs2(ra_session, "", - start_revnum - - (0 < start_revnum && start_revnum <= end_revnum ? 1 : 0) - + (youngest > start_revnum && start_revnum > end_revnum ? 1 : 0), - end_revnum, include_merged_revisions, + frb.backwards ? start_revnum + : MAX(0, start_revnum-1), + end_revnum, + include_merged_revisions, file_rev_handler, &frb, pool)); if (end->kind == svn_opt_revision_working) Modified: subversion/branches/fsx-1.10/subversion/libsvn_client/client.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_client/client.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/libsvn_client/client.h (original) +++ subversion/branches/fsx-1.10/subversion/libsvn_client/client.h Sun Jun 14 20:58:10 2015 @@ -73,52 +73,6 @@ typedef struct svn_client__private_ctx_t svn_client__private_ctx_t * svn_client__get_private_ctx(svn_client_ctx_t *ctx); - -/* Set *REVNUM to the revision number identified by REVISION. - - If REVISION->kind is svn_opt_revision_number, just use - REVISION->value.number, ignoring LOCAL_ABSPATH and RA_SESSION. - - Else if REVISION->kind is svn_opt_revision_committed, - svn_opt_revision_previous, or svn_opt_revision_base, or - svn_opt_revision_working, then the revision can be identified - purely based on the working copy's administrative information for - LOCAL_ABSPATH, so RA_SESSION is ignored. If LOCAL_ABSPATH is not - under revision control, return SVN_ERR_UNVERSIONED_RESOURCE, or if - LOCAL_ABSPATH is null, return SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED. - - Else if REVISION->kind is svn_opt_revision_date or - svn_opt_revision_head, then RA_SESSION is used to retrieve the - revision from the repository (using REVISION->value.date in the - former case), and LOCAL_ABSPATH is ignored. If RA_SESSION is null, - return SVN_ERR_CLIENT_RA_ACCESS_REQUIRED. - - Else if REVISION->kind is svn_opt_revision_unspecified, set - *REVNUM to SVN_INVALID_REVNUM. - - If YOUNGEST_REV is non-NULL, it is an in/out parameter. If - *YOUNGEST_REV is valid, use it as the youngest revision in the - repository (regardless of reality) -- don't bother to lookup the - true value for HEAD, and don't return any value in *REVNUM greater - than *YOUNGEST_REV. If *YOUNGEST_REV is not valid, and a HEAD - lookup is required to populate *REVNUM, then also populate - *YOUNGEST_REV with the result. This is useful for making multiple - serialized calls to this function with a basically static view of - the repository, avoiding race conditions which could occur between - multiple invocations with HEAD lookup requests. - - Else return SVN_ERR_CLIENT_BAD_REVISION. - - Use SCRATCH_POOL for any temporary allocation. */ -svn_error_t * -svn_client__get_revision_number(svn_revnum_t *revnum, - svn_revnum_t *youngest_rev, - svn_wc_context_t *wc_ctx, - const char *local_abspath, - svn_ra_session_t *ra_session, - const svn_opt_revision_t *revision, - apr_pool_t *scratch_pool); - /* Set *ORIGINAL_REPOS_RELPATH and *ORIGINAL_REVISION to the original location that served as the source of the copy from which PATH_OR_URL at REVISION was created, or NULL and SVN_INVALID_REVNUM (respectively) if PATH_OR_URL at @@ -455,17 +409,6 @@ svn_error_t *svn_client__get_all_auto_pr apr_pool_t *result_pool, apr_pool_t *scratch_pool); -/* Get a list of ignore patterns defined by the svn:global-ignores - properties set on, or inherited by, PATH_OR_URL. Store the collected - patterns as const char * elements in the array *IGNORES. Allocate - *IGNORES and its contents in RESULT_POOL. Use SCRATCH_POOL for - temporary allocations. */ -svn_error_t *svn_client__get_inherited_ignores(apr_array_header_t **ignores, - const char *path_or_url, - svn_client_ctx_t *ctx, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool); - /* The main logic for client deletion from a working copy. Deletes PATH from CTX->WC_CTX. If PATH (or any item below a directory PATH) is modified the delete will fail and return an error unless FORCE or KEEP_LOCAL @@ -959,11 +902,6 @@ svn_client__get_copy_committables(svn_cl apr_pool_t *result_pool, apr_pool_t *scratch_pool); -/* A qsort()-compatible sort routine for sorting an array of - svn_client_commit_item_t *'s by their URL member. */ -int svn_client__sort_commit_item_urls(const void *a, const void *b); - - /* Rewrite the COMMIT_ITEMS array to be sorted by URL. Also, discover a common *BASE_URL for the items in the array, and rewrite those items' URLs to be relative to that *BASE_URL. @@ -1208,6 +1146,41 @@ svn_client__arbitrary_nodes_diff(const c apr_pool_t *scratch_pool); +/* Helper for the remote case of svn_client_propget. + * + * If PROPS is not null, then get the value of property PROPNAME in + * REVNUM, using RA_SESSION. Store the value ('svn_string_t *') in + * PROPS, under the path key "TARGET_PREFIX/TARGET_RELATIVE" + * ('const char *'). + * + * If INHERITED_PROPS is not null, then set *INHERITED_PROPS to a + * depth-first ordered array of svn_prop_inherited_item_t * structures + * representing the PROPNAME properties inherited by the target. If + * INHERITABLE_PROPS in not null and no inheritable properties are found, + * then set *INHERITED_PROPS to an empty array. + * + * Recurse according to DEPTH, similarly to svn_client_propget3(). + * + * KIND is the kind of the node at "TARGET_PREFIX/TARGET_RELATIVE". + * Yes, caller passes this; it makes the recursion more efficient :-). + * + * Allocate PROPS and *INHERITED_PROPS in RESULT_POOL, but do all temporary + * work in SCRATCH_POOL. The two pools can be the same; recursive + * calls may use a different SCRATCH_POOL, however. + */ +svn_error_t * +svn_client__remote_propget(apr_hash_t *props, + apr_array_header_t **inherited_props, + const char *propname, + const char *target_prefix, + const char *target_relative, + svn_node_kind_t kind, + svn_revnum_t revnum, + svn_ra_session_t *ra_session, + svn_depth_t depth, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: subversion/branches/fsx-1.10/subversion/libsvn_client/commit.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_client/commit.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/libsvn_client/commit.c (original) +++ subversion/branches/fsx-1.10/subversion/libsvn_client/commit.c Sun Jun 14 20:58:10 2015 @@ -240,10 +240,12 @@ post_process_commit_item(svn_wc_committe loop_recurse = TRUE; remove_lock = (! keep_locks && (item->state_flags - & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN)); + & (SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN + | SVN_CLIENT_COMMIT_ITEM_ADD + | SVN_CLIENT_COMMIT_ITEM_DELETE))); - /* When the node was deleted (or replaced), we need to always remove the - locks, as they're invalidated on the server. We cannot honor the + /* When the node was deleted (or replaced), we need to always remove the + locks, as they're invalidated on the server. We cannot honor the SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN flag here because it does not tell us whether we have locked children. */ if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE) @@ -252,7 +254,7 @@ post_process_commit_item(svn_wc_committe return svn_error_trace( svn_wc_queue_committed4(queue, wc_ctx, item->path, loop_recurse, - 0 != (item->state_flags & + 0 != (item->state_flags & (SVN_CLIENT_COMMIT_ITEM_ADD | SVN_CLIENT_COMMIT_ITEM_DELETE | SVN_CLIENT_COMMIT_ITEM_TEXT_MODS @@ -537,6 +539,7 @@ svn_client_commit6(const apr_array_heade const char *current_abspath; const char *notify_prefix; int depth_empty_after = -1; + apr_hash_t *move_youngest = NULL; int i; SVN_ERR_ASSERT(depth != svn_depth_unknown && depth != svn_depth_exclude); @@ -707,62 +710,12 @@ svn_client_commit6(const apr_array_heade if (cmt_err) goto cleanup; - if (moved_from_abspath && delete_op_root_abspath && - strcmp(moved_from_abspath, delete_op_root_abspath) == 0) - + if (moved_from_abspath && delete_op_root_abspath) { - svn_boolean_t found_delete_half = - (svn_hash_gets(committables->by_path, delete_op_root_abspath) - != NULL); + svn_client_commit_item3_t *delete_half = + svn_hash_gets(committables->by_path, delete_op_root_abspath); - if (!found_delete_half) - { - const char *delete_half_parent_abspath; - - /* The delete-half isn't in the commit target list. - * However, it might itself be the child of a deleted node, - * either because of another move or a deletion. - * - * For example, consider: mv A/B B; mv B/C C; commit; - * C's moved-from A/B/C is a child of the deleted A/B. - * A/B/C does not appear in the commit target list, but - * A/B does appear. - * (Note that moved-from information is always stored - * relative to the BASE tree, so we have 'C moved-from - * A/B/C', not 'C moved-from B/C'.) - * - * An example involving a move and a delete would be: - * mv A/B C; rm A; commit; - * Now C is moved-from A/B which does not appear in the - * commit target list, but A does appear. - */ - - /* Scan upwards for a deletion op-root from the - * delete-half's parent directory. */ - delete_half_parent_abspath = - svn_dirent_dirname(delete_op_root_abspath, iterpool); - if (strcmp(delete_op_root_abspath, - delete_half_parent_abspath) != 0) - { - const char *parent_delete_op_root_abspath; - - cmt_err = svn_error_trace( - svn_wc__node_get_deleted_ancestor( - &parent_delete_op_root_abspath, - ctx->wc_ctx, delete_half_parent_abspath, - iterpool, iterpool)); - if (cmt_err) - goto cleanup; - - if (parent_delete_op_root_abspath) - found_delete_half = - (svn_hash_gets(committables->by_path, - parent_delete_op_root_abspath) - != NULL); - } - } - - if (!found_delete_half) + if (!delete_half) { cmt_err = svn_error_createf( SVN_ERR_ILLEGAL_TARGET, NULL, @@ -787,6 +740,17 @@ svn_client_commit6(const apr_array_heade goto cleanup; } + else if (delete_half->revision == item->copyfrom_rev) + { + /* Ok, now we know that we perform an out-of-date check + on the copyfrom location. Remember this for a fixup + round right before committing. */ + + if (!move_youngest) + move_youngest = apr_hash_make(pool); + + svn_hash_sets(move_youngest, item->path, item); + } } } @@ -885,6 +849,37 @@ svn_client_commit6(const apr_array_heade if (cmt_err) goto cleanup; + if (move_youngest != NULL) + { + apr_hash_index_t *hi; + svn_revnum_t youngest; + + SVN_ERR(svn_ra_get_latest_revnum(ra_session, &youngest, pool)); + + for (hi = apr_hash_first(iterpool, move_youngest); + hi; + hi = apr_hash_next(hi)) + { + svn_client_commit_item3_t *item = apr_hash_this_val(hi); + + /* We delete the original side with its original revision and will + receive an out-of-date error if that node changed since that + revision. + + The copy is of that same revision and we know that this revision + didn't change between this revision and youngest. So we can just + as well commit a copy from youngest. + + Note that it is still possible to see gaps between the delete and + copy revisions as the repository might handle multiple commits + at the same time (or when an out of date proxy is involved), but + in general it should decrease the number of gaps. */ + + if (item->copyfrom_rev < youngest) + item->copyfrom_rev = youngest; + } + } + cmt_err = svn_error_trace( get_ra_editor(&editor, &edit_baton, ra_session, ctx, log_msg, commit_items, revprop_table, Modified: subversion/branches/fsx-1.10/subversion/libsvn_client/commit_util.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_client/commit_util.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/libsvn_client/commit_util.c (original) +++ subversion/branches/fsx-1.10/subversion/libsvn_client/commit_util.c Sun Jun 14 20:58:10 2015 @@ -467,10 +467,12 @@ harvest_not_present_for_copy(svn_wc_cont apr_pool_t *iterpool = svn_pool_create(scratch_pool); int i; + SVN_ERR_ASSERT(commit_relpath != NULL); + /* A function to retrieve not present children would be nice to have */ - SVN_ERR(svn_wc__node_get_children_of_working_node( - &children, wc_ctx, local_abspath, TRUE, - scratch_pool, iterpool)); + SVN_ERR(svn_wc__node_get_not_present_children(&children, wc_ctx, + local_abspath, + scratch_pool, iterpool)); for (i = 0; i < children->nelts; i++) { @@ -486,13 +488,10 @@ harvest_not_present_for_copy(svn_wc_cont this_abspath, FALSE, scratch_pool)); if (!not_present) - continue; + continue; /* Node is replaced */ - if (commit_relpath == NULL) - this_commit_relpath = NULL; - else - this_commit_relpath = svn_relpath_join(commit_relpath, name, - iterpool); + this_commit_relpath = svn_relpath_join(commit_relpath, name, + iterpool); /* We should check if we should really add a delete operation */ if (check_url_func) @@ -1380,7 +1379,10 @@ svn_client__get_copy_committables(svn_cl } -int svn_client__sort_commit_item_urls(const void *a, const void *b) +/* A svn_sort__array()/qsort()-compatible sort routine for sorting + an array of svn_client_commit_item_t *'s by their URL member. */ +static int +sort_commit_item_urls(const void *a, const void *b) { const svn_client_commit_item3_t *item1 = *((const svn_client_commit_item3_t * const *) a); @@ -1404,7 +1406,7 @@ svn_client__condense_commit_items(const SVN_ERR_ASSERT(ci && ci->nelts); /* Sort our commit items by their URLs. */ - svn_sort__array(ci, svn_client__sort_commit_item_urls); + svn_sort__array(ci, sort_commit_item_urls); /* Loop through the URLs, finding the longest usable ancestor common to all of them, and making sure there are no duplicate URLs. */ @@ -1559,7 +1561,7 @@ do_item_commit(void **dir_baton, file_pool = pool; /* Subpools are cheap, but memory isn't */ - file_pool = svn_pool_create(file_pool); + file_pool = svn_pool_create(file_pool); /* Call the cancellation function. */ if (ctx->cancel_func)
