Modified: subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original) +++ subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Fri Dec 6 13:59:05 2024 @@ -788,7 +788,7 @@ svn_swig_rb_set_pool(VALUE target, VALUE struct rb_set_pool_for_hash_arg arg; arg.set = FALSE; arg.pool = pool; - rb_hash_foreach(target, rb_set_pool_for_hash_callback, (VALUE)&arg); + rb_hash_foreach(target, (int(*)(ANYARGS))rb_set_pool_for_hash_callback, (VALUE)&arg); return arg.set; } else { return rb_set_pool_if_swig_type_object(target, pool); @@ -806,7 +806,7 @@ svn_swig_rb_set_pool_for_no_swig_type(VA target = rb_ary_new3(1, target); } - rb_iterate(rb_each, target, rb_set_pool, pool); + rb_iterate((VALUE(*)())rb_each, target, (VALUE(*)())rb_set_pool, pool); } void @@ -1070,7 +1070,8 @@ svn_swig_rb_to_apr_array_row_prop(VALUE result = apr_array_make(pool, 0, sizeof(svn_prop_t)); arg.array = result; arg.pool = pool; - rb_hash_foreach(array_or_hash, svn_swig_rb_to_apr_array_row_prop_callback, + rb_hash_foreach(array_or_hash, + (int(*)(ANYARGS))svn_swig_rb_to_apr_array_row_prop_callback, (VALUE)&arg); return result; } else { @@ -1125,7 +1126,8 @@ svn_swig_rb_to_apr_array_prop(VALUE arra result = apr_array_make(pool, 0, sizeof(svn_prop_t *)); arg.array = result; arg.pool = pool; - rb_hash_foreach(array_or_hash, svn_swig_rb_to_apr_array_prop_callback, + rb_hash_foreach(array_or_hash, + (int(*)(ANYARGS))svn_swig_rb_to_apr_array_prop_callback, (VALUE)&arg); return result; } else { @@ -1548,7 +1550,7 @@ r2c_hash(VALUE hash, r2c_func func, void data.func = func; data.pool = pool; - rb_hash_foreach(hash, r2c_hash_i, (VALUE)&data); + rb_hash_foreach(hash, (int(*)(ANYARGS))r2c_hash_i, (VALUE)&data); return apr_hash; } @@ -1570,7 +1572,9 @@ svn_swig_rb_hash_to_apr_hash_svn_string( apr_hash_t * svn_swig_rb_hash_to_apr_hash_swig_type(VALUE hash, const char *typename, apr_pool_t *pool) { - return r2c_hash(hash, r2c_swig_type, (void *)typename, pool); + /* Note: casting to r2c_cunc for r2c_swig_type may unsafe, because + it contains the cast from "const void *" to "void *" */ + return r2c_hash(hash, (r2c_func)r2c_swig_type, (void *)typename, pool); } apr_hash_t * @@ -1651,7 +1655,8 @@ invoke_callback(VALUE baton, VALUE pool) argv[0] = pool; svn_swig_rb_get_pool(1, argv, Qnil, &subpool, NULL); cbb->pool = subpool; - return rb_ensure(callback, baton, callback_ensure, subpool); + return rb_ensure((VALUE(*)(ANYARGS))callback, baton, + (VALUE(*)(ANYARGS))callback_ensure, subpool); } static VALUE @@ -1660,9 +1665,9 @@ callback_handle_error(VALUE baton, ...) callback_handle_error_baton_t *handle_error_baton; handle_error_baton = (callback_handle_error_baton_t *)baton; - return rb_rescue2(callback, + return rb_rescue2((VALUE(*)(ANYARGS))callback, (VALUE)(handle_error_baton->callback_baton), - callback_rescue, + (VALUE(*)(ANYARGS))callback_rescue, (VALUE)(handle_error_baton->rescue_baton), rb_svn_error(), (VALUE)0); @@ -1681,8 +1686,9 @@ invoke_callback_handle_error(VALUE baton handle_error_baton.callback_baton = cbb; handle_error_baton.rescue_baton = &rescue_baton; - return rb_ensure(callback_handle_error, (VALUE)&handle_error_baton, - callback_ensure, pool); + return rb_ensure((VALUE(*)(ANYARGS))callback_handle_error, + (VALUE)&handle_error_baton, + (VALUE(*)(ANYARGS))callback_ensure, pool); } @@ -1735,7 +1741,8 @@ svn_swig_rb_set_baton(VALUE target, VALU target = rb_ary_new3(1, target); } - rb_iterate(rb_each, target, add_baton_if_delta_editor, baton); + rb_iterate((VALUE(*)())rb_each, target, + (VALUE(*)())add_baton_if_delta_editor, baton); }
Modified: subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/svn/core.rb URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/svn/core.rb?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/svn/core.rb (original) +++ subversion/branches/pristine-checksum-kind/subversion/bindings/swig/ruby/svn/core.rb Fri Dec 6 13:59:05 2024 @@ -812,7 +812,7 @@ module Svn def diff(to, consider_inheritance=false) result = Core.rangelist_diff(self, to, consider_inheritance) deleted = result.pop - added = result + added = result.pop [added, deleted].collect do |result| self.class.new(*result) end Modified: subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_client.i URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_client.i?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_client.i (original) +++ subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_client.i Fri Dec 6 13:59:05 2024 @@ -50,7 +50,8 @@ %apply const char *MAY_BE_NULL { const char *native_eol, const char *comment, - const char *relative_to_dir + const char *relative_to_dir, + const char *wri_abspath }; #ifdef SWIGRUBY Modified: subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_delta.i URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_delta.i?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_delta.i (original) +++ subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_delta.i Fri Dec 6 13:59:05 2024 @@ -68,8 +68,6 @@ ### There must be a cleaner way to implement this? ### Maybe follow Ruby by wrapping it where passing an editor? */ void svn_swig_py_make_editor(const svn_delta_editor_t **editor, - void **edit_baton, - PyObject *py_editor, apr_pool_t *pool); #endif @@ -207,6 +205,49 @@ void _ops_get(int *num_ops, const svn_tx #ifdef SWIGPYTHON %pythoncode %{ +# Baton container class for editor/parse_fns3 batons and their decendants. +class _ItemBaton: + def __init__(self, editor, pool, baton=None): + self.pool = pool if pool else libsvn.core.svn_pool_create() + self.baton = baton + self.editor = editor + + def get_ancestor(self): + raise NotImplementedError + + def make_decendant(self, pool, baton=None): + return _DecBaton(self, pool, baton) + + +class _DecBaton(_ItemBaton): + def __init__(self, parent, pool, baton=None): + import weakref + _ItemBaton.__init__(self, parent.editor, pool, baton) + self._anc = weakref.ref(parent.get_ancestor()) + self._anc().hold_baton(self) + + def get_ancestor(self): + return self._anc() + + def release_self(self): + self._anc().release_baton(self) + + +class _AncBaton(_ItemBaton): + def __init__(self, editor, pool, baton=None): + _ItemBaton.__init__(self, editor, pool, baton) + self._dec = {} # hold decendant batons. + + def get_ancestor(self): + return self + + def hold_baton(self, baton): + self._dec[id(baton)] = baton + + def release_baton(self, baton): + del self._dec[id(baton)] + + # This function is for backwards compatibility only. # Use svn_txdelta_window_t.ops instead. svn_txdelta_window_t_ops_get = svn_txdelta_window_t._ops_get Modified: subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_repos.i URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_repos.i?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_repos.i (original) +++ subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_repos.i Fri Dec 6 13:59:05 2024 @@ -162,8 +162,6 @@ svn_error_t *svn_repos_dump_fs2(svn_repo #ifdef SWIGPYTHON /* Make swig wrap this function for us, to allow making a vtable in python */ void svn_swig_py_make_parse_fns3(const svn_repos_parse_fns3_t **parse_fns3, - void **parse_baton, - PyObject *py_parse_fns3, apr_pool_t *pool); #endif Modified: subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_wc.i URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_wc.i?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_wc.i (original) +++ subversion/branches/pristine-checksum-kind/subversion/bindings/swig/svn_wc.i Fri Dec 6 13:59:05 2024 @@ -242,6 +242,8 @@ { $result = $1 ? svn_swig_rb_svn_error_to_rb_error($1) : Qnil; } + +%typemap(ret) svn_error_t *err ""; #endif Modified: subversion/branches/pristine-checksum-kind/subversion/include/private/svn_client_private.h URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/private/svn_client_private.h?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/include/private/svn_client_private.h (original) +++ subversion/branches/pristine-checksum-kind/subversion/include/private/svn_client_private.h Fri Dec 6 13:59:05 2024 @@ -160,6 +160,30 @@ const char * svn_client__pathrev_fspath(const svn_client__pathrev_t *pathrev, apr_pool_t *result_pool); +/* State provided by the diff drivers; used by the diff writer */ +typedef struct svn_client__diff_driver_info_t +{ + /* The anchor to prefix before wc paths */ + const char *anchor; + + /* Relative path of ra session from repos_root_url. + + Used only in printing git diff headers. The repository-root-relative + path of ... ### what user-visible property of the diff? */ + const char *session_relpath; + + /* Used only in printing git diff headers. Used to find the + repository-root-relative path of a WC path. */ + svn_wc_context_t *wc_ctx; + + /* The original targets passed to the diff command. We may need + these to construct distinctive diff labels when comparing the + same relative path in the same revision, under different anchors + (for example, when comparing a trunk against a branch). */ + const char *orig_path_1; + const char *orig_path_2; +} svn_client__diff_driver_info_t; + /* Given PATH_OR_URL, which contains either a working copy path or an absolute URL, a peg revision PEG_REVISION, and a desired revision REVISION, create an RA connection to that object as it exists in @@ -321,8 +345,12 @@ svn_client__mergeinfo_log(svn_boolean_t apr_pool_t *result_pool, apr_pool_t *scratch_pool); -/** Return a diff processor that will print a Subversion-style - * (not git-style) diff. +/** Return a diff processor that will print a diff in Subversion-style + * or git-style, based on @a use_git_diff_format value. + * + * @a ddi_p will be initialized with a svn_client__diff_driver_info_t, + * which should describe some settings of the diff writer. It can be modified + * in future as required, and the writer should accept with them. * * @a anchor is optional (may be null), and is the 'anchor' path to prefix * to the diff-processor paths before displaying. @@ -335,6 +363,7 @@ svn_client__mergeinfo_log(svn_boolean_t svn_error_t * svn_client__get_diff_writer_svn( svn_diff_tree_processor_t **diff_processor, + svn_client__diff_driver_info_t **ddi_p, const char *anchor, const char *orig_path_1, const char *orig_path_2, @@ -347,6 +376,7 @@ svn_client__get_diff_writer_svn( svn_boolean_t ignore_properties, svn_boolean_t properties_only, svn_boolean_t pretty_print_mergeinfo, + svn_boolean_t use_git_diff_format, const char *header_encoding, svn_stream_t *outstream, svn_stream_t *errstream, Modified: subversion/branches/pristine-checksum-kind/subversion/include/private/svn_cmdline_private.h URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/private/svn_cmdline_private.h?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/include/private/svn_cmdline_private.h (original) +++ subversion/branches/pristine-checksum-kind/subversion/include/private/svn_cmdline_private.h Fri Dec 6 13:59:05 2024 @@ -278,6 +278,34 @@ svn_cmdline__stdin_readline(const char * apr_pool_t *result_pool, apr_pool_t *scratch_pool); +#if defined(WIN32) +/* Normalizes Windows-specific command line arguments, such as those passed + to wmain(), to the environment-specific code page. */ +svn_error_t * +svn_cmdline__win32_get_cstring_argv(const char **cstring_argv_p[], + int argc, + const wchar_t *argv[], + apr_pool_t *result_pool); +#endif + +/* Default platform-agnostic handler that normalizes command line arguments + to the environment-specific code page. */ +svn_error_t * +svn_cmdline__default_get_cstring_argv(const char **cstring_argv_p[], + int argc, + const char *argv[], + apr_pool_t *result_pool); + +#if defined(WIN32) && defined(_MSC_VER) +typedef wchar_t svn_cmdline__argv_char_t; +#define SVN_CMDLINE__MAIN wmain +#define svn_cmdline__get_cstring_argv svn_cmdline__win32_get_cstring_argv +#else +typedef char svn_cmdline__argv_char_t; +#define SVN_CMDLINE__MAIN main +#define svn_cmdline__get_cstring_argv svn_cmdline__default_get_cstring_argv +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: subversion/branches/pristine-checksum-kind/subversion/include/private/svn_diff_tree.h URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/private/svn_diff_tree.h?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/include/private/svn_diff_tree.h (original) +++ subversion/branches/pristine-checksum-kind/subversion/include/private/svn_diff_tree.h Fri Dec 6 13:59:05 2024 @@ -29,6 +29,7 @@ #define SVN_DIFF_TREE_H #include "svn_types.h" +#include "svn_io.h" /* for svn_stream_t */ #ifdef __cplusplus extern "C" { @@ -360,6 +361,17 @@ svn_diff__tree_processor_tee_create(cons const svn_diff_tree_processor_t *processor2, apr_pool_t *result_pool); +/* Return a debug processor that writes the actions to @a out_stream. + * + * The debug diff tree processor simply prints an indication of what callbacks + * are being called and the arguments given to @a out_stream, and is only + * intended for use in debugging Subversion diff processors. + * + * Note: Our test suite generally ignores stdout lines starting with "DBG:". + */ +const svn_diff_tree_processor_t * +svn_diff__tree_processor_debug_create(svn_stream_t *out_stream, + apr_pool_t *result_pool); svn_diff_source_t * svn_diff__source_create(svn_revnum_t revision, Modified: subversion/branches/pristine-checksum-kind/subversion/include/svn_opt.h URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/svn_opt.h?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/include/svn_opt.h (original) +++ subversion/branches/pristine-checksum-kind/subversion/include/svn_opt.h Fri Dec 6 13:59:05 2024 @@ -534,6 +534,30 @@ svn_opt_parse_revision_to_range(apr_arra apr_pool_t *pool); /** + * Parse @a arg, where @a arg is "N", "-N", "N-M" into a + * @c svn_opt_revision_range_t and push that onto @a opt_ranges. + * + * - If @a arg is "N", set the @c start field of the + * @c svn_opt_revision_range_t to N-1 and @c end field to N. + * + * - If @a arg is "-N", set the @c start field of the + * @c svn_opt_revision_range_t to N and @c end field to N-1. + * + * - If @a arg is "N-M", set the @c start field of the + * @c svn_opt_revision_range_t to N-1 and @c end field to M. + * + * If @a arg is invalid, return -1; else return 0. + * + * Use @a result_pool to allocate @c svn_opt_revision_range_t pushed to the + * array. + * + * @since New in 1.15. + */ +int svn_opt_parse_change_to_range(apr_array_header_t *opt_ranges, + const char *arg, + apr_pool_t *result_pool); + +/** * Resolve peg revisions and operational revisions in the following way: * * - If @a is_url is set and @a peg_rev->kind is Modified: subversion/branches/pristine-checksum-kind/subversion/include/svn_wc.h URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/include/svn_wc.h?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/include/svn_wc.h (original) +++ subversion/branches/pristine-checksum-kind/subversion/include/svn_wc.h Fri Dec 6 13:59:05 2024 @@ -993,6 +993,7 @@ typedef enum svn_wc_notify_action_t svn_wc_notify_restore, /** Reverting a modified path. */ + /* See also svn_wc_notify_revert_noaccess */ svn_wc_notify_revert, /** A revert operation has failed. */ @@ -1325,6 +1326,12 @@ typedef enum svn_wc_notify_action_t * @since New in 1.15. */ svn_wc_notify_warning, + /** A file is readonly for the user but isn't svn:needs-lock. + * So we want to restore RW, but fail since the file has W bits, + * just not for the current user. + * @since New in 1.15. */ + svn_wc_notify_revert_noaccess, + } svn_wc_notify_action_t; Modified: subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h (original) +++ subversion/branches/pristine-checksum-kind/subversion/libsvn_client/client.h Fri Dec 6 13:59:05 2024 @@ -1173,7 +1173,7 @@ svn_client__remote_propget(apr_hash_t *p apr_pool_t *scratch_pool); /* */ -typedef struct merge_source_t +typedef struct svn_client__merge_source_t { /* "left" side URL and revision (inclusive iff youngest) */ const svn_client__pathrev_t *loc1; @@ -1183,10 +1183,23 @@ typedef struct merge_source_t /* True iff LOC1 is an ancestor of LOC2 or vice-versa (history-wise). */ svn_boolean_t ancestral; -} merge_source_t; +} svn_client__merge_source_t; + +/* Return a new merge_source_t structure, allocated in RESULT_POOL, + * initialized with deep copies of LOC1 and LOC2 and ANCESTRAL. */ +svn_client__merge_source_t * +svn_client__merge_source_create(const svn_client__pathrev_t *loc1, + const svn_client__pathrev_t *loc2, + svn_boolean_t ancestral, + apr_pool_t *result_pool); + +/* Return a deep copy of SOURCE, allocated in RESULT_POOL. */ +svn_client__merge_source_t * +svn_client__merge_source_dup(const svn_client__merge_source_t *source, + apr_pool_t *result_pool); /* Description of the merge target root node (a WC working node) */ -typedef struct merge_target_t +typedef struct svn_client__merge_target_t { /* Absolute path to the WC node */ const char *abspath; @@ -1196,23 +1209,7 @@ typedef struct merge_target_t * REPOS_ROOT_URL and REPOS_UUID are always valid. */ svn_client__pathrev_t loc; -} merge_target_t; - -/* - * Similar API to svn_client_merge_peg5(). - */ -svn_error_t * -svn_client__merge_elements(svn_boolean_t *use_sleep, - apr_array_header_t *merge_sources, - merge_target_t *target, - svn_ra_session_t *ra_session, - svn_boolean_t diff_ignore_ancestry, - svn_boolean_t force_delete, - svn_boolean_t dry_run, - const apr_array_header_t *merge_options, - svn_client_ctx_t *ctx, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool); +} svn_client__merge_target_t; /* Data for reporting when a merge aborted because of raising conflicts. * @@ -1223,7 +1220,7 @@ typedef struct svn_client__conflict_repo { const char *target_abspath; /* The revision range during which conflicts were raised */ - const merge_source_t *conflicted_range; + const svn_client__merge_source_t *conflicted_range; /* Was the conflicted range the last range in the whole requested merge? */ svn_boolean_t was_last_range; } svn_client__conflict_report_t; Modified: subversion/branches/pristine-checksum-kind/subversion/libsvn_client/copy.c URL: http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_client/copy.c?rev=1922345&r1=1922344&r2=1922345&view=diff ============================================================================== --- subversion/branches/pristine-checksum-kind/subversion/libsvn_client/copy.c (original) +++ subversion/branches/pristine-checksum-kind/subversion/libsvn_client/copy.c Fri Dec 6 13:59:05 2024 @@ -3077,7 +3077,7 @@ try_copy(svn_boolean_t *timestamp_sleep, APR_ARRAY_PUSH(copy_pairs, svn_client__copy_pair_t *) = pair; } - if (!srcs_are_urls && !dst_is_url) + if (is_move || (!srcs_are_urls && !dst_is_url)) { apr_pool_t *iterpool = svn_pool_create(pool); @@ -3092,9 +3092,15 @@ try_copy(svn_boolean_t *timestamp_sleep, pair->dst_abspath_or_url, iterpool)) return svn_error_createf (SVN_ERR_UNSUPPORTED_FEATURE, NULL, - _("Cannot copy path '%s' into its own child '%s'"), - svn_dirent_local_style(pair->src_abspath_or_url, pool), - svn_dirent_local_style(pair->dst_abspath_or_url, pool)); + is_move ? + _("Cannot move path '%s' into its own child '%s'") : + _("Cannot copy path '%s' into its own child '%s'"), + svn_path_is_url(pair->src_abspath_or_url) ? + pair->src_abspath_or_url : + svn_dirent_local_style(pair->src_abspath_or_url, pool), + svn_path_is_url(pair->dst_abspath_or_url) ? + pair->dst_abspath_or_url : + svn_dirent_local_style(pair->dst_abspath_or_url, pool)); } svn_pool_destroy(iterpool);