Modified: subversion/branches/addremove/subversion/include/svn_dirent_uri.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_dirent_uri.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_dirent_uri.h (original) +++ subversion/branches/addremove/subversion/include/svn_dirent_uri.h Sat May 23 14:16:56 2020 @@ -60,12 +60,14 @@ * form, except: * * - @c svn_dirent_canonicalize() + * - @c svn_dirent_canonicalize_safe() * - @c svn_dirent_is_canonical() * - @c svn_dirent_internal_style() * - @c svn_relpath_canonicalize() + * - @c svn_relpath_canonicalize_safe() * - @c svn_relpath_is_canonical() - * - @c svn_relpath__internal_style() * - @c svn_uri_canonicalize() + * - @c svn_uri_canonicalize_safe() * - @c svn_uri_is_canonical() * * The Subversion codebase also recognizes some other classes of path: @@ -144,17 +146,47 @@ extern "C" { #endif /* __cplusplus */ -/** Convert @a dirent from the local style to the canonical internal style. +/** + * Convert @a dirent from the local style to the canonical internal style. * "Local style" means native path separators and "." for the empty path. * * Allocate the result in @a result_pool. * + * @warning This function may call @c abort() if the @a dirent parameter + * is not a valid local-style path. + * Use svn_dirent_internal_style_safe() for tainted input. + * * @since New in 1.6. */ const char * svn_dirent_internal_style(const char *dirent, apr_pool_t *result_pool); +/** + * Convert @a dirent from the local style to the canonical internal style + * and return it in @a *internal_style_dirent. "Local style" means native + * path separators and "." for the empty path. + * + * Similar to svn_dirent_internal_style() (which see), but returns an error + * if the @a dirent can not be canonicalized or of the result does not pass + * the svn_dirent_is_canonical() test. + * + * If the function fails and @a non_canonical_result is not @c NULL, the + * result of the failed canonicalization attempt (which may be @c NULL) + * will be returned in @a *non_canonical_result. + * + * Allocates the results in @a result_pool. Uses @a scratch_pool for + * temporary allocations. + * + * @since New in 1.12. + */ +svn_error_t * +svn_dirent_internal_style_safe(const char **internal_style_dirent, + const char **non_canonical_result, + const char *dirent, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + /** Convert @a dirent from the internal style to the local style. * "Local style" means native path separators and "." for the empty path. * If the input is not canonical, the output may not be canonical. @@ -167,18 +199,6 @@ const char * svn_dirent_local_style(const char *dirent, apr_pool_t *result_pool); -/** Convert @a relpath from the local style to the canonical internal style. - * "Local style" means native path separators and "." for the empty path. - * - * Allocate the result in @a result_pool. - * - * @since New in 1.7. - */ -const char * -svn_relpath__internal_style(const char *relpath, - apr_pool_t *result_pool); - - /** Join a base dirent (@a base) with a component (@a component). * * If either @a base or @a component is the empty string, then the other @@ -453,7 +473,8 @@ svn_boolean_t svn_uri_is_root(const char *uri, apr_size_t len); -/** Return a new dirent like @a dirent, but transformed such that some types +/** + * Return a new dirent like @a dirent, but transformed such that some types * of dirent specification redundancies are removed. * * This involves: @@ -467,14 +488,43 @@ svn_uri_is_root(const char *uri, * * Allocate the result in @a result_pool. * + * @warning This function may call @c abort() if @a dirent can not be + * canonicalized. + * Use svn_dirent_canonicalize_safe() for tainted input. + * * @since New in 1.6. */ const char * svn_dirent_canonicalize(const char *dirent, apr_pool_t *result_pool); +/** + * Return a new @a *canonical_dirent like @a dirent, but transformed such + * that some types of dirent specification redundancies are removed. + * + * Similar to svn_dirent_canonicalize() (which see), but returns an error + * if the @a dirent can not be canonicalized or of the result does not pass + * the svn_dirent_is_canonical() test. + * + * If the function fails and @a non_canonical_result is not @c NULL, the + * result of the failed canonicalization attempt (which may be @c NULL) + * will be returned in @a *non_canonical_result. + * + * Allocates the results in @a result_pool. Uses @a scratch_pool for + * temporary allocations. + * + * @since New in 1.12. + */ +svn_error_t * +svn_dirent_canonicalize_safe(const char **canonical_dirent, + const char **non_canonical_result, + const char *dirent, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + -/** Return a new relpath like @a relpath, but transformed such that some types +/** + * Return a new relpath like @a relpath, but transformed such that some types * of relpath specification redundancies are removed. * * This involves: @@ -486,14 +536,44 @@ svn_dirent_canonicalize(const char *dire * * Allocate the result in @a result_pool. * + * @warning This function may call @c abort() if @a relpath can not be + * canonicalized. + * Use svn_relpath_canonicalize_safe() for tainted input. + * * @since New in 1.7. */ const char * svn_relpath_canonicalize(const char *relpath, apr_pool_t *result_pool); +/** + * Return a new @a *canonical_relpath like @a relpath, but transformed such + * that some types of relpath specification redundancies are removed. + * + * Similar to svn_relpath_canonicalize() (which see), but returns an error + * if the @a relpath can not be canonicalized or of the result does not + * pass the svn_relpath_is_canonical() test. + * + * If the function fails and @a non_canonical_result is not @c NULL, the + * result of the failed canonicalization attempt (which may be @c NULL) + * will be returned in @a *non_canonical_result. + * + * Allocates the results in @a result_pool. Uses @a scratch_pool for + * temporary allocations. + * + * @since New in 1.12. + */ + +svn_error_t * +svn_relpath_canonicalize_safe(const char **canonical_relpath, + const char **non_canonical_result, + const char *relpath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); -/** Return a new uri like @a uri, but transformed such that some types + +/** + * Return a new uri like @a uri, but transformed such that some types * of uri specification redundancies are removed. * * This involves: @@ -510,12 +590,41 @@ svn_relpath_canonicalize(const char *rel * * Allocate the result in @a result_pool. * - * @since New in 1.7. + * @warning This function may call @c abort() if @a uri can not be + * canonicalized. + * Use svn_uri_canonicalize_safe() for tainted input. + * + * @since New in 1.7. */ const char * svn_uri_canonicalize(const char *uri, apr_pool_t *result_pool); +/** + * Return a new @a *canonical_uri like @a uri, but transformed such that + * some types of uri specification redundancies are removed. + * + * Similar to svn_uri_canonicalize() (which see), but returns an error if + * the @a uri can not be canonicalized or of the result does not pass the + * svn_uri_is_canonical() test. + * + * If the function fails and @a non_canonical_result is not @c NULL, the + * result of the failed canonicalization attempt (which may be @c NULL) + * will be returned in @a *non_canonical_result. + * + * Allocates the results in @a result_pool. Uses @a scratch_pool for + * temporary allocations. + * + * @since New in 1.12. + */ +svn_error_t * +svn_uri_canonicalize_safe(const char **canonical_uri, + const char **non_canonical_result, + const char *uri, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + + /** Return @c TRUE iff @a dirent is canonical. * * Use @a scratch_pool for temporary allocations.
Modified: subversion/branches/addremove/subversion/include/svn_error_codes.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_error_codes.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_error_codes.h (original) +++ subversion/branches/addremove/subversion/include/svn_error_codes.h Sat May 23 14:16:56 2020 @@ -888,6 +888,21 @@ SVN_ERROR_START SVN_ERR_FS_CATEGORY_START + 67, "Content checksums supposedly match but content does not.") + /** @since New in 1.13. */ + SVN_ERRDEF(SVN_ERR_FS_UNRECOGNIZED_IOCTL_CODE, + SVN_ERR_FS_CATEGORY_START + 68, + "Unrecognized filesystem I/O control code") + + /** @since New in 1.14. */ + SVN_ERRDEF(SVN_ERR_FS_REP_SHARING_NOT_ALLOWED, + SVN_ERR_FS_CATEGORY_START + 69, + "Rep-sharing is not allowed.") + + /** @since New in 1.14. */ + SVN_ERRDEF(SVN_ERR_FS_REP_SHARING_NOT_SUPPORTED, + SVN_ERR_FS_CATEGORY_START + 70, + "Rep-sharing is not supported.") + /* repos errors */ SVN_ERRDEF(SVN_ERR_REPOS_LOCKED, @@ -1482,6 +1497,11 @@ SVN_ERROR_START SVN_ERR_MISC_CATEGORY_START + 46, "LZ4 decompression failed") + /** @since New in 1.12. */ + SVN_ERRDEF(SVN_ERR_CANONICALIZATION_FAILED, + SVN_ERR_MISC_CATEGORY_START + 47, + "Could not canonicalize path or URI") + /* command-line client errors */ SVN_ERRDEF(SVN_ERR_CL_ARG_PARSING_ERROR, @@ -1769,7 +1789,7 @@ SVN_ERROR_START SVN_ERRDEF(SVN_ERR_X509_CERT_VERIFY_FAILED, SVN_ERR_X509_CATEGORY_START + 19, - "Certficate verification failed") + "Certificate verification failed") SVN_ERROR_END Modified: subversion/branches/addremove/subversion/include/svn_fs.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_fs.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_fs.h (original) +++ subversion/branches/addremove/subversion/include/svn_fs.h Sat May 23 14:16:56 2020 @@ -394,7 +394,7 @@ typedef enum svn_fs_upgrade_notify_actio svn_fs_upgrade_format_bumped } svn_fs_upgrade_notify_action_t; -/** The type of an upgrade notification function. @a number is specifc +/** The type of an upgrade notification function. @a number is specific * 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 scratch_pool can be used for @@ -1744,7 +1744,7 @@ svn_fs_paths_changed3(svn_fs_path_change * * Use @a pool for all allocations, including the hash and its values. * - * @note Retrieving the #node_rev_id element of #svn_fs_path_change2_t may + * @note Retrieving the #svn_fs_path_change2_t.node_rev_id element may * be expensive in some FS backends. * * @since New in 1.6. @@ -1828,9 +1828,9 @@ svn_fs_node_history(svn_fs_history_t **h * the same as the original. This will happen if the original * location was an interesting one (where the node was modified, or * took place in a copy event). This behavior allows looping callers - * to avoid the calling svn_fs_history_location() on the object - * returned by svn_fs_node_history(), and instead go ahead and begin - * calling svn_fs_history_prev(). + * to avoid calling svn_fs_history_location() on the object returned + * by svn_fs_node_history(), and instead go ahead and begin calling + * svn_fs_history_prev(). * * @note This function uses node-id ancestry alone to determine * modifiedness, and therefore does NOT claim that in any of the @@ -2492,7 +2492,7 @@ svn_fs_file_md5_checksum(unsigned char d * svn_fs_file_contents(). In that case, the result of reading from * @a *contents is undefined. * - * ### @todo kff: I am worried about lifetime issues with this pool vs + * @todo kff: I am worried about lifetime issues with this pool vs * the trail created farther down the call stack. Trace this function * to investigate... */ @@ -3503,6 +3503,54 @@ svn_fs_info_dup(const void *info, apr_pool_t *result_pool, apr_pool_t *scratch_pool); +/** + * A structure specifying the filesystem-specific input/output operation. + * + * @see svn_fs_ioctl() + * + * @since New in 1.13. + */ +typedef struct svn_fs_ioctl_code_t +{ + const char *fs_type; + int code; +} svn_fs_ioctl_code_t; + +/** + * A convenience macro to declare #svn_fs_ioctl_code_t codes. + * + * @since New in 1.13. + */ +#define SVN_FS_DECLARE_IOCTL_CODE(name, fs_type, code) \ + static const svn_fs_ioctl_code_t name = { fs_type, code } + +/** + * Issue a filesystem-specific input/output operation defined by @a ctlcode + * (usually, a low-level operation which cannot be expressed by other + * filesystem APIs). If @a fs is @c NULL, issue a global operation. + * If @a fs is not @c NULL, issue an operation that is specific to this + * filesystem instance. + * + * If the filesystem cannot handle this ioctl code, return the + * #SVN_ERR_FS_UNRECOGNIZED_IOCTL_CODE error. + * + * Allocate the result in @a result_pool, use @a scratch_pool for temporary + * allocations. + * + * @see #svn_fs_ioctl_code_t + * + * @since New in 1.13. + */ +svn_error_t * +svn_fs_ioctl(svn_fs_t *fs, + svn_fs_ioctl_code_t ctlcode, + void *input, + void **output_p, + svn_cancel_func_t cancel_func, + void *cancel_baton, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + /** @} */ #ifdef __cplusplus Modified: subversion/branches/addremove/subversion/include/svn_io.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_io.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_io.h (original) +++ subversion/branches/addremove/subversion/include/svn_io.h Sat May 23 14:16:56 2020 @@ -2410,10 +2410,12 @@ svn_io_write_atomic2(const char *final_p apr_pool_t *scratch_pool); /** Similar to svn_io_write_atomic2(), but with @a flush_to_disk set -* to @c TRUE. -* -* @deprecated Provided for backward compatibility with the 1.9 API -*/ + * to @c TRUE. + * + * @since New in 1.9. + * + * @deprecated Provided for backward compatibility with the 1.9 API + */ SVN_DEPRECATED svn_error_t * svn_io_write_atomic(const char *final_path, Modified: subversion/branches/addremove/subversion/include/svn_opt.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_opt.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_opt.h (original) +++ subversion/branches/addremove/subversion/include/svn_opt.h Sat May 23 14:16:56 2020 @@ -27,6 +27,8 @@ #ifndef SVN_OPT_H #define SVN_OPT_H +#include "svn_opt_impl.h" + #include <apr.h> #include <apr_pools.h> #include <apr_getopt.h> @@ -69,6 +71,10 @@ typedef svn_error_t *(svn_opt_subcommand /** The maximum number of options that can be accepted by a subcommand. */ #define SVN_OPT_MAX_OPTIONS 50 +/** The maximum number of paragraphs of help text a subcommand can have. + * @since New in 1.11. */ +#define SVN_OPT_MAX_PARAGRAPHS 100 + /** Options that have no short option char should use an identifying * integer equal to or greater than this. */ @@ -77,7 +83,39 @@ typedef svn_error_t *(svn_opt_subcommand /** One element of a subcommand dispatch table. * + * @since New in 1.11. + */ +typedef struct svn_opt_subcommand_desc3_t +{ + /** The full name of this command. */ + const char *name; + + /** The function this command invokes. */ + svn_opt_subcommand_t *cmd_func; + + /** A list of alias names for this command (e.g., 'up' for 'update'). */ + const char *aliases[SVN_OPT_MAX_ALIASES]; + + /** A multi-paragraph string describing this command. */ + const char *help[SVN_OPT_MAX_PARAGRAPHS]; + + /** A list of options accepted by this command. Each value in the + * array is a unique enum (the 2nd field in apr_getopt_option_t) + */ + int valid_options[SVN_OPT_MAX_OPTIONS]; + + /** A list of option help descriptions, keyed by the option unique enum + * (the 2nd field in apr_getopt_option_t), which override the generic + * descriptions given in an apr_getopt_option_t on a per-subcommand basis. + */ + struct { int optch; const char *desc; } desc_overrides[SVN_OPT_MAX_OPTIONS]; +} svn_opt_subcommand_desc3_t; + + +/** One element of a subcommand dispatch table. + * * @since New in 1.4. + * @deprecated Provided for backward compatibility with the 1.10 API. */ typedef struct svn_opt_subcommand_desc2_t { @@ -139,8 +177,21 @@ typedef struct svn_opt_subcommand_desc_t * Return the entry in @a table whose name matches @a cmd_name, or @c NULL if * none. @a cmd_name may be an alias. * + * @since New in 1.11. + */ +const svn_opt_subcommand_desc3_t * +svn_opt_get_canonical_subcommand3(const svn_opt_subcommand_desc3_t *table, + const char *cmd_name); + + +/** + * Same as svn_opt_get_canonical_subcommand3(), but with a different + * version of the subcommand description table. + * * @since New in 1.4. + * @deprecated Provided for backward compatibility with the 1.10 API. */ +SVN_DEPRECATED const svn_opt_subcommand_desc2_t * svn_opt_get_canonical_subcommand2(const svn_opt_subcommand_desc2_t *table, const char *cmd_name); @@ -170,8 +221,22 @@ svn_opt_get_canonical_subcommand(const s * * The returned value may be statically allocated, or allocated in @a pool. * + * @since New in 1.11. + */ +const apr_getopt_option_t * +svn_opt_get_option_from_code3(int code, + const apr_getopt_option_t *option_table, + const svn_opt_subcommand_desc3_t *command, + apr_pool_t *pool); + +/** + * Same as svn_opt_get_option_from_code3(), but with a different + * version of the subcommand description table. + * * @since New in 1.4. + * @deprecated Provided for backward compatibility with the 1.10 API. */ +SVN_DEPRECATED const apr_getopt_option_t * svn_opt_get_option_from_code2(int code, const apr_getopt_option_t *option_table, @@ -198,8 +263,21 @@ svn_opt_get_option_from_code(int code, * non-NULL, it is a zero-terminated array, and all subcommands take * the options listed in it. * + * @since New in 1.11. + */ +svn_boolean_t +svn_opt_subcommand_takes_option4(const svn_opt_subcommand_desc3_t *command, + int option_code, + const int *global_options); + +/** + * Same as svn_opt_subcommand_takes_option4(), but with a different + * version of the subcommand description table. + * * @since New in 1.5. + * @deprecated Provided for backward compatibility with the 1.10 API. */ +SVN_DEPRECATED svn_boolean_t svn_opt_subcommand_takes_option3(const svn_opt_subcommand_desc2_t *command, int option_code, @@ -235,7 +313,7 @@ svn_opt_subcommand_takes_option(const sv /** * Print a generic (not command-specific) usage message to @a stream. * - * ### @todo Why is @a stream a stdio file instead of an svn stream? + * @todo Why is @a stream a stdio file instead of an svn stream? * * If @a header is non-NULL, print @a header followed by a newline. Then * loop over @a cmd_table printing the usage for each command (getting @@ -244,8 +322,24 @@ svn_opt_subcommand_takes_option(const sv * * Use @a pool for temporary allocation. * + * @since New in 1.11. + */ +void +svn_opt_print_generic_help3(const char *header, + const svn_opt_subcommand_desc3_t *cmd_table, + const apr_getopt_option_t *opt_table, + const char *footer, + apr_pool_t *pool, + FILE *stream); + +/** + * Same as svn_opt_print_generic_help3(), but with a different + * version of the subcommand description table. + * * @since New in 1.4. + * @deprecated Provided for backward compatibility with the 1.10 API. */ +SVN_DEPRECATED void svn_opt_print_generic_help2(const char *header, const svn_opt_subcommand_desc2_t *cmd_table, @@ -297,8 +391,23 @@ svn_opt_format_option(const char **strin * use that second name as an alias for the first name. This additional * behaviour is new in 1.7. * + * @since New in 1.11. + */ +void +svn_opt_subcommand_help4(const char *subcommand, + const svn_opt_subcommand_desc3_t *table, + const apr_getopt_option_t *options_table, + const int *global_options, + apr_pool_t *pool); + +/** + * Same as svn_opt_subcommand_help4(), but with a different + * version of the subcommand description table. + * * @since New in 1.5. + * @deprecated Provided for backward compatibility with the 1.10 API. */ +SVN_DEPRECATED void svn_opt_subcommand_help3(const char *subcommand, const svn_opt_subcommand_desc2_t *table, @@ -336,43 +445,7 @@ svn_opt_subcommand_help(const char *subc /* Parsing revision and date options. */ - -/** - * Various ways of specifying revisions. - * - * @note - * In contexts where local mods are relevant, the `working' kind - * refers to the uncommitted "working" revision, which may be modified - * with respect to its base revision. In other contexts, `working' - * should behave the same as `committed' or `current'. - */ -enum svn_opt_revision_kind { - /** No revision information given. */ - svn_opt_revision_unspecified, - - /** revision given as number */ - svn_opt_revision_number, - - /** revision given as date */ - svn_opt_revision_date, - - /** rev of most recent change */ - svn_opt_revision_committed, - - /** (rev of most recent change) - 1 */ - svn_opt_revision_previous, - - /** .svn/entries current revision */ - svn_opt_revision_base, - - /** current, plus local mods */ - svn_opt_revision_working, - - /** repository youngest */ - svn_opt_revision_head - - /* please update svn_opt__revision_to_string() when extending this enum */ -}; +/* NOTE: svn_opt_revision_kind is defined in svn_opt_impl.h */ /** * A revision value, which can be specified as a number or a date. @@ -700,9 +773,30 @@ svn_opt_parse_path(svn_opt_revision_t *r * --version flag *and* subcommand arguments on a help command line. * The logic for handling such a situation should be in one place. * - * @since New in 1.8. + * @since New in 1.11. */ +svn_error_t * +svn_opt_print_help5(apr_getopt_t *os, + const char *pgm_name, + svn_boolean_t print_version, + svn_boolean_t quiet, + svn_boolean_t verbose, + const char *version_footer, + const char *header, + const svn_opt_subcommand_desc3_t *cmd_table, + const apr_getopt_option_t *option_table, + const int *global_options, + const char *footer, + apr_pool_t *pool); +/** + * Same as svn_opt_print_help5(), but with a different + * version of the subcommand description table. + * + * @since New in 1.8. + * @deprecated Provided for backward compatibility with the 1.10 API. + */ +SVN_DEPRECATED svn_error_t * svn_opt_print_help4(apr_getopt_t *os, const char *pgm_name, Modified: subversion/branches/addremove/subversion/include/svn_props.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_props.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_props.h (original) +++ subversion/branches/addremove/subversion/include/svn_props.h Sat May 23 14:16:56 2020 @@ -415,19 +415,26 @@ svn_prop_name_is_valid(const char *prop_ /** Describes external items to check out into this directory. * * The format is a series of lines, each in the following format: - * [-r REV] URL[@PEG] LOCALPATH + * + * [-r REV] URL[@PEG] LOCALPATH + * * LOCALPATH is relative to the directory having this property. * REV pins the external to revision REV. * URL may be a full URL or a relative URL starting with one of: - * ../ to the parent directory of the extracted external - * ^/ to the repository root - * / to the server root - * // to the URL scheme + * + * ../ to the parent directory of the extracted external + * ^/ to the repository root + * / to the server root + * // to the URL scheme + * * The following format is supported for interoperability with * Subversion 1.4 and earlier clients: - * LOCALPATH [-r PEG] URL + * + * LOCALPATH [-r PEG] URL + * * The ambiguous format 'relative_path relative_path' is taken as * 'relative_url relative_path' with peg revision support. + * * Lines starting with a '#' character are ignored. */ #define SVN_PROP_EXTERNALS SVN_PROP_PREFIX "externals" Modified: subversion/branches/addremove/subversion/include/svn_ra.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_ra.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_ra.h (original) +++ subversion/branches/addremove/subversion/include/svn_ra.h Sat May 23 14:16:56 2020 @@ -65,7 +65,7 @@ svn_ra_version(void); * @a close_baton as appropriate. * * @a path is relative to the "root" of the session, defined by the - * @a repos_URL passed to svn_ra_open4() vtable call. + * @a repos_URL passed to svn_ra_open5() vtable call. * * @a name is the name of the property to fetch. If the property is present, * then it is returned in @a value. Otherwise, @a *value is set to @c NULL. @@ -229,7 +229,7 @@ typedef void (*svn_ra_progress_notify_fu * * @a revision is the target revision number of the received replay report. * - * @a editor and @a edit_baton should provided by the callback implementation. + * @a *editor and @a *edit_baton should provided by the callback implementation. * * @a replay_baton is the baton as originally passed to replay_range. * @@ -253,7 +253,7 @@ typedef svn_error_t *(*svn_ra_replay_rev * * @a revision is the target revision number of the received replay report. * - * @a editor and @a edit_baton should provided by the callback implementation. + * @a editor and @a edit_baton are the values provided by the REVSTART callback. * * @a replay_baton is the baton as originally passed to replay_range. * @@ -273,7 +273,7 @@ typedef svn_error_t *(*svn_ra_replay_rev /** * Callback function that checks if an ra_svn tunnel called - * @a tunnel_name is handled by the callbakcs or the default + * @a tunnel_name is handled by the callbacks or the default * implementation. * * @a tunnel_baton is the baton as originally passed to ra_open. @@ -369,7 +369,7 @@ typedef struct svn_ra_reporter3_t * implementor should assume the directory has no entries or props. * * This will *override* any previous set_path() calls made on parent - * paths. @a path is relative to the URL specified in svn_ra_open4(). + * paths. @a path is relative to the URL specified in svn_ra_open5(). * * If @a lock_token is non-NULL, it is the lock token for @a path in the WC. * @@ -520,7 +520,7 @@ typedef struct svn_ra_reporter_t /** A collection of callbacks implemented by libsvn_client which allows * an RA layer to "pull" information from the client application, or * possibly store information. libsvn_client passes this vtable to - * svn_ra_open4(). + * svn_ra_open5(). * * Each routine takes a @a callback_baton originally provided with the * vtable. @@ -555,9 +555,9 @@ typedef struct svn_ra_callbacks2_t /** Fetch working copy properties. * - *<pre> ### we might have a problem if the RA layer ever wants a property - * ### that corresponds to a different revision of the file than - * ### what is in the WC. we'll cross that bridge one day...</pre> + * @note we might have a problem if the RA layer ever wants a property + * that corresponds to a different revision of the file than + * what is in the WC. we'll cross that bridge one day... */ svn_ra_get_wc_prop_func_t get_wc_prop; @@ -710,6 +710,14 @@ typedef struct svn_ra_session_t svn_ra_s * within the new repository root URL that @a repos_URL pointed to within * the old repository root URL. * + * If @a redirect_url is not NULL and a @corrected_url is returned, then + * @a redirect_url contains a non-canonicalized version of @a corrected_url, + * as communicated in the network protocol used by the RA provider. + * THe @a redirect_url should be used for to detect redirection loops. + * Canonicalization may change the protocol-level URL in a way that + * makes detection of redirect loops impossible in some cases since URLs which + * are different at the protocol layer could map to the same canonicalized URL. + * * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal * to the UUID of the repository at @c repos_URL. * @@ -728,8 +736,26 @@ typedef struct svn_ra_session_t svn_ra_s * * @see svn_client_open_ra_session(). * + * @since New in 1.14. + */ +svn_error_t * +svn_ra_open5(svn_ra_session_t **session_p, + const char **corrected_url, + const char **redirect_url, + const char *repos_URL, + const char *uuid, + const svn_ra_callbacks2_t *callbacks, + void *callback_baton, + apr_hash_t *config, + apr_pool_t *pool); + +/** Similar to svn_ra_open5(), but with @a redirect_url always passed + * as @c NULL. + * * @since New in 1.7. + * @deprecated Provided for backward compatibility with the 1.13 API. */ +SVN_DEPRECATED svn_error_t * svn_ra_open4(svn_ra_session_t **session_p, const char **corrected_url, @@ -1130,13 +1156,12 @@ svn_ra_get_dir(svn_ra_session_t *session apr_pool_t *pool); /** - * Callback type to be used with @a svn_ra_list. It will be invoked for + * Callback type to be used with svn_ra_list(). It will be invoked for * every directory entry found. * * The full path of the entry is given in @a rel_path and @a dirent contains - * various additional information. If @a svn_repos_list has been called - * with @c path_info_only set, only the @c kind element of this struct - * will be valid. + * various additional information. Only the elements of @a dirent specified + * by the @a dirent_fields argument to svn_ra_list() will be valid. * * @a baton is the user-provided receiver baton. @a scratch_pool may be * used for temporary allocations. @@ -1155,21 +1180,21 @@ typedef svn_error_t *(* svn_ra_dirent_re * In @a session, walk the sub-tree starting at @a path at @a revision down * to the given @a depth. For each directory entry found, @a receiver will * be called with @a receiver_baton. The starting @a path will be reported - * as well. Because retrieving elements of a @c svn_dirent_t can be + * as well. Because retrieving elements of a #svn_dirent_t can be * expensive, you need to select them individually via flags set in * @a dirent_fields. * * @a patterns is an optional array of <tt>const char *</tt>. If it is * not @c NULL, only those directory entries will be reported whose last * path segment matches at least one of these patterns. This feature uses - * @c apr_fnmatch for glob matching and requiring '.' to matched by dots + * apr_fnmatch() for glob matching and requiring '.' to matched by dots * in the path. * * @a path must point to a directory and @a depth must be at least - * @c svn_depth_empty. + * #svn_depth_empty. * * If the server doesn't support the 'list' command, return - * @c SVN_ERR_UNSUPPORTED_FEATURE in preference to any other error that + * #SVN_ERR_UNSUPPORTED_FEATURE in preference to any other error that * might otherwise be returned. * * Use @a scratch_pool for temporary memory allocation. @@ -1858,7 +1883,7 @@ svn_ra_get_location_segments(svn_ra_sess * @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 + * NULL unless there is an actual difference in the file contents between * the current and the previous call. * * @since New in 1.5. @@ -2219,7 +2244,7 @@ svn_ra_has_capability(svn_ra_session_t * /** * The capability of a server to automatically remove transaction - * properties prefixed with SVN_PROP_EPHEMERAL_PREFIX. + * properties prefixed with #SVN_PROP_TXN_PREFIX. * * @since New in 1.8. */ Modified: subversion/branches/addremove/subversion/include/svn_ra_svn.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_ra_svn.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_ra_svn.h (original) +++ subversion/branches/addremove/subversion/include/svn_ra_svn.h Sat May 23 14:16:56 2020 @@ -144,7 +144,9 @@ typedef struct svn_ra_svn_cmd_entry_t svn_boolean_t terminate; } svn_ra_svn_cmd_entry_t; -/** Data types defined by the svn:// protocol. */ +/** Data types defined by the svn:// protocol. + * + * @since The typedef name is new in 1.10; the enumerators are not. */ typedef enum { SVN_RA_SVN_NUMBER, @@ -177,7 +179,9 @@ typedef svn_error_t *(*svn_ra_svn_edit_c * * Either @a sock or @a in_stream/@a out_stream must be set, not both. * @a compression_level specifies the desired network data compression - * level (zlib) from 0 (no compression) to 9 (best but slowest). + * level from 0 (no compression) to 9 (best but slowest). The effect + * of the parameter depends on the compression algorithm; for example, + * it is used verbatim by zlib/deflate but ignored by LZ4. * * If @a zero_copy_limit is not 0, cached file contents smaller than the * given limit may be sent directly to the network socket. Otherwise, @@ -197,7 +201,7 @@ typedef svn_error_t *(*svn_ra_svn_edit_c * If @a max_out is not 0, error out and close the connection whenever more * than @a max_out bytes have been send as response to some command. * - * @note The limits enforced may vary slightly by +/- the I/O buffer size. + * @note The limits enforced may vary slightly by +/- the I/O buffer size. * * @note If @a out_stream is an wrapped apr_file_t* the backing file will be * used for some operations. Modified: subversion/branches/addremove/subversion/include/svn_repos.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_repos.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_repos.h (original) +++ subversion/branches/addremove/subversion/include/svn_repos.h Sat May 23 14:16:56 2020 @@ -679,7 +679,7 @@ svn_repos_fs_type(svn_repos_t *repos, * 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. @@ -861,7 +861,7 @@ typedef svn_error_t *(*svn_repos_freeze_ * @since New in 1.8. */ svn_error_t * -svn_repos_freeze(apr_array_header_t *paths, +svn_repos_freeze(const apr_array_header_t *paths, svn_repos_freeze_func_t freeze_func, void *freeze_baton, apr_pool_t *pool); @@ -1036,7 +1036,10 @@ svn_repos_hooks_setenv(svn_repos_t *repo * * @a send_copyfrom_args instructs the driver to send 'copyfrom' * arguments to the editor's add_file() and add_directory() methods, - * whenever it deems feasible. + * and therefore to send their content as deltas against the copy source, + * whenever it deems feasible. The implementation only does so for + * add_file(), and only when the file itself is the copy root (not when + * the file is part of a copied subtree). * * Use @a authz_read_func and @a authz_read_baton (if not @c NULL) to * avoid sending data through @a editor/@a edit_baton which is not @@ -1726,11 +1729,11 @@ svn_repos_stat(svn_dirent_t **dirent, apr_pool_t *pool); /** - * Callback type to be used with @c svn_repos_list. It will be invoked for + * Callback type to be used with svn_repos_list(). It will be invoked for * every directory entry found. * * The full path of the entry is given in @a path and @a dirent contains - * various additional information. If @c svn_repos_list has been called + * various additional information. If svn_repos_list() has been called * with @a path_info_only set, only the @a kind element of this struct * will be valid. * @@ -1751,14 +1754,14 @@ typedef svn_error_t *(* svn_repos_dirent * Walk the sub-tree starting at @a path under @a root up to the given * @a depth. For each directory entry found, @a receiver will be called * with @a receiver_baton. The starting @a path will be reported as well. - * Because retrieving all elements of a @c svn_dirent_t can be expensive, + * Because retrieving all elements of a #svn_dirent_t can be expensive, * you may set @a path_info_only to receive only the path name and the node * kind. The entries will be reported ordered by their path. * * @a patterns is an optional array of <tt>const char *</tt>. If it is * not @c NULL, only those directory entries will be reported whose last * path segment matches at least one of these patterns. This feature uses - * @c apr_fnmatch for glob matching and requiring '.' to matched by dots + * apr_fnmatch() for glob matching and requiring '.' to matched by dots * in the path. * * If @a authz_read_func is not @c NULL, this function will neither report @@ -1768,7 +1771,7 @@ typedef svn_error_t *(* svn_repos_dirent * @a cancel_func and @a cancel_baton. * * @a path must point to a directory and @a depth must be at least - * @c svn_depth_empty. + * #svn_depth_empty. * * Use @a scratch_pool for temporary memory allocation. * @@ -1957,7 +1960,7 @@ svn_repos_node_location_segments(svn_rep * @a copyfrom_known is always @c TRUE. * * @note To allow for extending this structure in future releases, - * always use svn_repos_path_change_create() to allocate the stucture. + * always use svn_repos_path_change_create() to allocate the structure. * * @see svn_fs_path_change3_t * @@ -2014,7 +2017,7 @@ typedef svn_error_t *(*svn_repos_path_ch * A structure to represent all the information about a particular log entry. * * @note To allow for extending this structure in future releases, - * always use svn_repos_log_entry_create() to allocate the stucture. + * always use svn_repos_log_entry_create() to allocate the structure. * * @since New in 1.10. */ @@ -2152,7 +2155,7 @@ typedef svn_error_t *(*svn_repos_log_ent * (i.e. retrieve none if the array is empty). * * If any invocation of @a revision_receiver or @a path_change_receiver - * returnn an error, return that error immediately and without wrapping it. + * return an error, return that error immediately and without wrapping it. * * If @a start or @a end is a non-existent revision, return the error * #SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a revision_receiver. @@ -2404,7 +2407,7 @@ svn_repos_fs_get_mergeinfo(svn_mergeinfo * @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 + * NULL unless there is an actual difference in the file contents between * the current and the previous call. * * @since New in 1.5. @@ -3357,7 +3360,7 @@ svn_repos_dump_fs4(svn_repos_t *repos, apr_pool_t *pool); /** - * Similar to svn_repos_dump_fs4(), but with @a include_revprops and + * Similar to svn_repos_dump_fs4(), but with @a include_revprops and * @a include_changes both set to @c TRUE and @a filter_func and * @a filter_baton set to @c NULL. * @@ -3803,7 +3806,7 @@ typedef struct svn_repos_parse_fns3_t * * @since New in 1.8. - * @since Starting in 1.10, @a parse_fns may contain #NULL pointers for + * @since Starting in 1.10, @a parse_fns may contain NULL pointers for * those callbacks that the caller is not interested in. */ svn_error_t * @@ -4144,6 +4147,19 @@ svn_error_t * svn_repos_authz_initialize(apr_pool_t *pool); /** + * Callback for reporting authz file parsing warnings. + * + * The implementation may use @a scratch_pool for temporary + * allocations but should not assume that the lifetime of that pool + * persists past the callback invocation. + * + * The implementation @e must @e not clear @a error. + */ +typedef void (*svn_repos_authz_warning_func_t)(void *baton, + const svn_error_t *error, + apr_pool_t *scratch_pool); + +/** * Read authz configuration data from @a path (a dirent, an absolute file url * or a registry path) into @a *authz_p, allocated in @a pool. * @@ -4161,8 +4177,31 @@ svn_repos_authz_initialize(apr_pool_t *p * repository instance. Otherwise, set it to NULL and the repositories will * be opened as needed. * + * If the @a warning_func callback is not @c NULL, it is called + * (with @a warning_baton) to report non-fatal warnings emitted by + * the parser. + * + * @since New in 1.12. + */ +svn_error_t * +svn_repos_authz_read4(svn_authz_t **authz_p, + const char *path, + const char *groups_path, + svn_boolean_t must_exist, + svn_repos_t *repos_hint, + svn_repos_authz_warning_func_t warning_func, + void *warning_baton, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + +/** + * Similar to svn_repos_authz_read3(), but with @a warning_func and + * @a warning_baton set to @c NULL. + * * @since New in 1.10. + * @deprecated Provided for backward compatibility with the 1.11 API. */ +SVN_DEPRECATED svn_error_t * svn_repos_authz_read3(svn_authz_t **authz_p, const char *path, @@ -4203,12 +4242,35 @@ svn_repos_authz_read(svn_authz_t **authz /** * Read authz configuration data from @a stream into @a *authz_p, - * allocated in @a pool. + * allocated in @a result_pool. * * If @a groups_stream is set, use the global groups parsed from it. * + * If the @a warning_func callback is not @c NULL, it is called + * (with @a warning_baton) to report non-fatal warnings emitted by + * the parser. + * + * Uses @a scratch_pool for temporary aloocations. + * + * @since New in 1.12. + */ +svn_error_t * +svn_repos_authz_parse2(svn_authz_t **authz_p, + svn_stream_t *stream, + svn_stream_t *groups_stream, + svn_repos_authz_warning_func_t warning_func, + void *warning_baton, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + +/** + * Similar to svn_repos_authz_parse2(), but with @a warning_func and + * @a warning_baton set to @c NULL. + * * @since New in 1.8. + * @deprecated Provided for backward compatibility with the 1.11 API. */ +SVN_DEPRECATED svn_error_t * svn_repos_authz_parse(svn_authz_t **authz_p, svn_stream_t *stream, Modified: subversion/branches/addremove/subversion/include/svn_string.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_string.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_string.h (original) +++ subversion/branches/addremove/subversion/include/svn_string.h Sat May 23 14:16:56 2020 @@ -530,8 +530,7 @@ svn_cstring_count_newlines(const char *m /** * Return a cstring which is the concatenation of @a strings (an array - * of char *) each followed by @a separator (that is, @a separator - * will also end the resulting string). Allocate the result in @a pool. + * of char *) joined by @a separator. Allocate the result in @a pool. * If @a strings is empty, then return the empty string. * If @a trailing_separator is non-zero, also append the separator * after the last joined element. Modified: subversion/branches/addremove/subversion/include/svn_time.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_time.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_time.h (original) +++ subversion/branches/addremove/subversion/include/svn_time.h Sat May 23 14:16:56 2020 @@ -38,14 +38,21 @@ extern "C" { /** Convert @a when to a <tt>const char *</tt> representation allocated - * in @a pool. Use svn_time_from_cstring() for the reverse - * conversion. + * in @a pool. + * + * @see svn_time_from_cstring() for the reverse conversion. */ const char * svn_time_to_cstring(apr_time_t when, apr_pool_t *pool); /** Convert @a data to an @c apr_time_t @a when. + * + * @see svn_time_to_cstring() for the reverse conversion. + * + * @deprecated Also accepts a format that was used before Subversion 0.14. + * See implementation for details. Use of this format is deprecated. + * * Use @a pool for temporary memory allocation. */ svn_error_t * Modified: subversion/branches/addremove/subversion/include/svn_types.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_types.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_types.h (original) +++ subversion/branches/addremove/subversion/include/svn_types.h Sat May 23 14:16:56 2020 @@ -27,6 +27,8 @@ #ifndef SVN_TYPES_H #define SVN_TYPES_H +#include "svn_types_impl.h" + /* ### this should go away, but it causes too much breakage right now */ #include <stdlib.h> #include <limits.h> /* for ULONG_MAX */ @@ -247,35 +249,6 @@ typedef struct svn_version_t svn_version -/** @defgroup apr_hash_utilities APR Hash Table Helpers - * These functions enable the caller to dereference an APR hash table index - * without type casts or temporary variables. - * - * These functions are provided by APR itself from version 1.5. - * Definitions are provided here for when using older versions of APR. - * @{ - */ - -#if !APR_VERSION_AT_LEAST(1, 5, 0) - -/** Return the key of the hash table entry indexed by @a hi. */ -const void * -apr_hash_this_key(apr_hash_index_t *hi); - -/** Return the key length of the hash table entry indexed by @a hi. */ -apr_ssize_t -apr_hash_this_key_len(apr_hash_index_t *hi); - -/** Return the value of the hash table entry indexed by @a hi. */ -void * -apr_hash_this_val(apr_hash_index_t *hi); - -#endif - -/** @} */ - - - /** 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 @@ -303,28 +276,7 @@ apr_hash_this_val(apr_hash_index_t *hi); -/** The various types of nodes in the Subversion filesystem. */ -typedef enum svn_node_kind_t -{ - /** absent */ - svn_node_none, - - /** regular file */ - svn_node_file, - - /** directory */ - svn_node_dir, - - /** something's here, but we don't know what */ - svn_node_unknown, - - /** - * symbolic link - * @note This value is not currently used by the public API. - * @since New in 1.8. - */ - svn_node_symlink -} svn_node_kind_t; +/* NOTE: svn_node_kind_t is defined in svn_types_impl.h */ /** Return a constant string expressing @a kind as an English word, e.g., * "file", "dir", etc. The string is not localized, as it may be used for @@ -346,23 +298,7 @@ svn_node_kind_t svn_node_kind_from_word(const char *word); -/** 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. - * - * @note It is unsafe to use apr_pcalloc() to allocate these, since '0' is - * not a valid value. - * - * @since New in 1.7. */ -typedef enum svn_tristate_t -{ - /** state known to be false (the constant does not evaulate to false) */ - svn_tristate_false = 2, - /** state known to be true */ - svn_tristate_true, - /** state could be true or false */ - svn_tristate_unknown -} svn_tristate_t; +/* NOTE: svn_tristate_t is defined in svn_types_impl.h */ /** Return a constant string "true", "false" or NULL representing the value of * @a tristate. @@ -422,15 +358,11 @@ svn_tristate__from_word(const char * wor -/** A revision number. */ -typedef long int svn_revnum_t; +/* NOTE: svn_revnum_t and SVN_INVALID_REVNUM are defined in svn_types_impl.h */ /** Valid revision numbers begin at 0 */ #define SVN_IS_VALID_REVNUM(n) ((n) >= 0) -/** The 'official' invalid revision num */ -#define SVN_INVALID_REVNUM ((svn_revnum_t) -1) - /** Not really invalid...just unimportant -- one day, this can be its * own unique value, for now, just make it the same as * #SVN_INVALID_REVNUM. @@ -494,55 +426,7 @@ enum svn_recurse_kind svn_recursive }; -/** The concept of depth for directories. - * - * @note This is similar to, but not exactly the same as, the WebDAV - * and LDAP concepts of depth. - * - * @since New in 1.5. - */ -typedef enum svn_depth_t -{ - /* The order of these depths is important: the higher the number, - the deeper it descends. This allows us to compare two depths - numerically to decide which should govern. */ - - /** Depth undetermined or ignored. In some contexts, this means the - client should choose an appropriate default depth. The server - will generally treat it as #svn_depth_infinity. */ - svn_depth_unknown = -2, - - /** Exclude (i.e., don't descend into) directory D. - @note In Subversion 1.5, svn_depth_exclude is *not* supported - anywhere in the client-side (libsvn_wc/libsvn_client/etc) code; - it is only supported as an argument to set_path functions in the - ra and repos reporters. (This will enable future versions of - Subversion to run updates, etc, against 1.5 servers with proper - svn_depth_exclude behavior, once we get a chance to implement - client-side support for svn_depth_exclude.) - */ - svn_depth_exclude = -1, - - /** Just the named directory D, no entries. Updates will not pull in - any files or subdirectories not already present. */ - svn_depth_empty = 0, - - /** D + its file children, but not subdirs. Updates will pull in any - files not already present, but not subdirectories. */ - svn_depth_files = 1, - - /** D + immediate children (D and its entries). Updates will pull in - any files or subdirectories not already present; those - subdirectories' this_dir entries will have depth-empty. */ - svn_depth_immediates = 2, - - /** D + all descendants (full recursion from D). Updates will pull - in any files or subdirectories not already present; those - subdirectories' this_dir entries will have depth-infinity. - Equivalent to the pre-1.5 default update behavior. */ - svn_depth_infinity = 3 - -} svn_depth_t; +/* NOTE: svn_depth_t is defined in svn_types_impl.h */ /** Return a constant string expressing @a depth as an English word, * e.g., "infinity", "immediates", etc. The string is not localized, @@ -643,7 +527,7 @@ svn_depth_from_word(const char *word); /** A general subversion directory entry. * * @note To allow for extending the #svn_dirent_t structure in future - * releases, always use svn_dirent_create() to allocate the stucture. + * releases, always use svn_dirent_create() to allocate the structure. * * @since New in 1.6. */ @@ -652,7 +536,7 @@ typedef struct svn_dirent_t /** node kind */ svn_node_kind_t kind; - /** length of file text, or 0 for directories */ + /** length of file text, otherwise SVN_INVALID_FILESIZE */ svn_filesize_t size; /** does the node have props? */ Modified: subversion/branches/addremove/subversion/include/svn_utf.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_utf.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_utf.h (original) +++ subversion/branches/addremove/subversion/include/svn_utf.h Sat May 23 14:16:56 2020 @@ -212,7 +212,7 @@ svn_utf_cstring_from_utf8_ex(const char * so when we can detect that at configure time, things will change. * Also, this should (?) be moved to apr/apu eventually. * - * See http://subversion.tigris.org/issues/show_bug.cgi?id=807 for + * See https://issues.apache.org/jira/browse/SVN-807 for * details. */ const char * Modified: subversion/branches/addremove/subversion/include/svn_version.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_version.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_version.h (original) +++ subversion/branches/addremove/subversion/include/svn_version.h Sat May 23 14:16:56 2020 @@ -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 10 +#define SVN_VER_MINOR 15 /** * Patch number. @@ -346,7 +346,7 @@ svn_version_ext_build_time(const svn_ver * @return The canonical host triplet (arch-vendor-osname) of the * system where libsvn_subr was compiled. * - * @note On Unix-like systems (includng Mac OS X), this string is the + * @note On Unix-like systems (including Mac OS X), this string is the * same as the output of the config.guess script. * * @since New in 1.8. Modified: subversion/branches/addremove/subversion/include/svn_wc.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_wc.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_wc.h (original) +++ subversion/branches/addremove/subversion/include/svn_wc.h Sat May 23 14:16:56 2020 @@ -2220,7 +2220,7 @@ typedef struct svn_wc_conflict_result_t 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 + * #svn_wc_conflict_choose_merged. This value is preferred over using * merged_file. * * @since New in 1.9. @@ -5230,7 +5230,7 @@ svn_wc_committed_queue_create(apr_pool_t * turns the node and its implied descendants as the new unmodified state at * the new specified revision. Unless @a recurse is TRUE, changes on * descendants are not committed as changes directly. In this case they should - * be queueud as their own changes. + * be queued as their own changes. * * If @a remove_lock is @c TRUE, any entryprops related to a repository * lock will be removed. @@ -7602,9 +7602,14 @@ svn_wc_relocate(const char *path, * If @a clear_changelists is TRUE, then changelist information for the * paths is cleared. * - * If @a metadata_only is TRUE, the working copy files are untouched, but - * if there are conflict marker files attached to these files these - * markers are removed. + * The @a metadata_only and @a added_keep_local options control the + * extent of reverting. If @a metadata_only is TRUE, the working copy + * files are untouched, but if there are conflict marker files attached + * to these files these markers are removed. Otherwise, if + * @a added_keep_local is TRUE, then all items are reverted except an + * item that was scheduled as plain 'add' (not a copy) will not be + * removed from the working copy. Otherwise, all items are reverted and + * their on-disk state changed to match. * * If @a cancel_func is non-NULL, call it with @a cancel_baton at * various points during the reversion process. If it returns an @@ -7622,8 +7627,30 @@ svn_wc_relocate(const char *path, * If @a path is not under version control, return the error * #SVN_ERR_UNVERSIONED_RESOURCE. * + * @since New in 1.11. + */ +svn_error_t * +svn_wc_revert6(svn_wc_context_t *wc_ctx, + const char *local_abspath, + svn_depth_t depth, + svn_boolean_t use_commit_times, + const apr_array_header_t *changelist_filter, + svn_boolean_t clear_changelists, + svn_boolean_t metadata_only, + svn_boolean_t added_keep_local, + svn_cancel_func_t cancel_func, + void *cancel_baton, + svn_wc_notify_func2_t notify_func, + void *notify_baton, + apr_pool_t *scratch_pool); + +/** Similar to svn_wc_revert6() but with @a added_keep_local always + * set to TRUE. + * * @since New in 1.9. + * @deprecated Provided for backward compatibility with the 1.10 API. */ +SVN_DEPRECATED svn_error_t * svn_wc_revert5(svn_wc_context_t *wc_ctx, const char *local_abspath, Modified: subversion/branches/addremove/subversion/include/svn_x509.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_x509.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_x509.h (original) +++ subversion/branches/addremove/subversion/include/svn_x509.h Sat May 23 14:16:56 2020 @@ -54,7 +54,7 @@ extern "C" { typedef struct svn_x509_certinfo_t svn_x509_certinfo_t; /** - * Representation of an atttribute in an X.509 name (e.g. Subject or Issuer) + * Representation of an attribute in an X.509 name (e.g. Subject or Issuer) * * @since New in 1.9. */ Modified: subversion/branches/addremove/subversion/include/svn_xml.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_xml.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/include/svn_xml.h (original) +++ subversion/branches/addremove/subversion/include/svn_xml.h Sat May 23 14:16:56 2020 @@ -175,7 +175,7 @@ typedef void (*svn_xml_char_data)(void * * but some internal structures may be allocated out of pool. Use * svn_xml_free_parser() to free all memory used by the parser. * - * Since Subversion 1.10 parser will be freed automatically on pool + * @since Since Subversion 1.10 parser will be freed automatically on pool * cleanup or by svn_xml_free_parser() call. */ svn_xml_parser_t * Modified: subversion/branches/addremove/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c (original) +++ subversion/branches/addremove/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c Sat May 23 14:16:56 2020 @@ -118,10 +118,12 @@ password_get_gnome_keyring(svn_boolean_t { GError *gerror = NULL; gchar *gpassword; - + + *done = FALSE; + if (!available_collection(non_interactive, pool)) return SVN_NO_ERROR; - + gpassword = secret_password_lookup_sync(SECRET_SCHEMA_COMPAT_NETWORK, NULL, &gerror, "domain", realmstring, @@ -129,6 +131,7 @@ password_get_gnome_keyring(svn_boolean_t NULL); if (gerror) { + /* ### TODO: return or log the error? */ g_error_free(gerror); } else if (gpassword) @@ -137,7 +140,7 @@ password_get_gnome_keyring(svn_boolean_t g_free(gpassword); *done = TRUE; } - + return SVN_NO_ERROR; } @@ -155,7 +158,9 @@ password_set_gnome_keyring(svn_boolean_t { GError *gerror = NULL; gboolean gstatus; - + + *done = FALSE; + if (!available_collection(non_interactive, pool)) return SVN_NO_ERROR; @@ -170,13 +175,14 @@ password_set_gnome_keyring(svn_boolean_t NULL); if (gerror) { + /* ### TODO: return or log the error? */ g_error_free(gerror); } else if (gstatus) { *done = TRUE; } - + return SVN_NO_ERROR; } Modified: subversion/branches/addremove/subversion/libsvn_auth_kwallet/kwallet.cpp URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_auth_kwallet/kwallet.cpp?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_auth_kwallet/kwallet.cpp (original) +++ subversion/branches/addremove/subversion/libsvn_auth_kwallet/kwallet.cpp Sat May 23 14:16:56 2020 @@ -227,10 +227,10 @@ kwallet_password_get(svn_boolean_t *done KLocalizedString::setApplicationDomain("subversion"); /* translation domain */ /* componentName appears in KDE GUI prompts */ - KAboutData aboutData(QStringLiteral("subversion"), /* componentName */ + KAboutData aboutData(QString("subversion"), /* componentName */ i18n(get_application_name(parameters, pool)), /* displayName */ - QStringLiteral(SVN_VER_NUMBER)); + QString(SVN_VER_NUMBER)); KAboutData::setApplicationData(aboutData); #else KCmdLineArgs::init(q_argc, q_argv, @@ -309,10 +309,10 @@ kwallet_password_set(svn_boolean_t *done KLocalizedString::setApplicationDomain("subversion"); /* translation domain */ /* componentName appears in KDE GUI prompts */ - KAboutData aboutData(QStringLiteral("subversion"), /* componentName */ + KAboutData aboutData(QString("subversion"), /* componentName */ i18n(get_application_name(parameters, pool)), /* displayName */ - QStringLiteral(SVN_VER_NUMBER)); + QString(SVN_VER_NUMBER)); KAboutData::setApplicationData(aboutData); #else KCmdLineArgs::init(q_argc, q_argv, Modified: subversion/branches/addremove/subversion/libsvn_client/add.c URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/add.c?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_client/add.c (original) +++ subversion/branches/addremove/subversion/libsvn_client/add.c Sat May 23 14:16:56 2020 @@ -616,7 +616,7 @@ svn_client__get_all_auto_props(apr_hash_ /* Are "traditional" auto-props enabled? If so grab them from the - config. This is our starting set auto-props, which may be overriden + config. This is our starting set auto-props, which may be overridden by svn:auto-props. */ SVN_ERR(svn_config_get_bool(cfg, &use_autoprops, SVN_CONFIG_SECTION_MISCELLANY, @@ -952,12 +952,13 @@ svn_client_add5(const char *path, static svn_error_t * path_driver_cb_func(void **dir_baton, + const svn_delta_editor_t *editor, + void *edit_baton, void *parent_baton, void *callback_baton, const char *path, apr_pool_t *pool) { - const svn_delta_editor_t *editor = callback_baton; SVN_ERR(svn_path_check_valid(path, pool)); return editor->add_directory(path, parent_baton, NULL, SVN_INVALID_REVNUM, pool, dir_baton); @@ -1146,8 +1147,8 @@ mkdir_urls(const apr_array_header_t *url /* Call the path-based editor driver. */ err = svn_error_trace( - svn_delta_path_driver2(editor, edit_baton, targets, TRUE, - path_driver_cb_func, (void *)editor, pool)); + svn_delta_path_driver3(editor, edit_baton, targets, TRUE, + path_driver_cb_func, NULL, pool)); if (err) { Modified: subversion/branches/addremove/subversion/libsvn_client/blame.c URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/blame.c?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_client/blame.c (original) +++ subversion/branches/addremove/subversion/libsvn_client/blame.c Sat May 23 14:16:56 2020 @@ -456,7 +456,7 @@ file_rev_handler(void *baton, const char SVN_ERR_CLIENT_IS_BINARY_FILE, NULL, _("Cannot calculate blame information for binary file '%s'"), (svn_path_is_url(frb->target) - ? frb->target + ? frb->target : svn_dirent_local_style(frb->target, pool))); } } @@ -553,7 +553,7 @@ file_rev_handler(void *baton, const char || frb->include_merged_revisions); /* The file existed before start_rev; generate no blame info for - lines from this revision (or before). + lines from this revision (or before). This revision specifies the state as it was at the start revision */ @@ -656,14 +656,16 @@ normalize_blames(struct blame_chain *cha } svn_error_t * -svn_client_blame5(const char *target, +svn_client_blame6(svn_revnum_t *start_revnum_p, + svn_revnum_t *end_revnum_p, + const char *target, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *start, const svn_opt_revision_t *end, const svn_diff_file_options_t *diff_options, svn_boolean_t ignore_mime_type, svn_boolean_t include_merged_revisions, - svn_client_blame_receiver3_t receiver, + svn_client_blame_receiver4_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool) @@ -696,10 +698,13 @@ svn_client_blame5(const char *target, SVN_ERR(svn_client__get_revision_number(&start_revnum, NULL, ctx->wc_ctx, target_abspath_or_url, ra_session, start, pool)); - + if (start_revnum_p) + *start_revnum_p = start_revnum; SVN_ERR(svn_client__get_revision_number(&end_revnum, NULL, ctx->wc_ctx, target_abspath_or_url, ra_session, end, pool)); + if (end_revnum_p) + *end_revnum_p = end_revnum; { svn_client__pathrev_t *loc; @@ -734,7 +739,7 @@ svn_client_blame5(const char *target, mime_type = svn_prop_get_value(props, SVN_PROP_MIME_TYPE); } - else + else { const svn_string_t *value; @@ -897,9 +902,9 @@ svn_client_blame5(const char *target, /* If we never created any blame for the original chain, create it now, with the most recent changed revision. This could occur if a file was created on a branch and them merged to another branch. This is - semanticly a copy, and we want to use the revision on the branch as + semantically a copy, and we want to use the revision on the branch as the most recently changed revision. ### Is this really what we want - to do here? Do the sematics of copy change? */ + to do here? Do the semantics of copy change? */ if (!frb.chain->blame) frb.chain->blame = blame_create(frb.chain, frb.last_rev, 0); @@ -941,18 +946,21 @@ svn_client_blame5(const char *target, SVN_ERR(ctx->cancel_func(ctx->cancel_baton)); if (!eof || sb->len) { + svn_string_t line; + line.data = sb->data; + line.len = sb->len; if (walk->rev) - SVN_ERR(receiver(receiver_baton, start_revnum, end_revnum, + SVN_ERR(receiver(receiver_baton, line_no, walk->rev->revision, walk->rev->rev_props, merged_rev, merged_rev_props, merged_path, - sb->data, FALSE, iterpool)); + &line, FALSE, iterpool)); else - SVN_ERR(receiver(receiver_baton, start_revnum, end_revnum, + SVN_ERR(receiver(receiver_baton, line_no, SVN_INVALID_REVNUM, NULL, SVN_INVALID_REVNUM, NULL, NULL, - sb->data, TRUE, iterpool)); + &line, TRUE, iterpool)); } if (eof) break; } Modified: subversion/branches/addremove/subversion/libsvn_client/client.h URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/client.h?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_client/client.h (original) +++ subversion/branches/addremove/subversion/libsvn_client/client.h Sat May 23 14:16:56 2020 @@ -682,34 +682,6 @@ svn_client__get_diff_editor2(const svn_d /* ---------------------------------------------------------------- */ -/*** Editor for diff summary ***/ - -/* Set *DIFF_PROCESSOR to a diff processor that will report a diff summary - to SUMMARIZE_FUNC. - - P_ROOT_RELPATH will return a pointer to a string that must be set to - the root of the operation before the processor is called. - - ORIGINAL_PATH specifies the original path and will be used with - **ANCHOR_PATH to create paths as the user originally provided them - to the diff function. - - SUMMARIZE_FUNC is called with SUMMARIZE_BATON as parameter by the - created callbacks for each changed item. -*/ -svn_error_t * -svn_client__get_diff_summarize_callbacks( - const svn_diff_tree_processor_t **diff_processor, - const char ***p_root_relpath, - svn_client_diff_summarize_func_t summarize_func, - void *summarize_baton, - const char *original_target, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool); - -/* ---------------------------------------------------------------- */ - - /*** Copy Stuff ***/ /* This structure is used to associate a specific copy or move SRC with a @@ -754,40 +726,23 @@ typedef struct svn_client__copy_pair_t /*** Commit Stuff ***/ -/* WARNING: This is all new, untested, un-peer-reviewed conceptual - stuff. +/* The "Harvest Committables" System - The day that 'svn switch' came into existence, our old commit - crawler (svn_wc_crawl_local_mods) became obsolete. It relied far - too heavily on the on-disk hierarchy of files and directories, and - simply had no way to support disjoint working copy trees or nest - working copies. The primary reason for this is that commit - process, in order to guarantee atomicity, is a single drive of a + The commit process requires, per repository, a single drive of a commit editor which is based not on working copy paths, but on - URLs. With the completion of 'svn switch', it became all too - likely that the on-disk working copy hierarchy would no longer be - guaranteed to map to a similar in-repository hierarchy. - - Aside from this new brokenness of the old system, an unrelated - feature request had cropped up -- the ability to know in advance of - your commit, exactly what would be committed (so that log messages - could be initially populated with this information). Since the old - crawler discovered commit candidates while in the process of - committing, it was impossible to harvest this information upfront. - As a workaround, svn_wc_statuses() was used to stat the whole - working copy for changes before the commit started...and then the - commit would again stat the whole tree for changes. - - Enter the new system. + URLs. The on-disk working copy hierarchy does not, in general, + map to a similar in-repository hierarchy, due to switched subtrees + and disjoint working copies. + + Also we wish to know exactly what would be committed, in advance of + the commit, so that a log message editor can be initially populated + with this information. The primary goal of this system is very straightforward: harvest all commit candidate information up front, and cache enough info in the process to use this to drive a URL-sorted commit. - *** END-OF-KNOWLEDGE *** - - The prototypes below are still in development. In general, the - idea is that commit-y processes ('svn mkdir URL', 'svn delete URL', + The idea is that commit-y processes ('svn mkdir URL', 'svn delete URL', 'svn commit', 'svn copy WC_PATH URL', 'svn copy URL1 URL2', 'svn move URL1 URL2', others?) generate the cached commit candidate information, and hand this information off to a consumer which is @@ -844,7 +799,7 @@ typedef svn_error_t *(*svn_client__check - if the candidate has a lock token, add it to the LOCK_TOKENS hash. - if the candidate is a directory scheduled for deletion, crawl - the directories children recursively for any lock tokens and + the directory's children recursively for any lock tokens and add them to the LOCK_TOKENS array. At the successful return of this function, COMMITTABLES will point @@ -915,6 +870,18 @@ svn_client__condense_commit_items(const apr_array_header_t *commit_items, apr_pool_t *pool); +/* Rewrite the COMMIT_ITEMS array to be sorted by URL. + Rewrite the items' URLs to be relative to BASE_URL. + + COMMIT_ITEMS is an array of (svn_client_commit_item3_t *) items. + + Afterwards, some of the items in COMMIT_ITEMS may contain data + allocated in POOL. */ +svn_error_t * +svn_client__condense_commit_items2(const char *base_url, + apr_array_header_t *commit_items, + apr_pool_t *pool); + /* Commit the items in the COMMIT_ITEMS array using EDITOR/EDIT_BATON to describe the committed local mods. Prior to this call, COMMIT_ITEMS should have been run through (and BASE_URL generated @@ -1129,24 +1096,26 @@ svn_client__resolve_conflicts(svn_boolea svn_client_ctx_t *ctx, apr_pool_t *scratch_pool); -/* Produce a diff with depth DEPTH between two files or two directories at - * LEFT_ABSPATH1 and RIGHT_ABSPATH, using the provided diff callbacks to - * show changes in files. The files and directories involved may be part of - * a working copy or they may be unversioned. For versioned files, show - * property changes, too. +/* Produce a diff with depth DEPTH between the file or directory at + * LEFT_ABSPATH and the file or directory at RIGHT_ABSPATH, reporting + * differences to DIFF_PROCESSOR. + * + * The files and directories involved may be part of a working copy or + * they may be unversioned. For versioned files, show property changes, + * too. * - * If ANCHOR_ABSPATH is not null, set it to the anchor of the diff before - * the first processor call. (The anchor is LEFT_ABSPATH or an ancestor of it) + * No copy or move information is reported to the diff processor. + * + * Anchor the DIFF_PROCESSOR at the requested diff targets (LEFT_ABSPATH, + * RIGHT_ABSPATH). As any children reached by recursion are matched by + * name, a diff processor relpath applies equally to both sides of the diff. */ svn_error_t * -svn_client__arbitrary_nodes_diff(const char **root_relpath, - svn_boolean_t *root_is_dir, - const char *left_abspath, +svn_client__arbitrary_nodes_diff(const char *left_abspath, const char *right_abspath, svn_depth_t depth, const svn_diff_tree_processor_t *diff_processor, svn_client_ctx_t *ctx, - apr_pool_t *result_pool, apr_pool_t *scratch_pool); Modified: subversion/branches/addremove/subversion/libsvn_client/commit.c URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/commit.c?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_client/commit.c (original) +++ subversion/branches/addremove/subversion/libsvn_client/commit.c Sat May 23 14:16:56 2020 @@ -500,6 +500,129 @@ append_externals_as_explicit_targets(apr return SVN_NO_ERROR; } +/* Crawl the working copy for commit items. + */ +static svn_error_t * +harvest_committables(apr_array_header_t **commit_items_p, + apr_hash_t **committables_by_path_p, + apr_hash_t **lock_tokens, + const char *base_dir_abspath, + const apr_array_header_t *targets, + int depth_empty_start, + svn_depth_t depth, + svn_boolean_t just_locked, + const apr_array_header_t *changelists, + svn_client_ctx_t *ctx, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + struct check_url_kind_baton cukb; + svn_client__committables_t *committables; + apr_hash_index_t *hi; + + /* Prepare for when we have a copy containing not-present nodes. */ + cukb.pool = scratch_pool; + cukb.session = NULL; /* ### Can we somehow reuse session? */ + cukb.repos_root_url = NULL; + cukb.ctx = ctx; + + SVN_ERR(svn_client__harvest_committables(&committables, lock_tokens, + base_dir_abspath, targets, + depth_empty_start, depth, + just_locked, + changelists, + check_url_kind, &cukb, + ctx, result_pool, scratch_pool)); + if (apr_hash_count(committables->by_repository) == 0) + { + *commit_items_p = NULL; + return SVN_NO_ERROR; /* Nothing to do */ + } + else if (apr_hash_count(committables->by_repository) > 1) + { + return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL, + _("Commit can only commit to a single repository at a time.\n" + "Are all targets part of the same working copy?")); + } + + hi = apr_hash_first(scratch_pool, committables->by_repository); + *commit_items_p = apr_hash_this_val(hi); + if (committables_by_path_p) + *committables_by_path_p = committables->by_path; + return SVN_NO_ERROR; +} + +svn_error_t * +svn_client__wc_replay(const char *src_wc_abspath, + const apr_array_header_t *targets, + svn_depth_t depth, + const apr_array_header_t *changelists, + const svn_delta_editor_t *editor, + void *edit_baton, + svn_wc_notify_func2_t notify_func, + void *notify_baton, + svn_client_ctx_t *ctx, + apr_pool_t *pool) +{ + const char *base_abspath; + apr_array_header_t *rel_targets; + apr_hash_t *lock_tokens; + apr_array_header_t *commit_items; + svn_client__pathrev_t *base; + const char *base_url; + svn_wc_notify_func2_t saved_notify_func; + void *saved_notify_baton; + + /* Condense the target list. This makes all targets absolute. */ + SVN_ERR(svn_dirent_condense_targets(&base_abspath, &rel_targets, targets, + FALSE, pool, pool)); + + /* No targets means nothing to commit, so just return. */ + if (base_abspath == NULL) + return SVN_NO_ERROR; + + SVN_ERR_ASSERT(rel_targets != NULL); + + /* If we calculated only a base and no relative targets, this + must mean that we are being asked to commit (effectively) a + single path. */ + if (rel_targets->nelts == 0) + APR_ARRAY_PUSH(rel_targets, const char *) = ""; + + /* Crawl the working copy for commit items. */ + SVN_ERR(harvest_committables(&commit_items, NULL /*committables_by_path_p*/, + &lock_tokens, + base_abspath, rel_targets, + -1 /*depth_empty_start*/, + depth, + FALSE /*just_locked*/, + changelists, + ctx, pool, pool)); + if (!commit_items) + { + return SVN_NO_ERROR; + } + + SVN_ERR(svn_client__wc_node_get_base(&base, + src_wc_abspath, ctx->wc_ctx, pool, pool)); + base_url = base->url; + /* Sort our COMMIT_ITEMS by URL and find their relative URL-paths. */ + SVN_ERR(svn_client__condense_commit_items2(base_url, commit_items, pool)); + + saved_notify_func = ctx->notify_func2; + saved_notify_baton = ctx->notify_baton2; + ctx->notify_func2 = notify_func; + ctx->notify_baton2 = notify_baton; + /* BASE_URL is only used here in notifications & errors */ + SVN_ERR(svn_client__do_commit(base_url, commit_items, + editor, edit_baton, + NULL /*notify_prefix*/, NULL /*sha1_checksums*/, + ctx, pool, pool)); + ctx->notify_func2 = saved_notify_func; + ctx->notify_baton2 = saved_notify_baton; + return SVN_NO_ERROR; +} + svn_error_t * svn_client_commit6(const apr_array_header_t *targets, svn_depth_t depth, @@ -525,7 +648,7 @@ svn_client_commit6(const apr_array_heade apr_array_header_t *rel_targets; apr_array_header_t *lock_targets; apr_array_header_t *locks_obtained; - svn_client__committables_t *committables; + apr_hash_t *committables_by_path; apr_hash_t *lock_tokens; apr_hash_t *sha1_checksums; apr_array_header_t *commit_items; @@ -615,55 +738,27 @@ svn_client_commit6(const apr_array_heade pool); /* Crawl the working copy for commit items. */ - { - struct check_url_kind_baton cukb; - - /* Prepare for when we have a copy containing not-present nodes. */ - cukb.pool = iterpool; - cukb.session = NULL; /* ### Can we somehow reuse session? */ - cukb.repos_root_url = NULL; - cukb.ctx = ctx; - - cmt_err = svn_error_trace( - svn_client__harvest_committables(&committables, - &lock_tokens, - base_abspath, - rel_targets, - depth_empty_after, - depth, - ! keep_locks, - changelists, - check_url_kind, - &cukb, - ctx, - pool, - iterpool)); - - svn_pool_clear(iterpool); - } + cmt_err = svn_error_trace( + harvest_committables(&commit_items, &committables_by_path, + &lock_tokens, + base_abspath, + rel_targets, + depth_empty_after, + depth, + ! keep_locks, + changelists, + ctx, + pool, + iterpool)); + svn_pool_clear(iterpool); if (cmt_err) goto cleanup; - if (apr_hash_count(committables->by_repository) == 0) + if (!commit_items) { goto cleanup; /* Nothing to do */ } - else if (apr_hash_count(committables->by_repository) > 1) - { - cmt_err = svn_error_create( - SVN_ERR_UNSUPPORTED_FEATURE, NULL, - _("Commit can only commit to a single repository at a time.\n" - "Are all targets part of the same working copy?")); - goto cleanup; - } - - { - apr_hash_index_t *hi = apr_hash_first(iterpool, - committables->by_repository); - - commit_items = apr_hash_this_val(hi); - } /* If our array of targets contains only locks (and no actual file or prop modifications), then we return here to avoid committing a @@ -713,7 +808,7 @@ svn_client_commit6(const apr_array_heade if (moved_from_abspath && delete_op_root_abspath) { svn_client_commit_item3_t *delete_half = - svn_hash_gets(committables->by_path, delete_op_root_abspath); + svn_hash_gets(committables_by_path, delete_op_root_abspath); if (!delete_half) { @@ -769,7 +864,7 @@ svn_client_commit6(const apr_array_heade if (moved_to_abspath && copy_op_root_abspath && strcmp(moved_to_abspath, copy_op_root_abspath) == 0 && - svn_hash_gets(committables->by_path, copy_op_root_abspath) + svn_hash_gets(committables_by_path, copy_op_root_abspath) == NULL) { cmt_err = svn_error_createf(