Ivan Zhakov

* COMMITTERS: Move myself to dormant section since I'm no longer member of

Subversion PMC.

Use our svn_xml_parser_t wrapper around Expat XML parser in libsvn_ra_serf and

mod_dontdothat.

* build.conf

(libsvn_ra_serf, mod_dontdothat): Remove dependency on xml (libexpat).

* subversion/libsvn_ra_serf/ra_serf.h

(): Do not include <expat.h>

* subversion/libsvn_ra_serf/xml.c

(): Do not include <expat.h>

(XML_STATUS_OK, XML_STATUS_ERROR, XML_VERSION_AT_LEAST): Remove.

(expat_ctx_t): Remove INNER_ERROR and change type of PARSER to

svn_xml_parser_t *.

(parse_xml): Just use svn_xml_parse().

(xml_parser_cleanup): Remove.

(expat_start, expat_end, expat_cdata): Update to match svn_xml_parser_t

callback signatures.

(expat_response_handler): Just use svn_xml_make_parser() instead of

constructing XML_ParserCreate() to create XML parser. Do not register

pool cleanup handler, because svn_xml_parser_t will be automatically

freed on pool cleanup.

* tools/server-side/mod_dontdothat/mod_dontdothat.c

(): Do not include <expat.h>, include "svn_xml.h"

(dontdothat_filter_ctx): Change type of XMLP to svn_xml_parser_t *.

(dontdothat_filter): Use svn_xml_parse() instead of XML_Parse().

(cdata): Update to match svn_xml_parser_t callback signatures.

(start_element, end_element): Add comment that these functions implement

svn_xml_start_elem and svn_xml_end_elem respectively.

(clean_up_parser): Remove.

(dontdothat_insert_filters): Just use svn_xml_make_parser() instead of

constructing XML_ParserCreate() to create XML parser. Do not register

pool cleanup handler, because svn_xml_parser_t will be automatically

freed on pool cleanup.

Use XML_StopParser with Expat >= 1.95.8 to abort XML parsing in the middle

of parse buffer if svn_xml_signal_bailout() was called.

(Mostly copied from subversion/libsvn_ra_serf/xml.c)

* subversion/libsvn_subr/xml.c

(XML_VERSION_AT_LEAST): New. Copied from subversion/libsvn_ra_serf/xml.c.

(expat_start_handler, expat_end_handler, expat_data_handler): Call

XML_StopParser() if SVN_PARSER->ERROR is not NULL.

Extend XML parser tests to validate that callbacks are not invoked after

svn_xml_signal_bailout() is called.

* subversion/tests/libsvn_subr/xml-test.c

(xml_callbacks_baton_t): New.

(strbuf_start_elem, strbuf_end_elem, strbuf_cdata): Accept

xml_callbacks_baton_t * as baton.

(err_end_elem): Accept xml_callbacks_baton_t * as baton. Log invocation to

stringbuf before raising error.

(test_simple, test_invalid_xml, test_invalid_xml_signal_bailout): Use

xml_callbacks_baton_t as baton for XML parser.

(test_signal_bailout): Use xml_callbacks_baton_t as baton for XML parser

callbacks and check callback invocation log.

Implement standard lifetime semantics for svn_xml_parser_t: the object will be

automatically freed on pool cleanup. But it still can be freed explicitly

using svn_xml_free_parser(). It's the same behavior we already have for

svn_sqlite__db_t and similar.

* subversion/include/svn_xml.h

(svn_xml_make_parser): Document existing and new behavior regarding

svn_xml_parser_t lifetime.

* subversion/libsvn_subr/xml.c

(parser_cleanup): New.

(svn_xml_make_parser): Do not create SUBPOOL and allocate svn_parser_t from

provided POOL. Register pool cleanup handler to free Expat parser.

* subversion/tests/libsvn_subr/xml-test.c

(test_parser_free): New test.

(test_funcs): Add test_parser_free to the test list.

Fix potential error leak in svn_xml_parser_t wrapper for XML parser discovered

by xml-test.exe#4 test added in r1765214.

* subversion/libsvn_subr/xml.c

(svn_xml_parse): Prefer API user error provided from callback via

svn_xml_signal_bailout(), instead of syntax XML error from Expat if we have

both.

Follow-up to r1765214: Use APR_EGENERAL error code instead of

SVN_ERR_ASSERTION_FAIL as test code, since test assertion macros have special

handling of SVN_ERR_ASSERTION_FAIL.

* subversion/tests/libsvn_subr/xml-test.c

(err_end_elem): Return APR_EGENERAL, instead of SVN_ERR_ASSERTION_FAIL.

(test_signal_bailout, test_invalid_xml_signal_bailout): Expect APR_EGENERAL.

Add basic tests for svn_xml_parser_t API.

* build.conf

(xml-test): New.

(__ALL_TESTS__): Add xml-test to dependency list.

* subversion/tests/libsvn_subr/xml-test.c

(strbuf_start_elem, strbuf_end_elem, strbuf_cdata, err_end_elem,

test_simple, test_invalid_xml, test_signal_bailout,

test_invalid_xml_signal_bailout, max_threads, test_funcs): New.

    • ?
    /trunk/subversion/tests/libsvn_subr/xml-test.c
Small correctness fix in build.conf: remove dependency on xml (libexpat) from

serf, because serf doesn't use libexpat. Only libsvn_ra_serf does, but it has

explicit dependency.

* build.conf

(serf): Remove dependency on xml.

Improve C90 compatibility by removing trailing commas in enum lists as well as

converting a variadic macro stub with an empty function.

* subversion/include/svn_client.h

* subversion/include/svn_wc.h

* subversion/libsvn_subr/cache-membuffer.c

* subversion/svn/svn.c

* subversion/svnmucc/svnmucc.c

(svn_client_config_option_id_t, svn_wc_notify_action_t,

prefix_pool_create, svn_cl__longopt_t, sub_main): Remove trailing commas

in enum lists.

* tools/dev/svnmover/linenoise/linenouse.c

(lndebug): Replace variadic macro stub with an empty variadic function.

Patch by: Patrick Steinhardt <ps{_AT_}pks.im>

(Log message tweaked by me.)

Rename svn_client_conflict_option_describe() to

svn_client_conflict_option_get_description().

* subversion/include/svn_client.h

* subversion/libsvn_client/conflicts.c

(svn_client_conflict_option_describe): Rename to

svn_client_conflict_option_get_description.

* subversion/svn/conflict-callbacks.c

(find_option_by_builtin): Adapt callers.

Simplify svn_client_conflict_option_describe() API to match

svn_client_conflict_option_label().

* subversion/include/svn_client.h

* subversion/libsvn_client/conflicts.c

(svn_client_conflict_option_describe): Drop svn_error_t and scratch_pool.

* subversion/svn/conflict-callbacks.c

(find_option_by_builtin): Adapt callers.

Move conflict resolution options' labels out of the client.

* subversion/include/svn_client.h:

(svn_client_conflict_option_get_label): New function.

* subversion/libsvn_client/conflicts.c:

(svn_client_conflict_option_t): Add label.

(add_resolution_option): Add label argument.

(svn_client_conflict_option_get_label): New function.

(svn_client_conflict_text_get_reslution_options,

svn_client_conflict_prop_get_resolution_options,

configure_option_accept_current_wc_state,

configure_option_move_destination,

configure_option_update_raise_moved_away_children,

configure_option_incoming_add_ignore,

configure_option_incoming_added_file_text_merge,

configure_option_incoming_added_file_replace_and_merge,

configure_option_incoming_added_dir_merge,

configure_option_incoming_added_dir_replace,

configure_option_incoming_added_dir_replace_and_merge,

configure_option_incoming_delete_ignore,

configure_option_incoming_delete_accept,

configure_option_incoming_move_file_merge,

configure_option_incoming_dir_merge,

configure_option_local_move_file_merge,

svn_client_conflict_tree_get_resolution_options): Set

resolution option labels.

* subversion/svn/conflict-callbacks.c:

(resolver_option_t): Remove short_desc and long_desc.

(client_option_t): New struct for client options.

(builtin_resolver_options): Remove short_desc and long_desc.

(extra_resolver_options,

extra_resolver_options_text,

extra_resolver_options_prop,

extra_resolver_options_tree): Convert to client_option_t.

(find_option): Accept options as apr_array_header_t.

(find_option_by_builtin): New function to create provided

options from builtin library options.

(find_option_by_id): Replaced by find_option_by_builtin.

(prompt_string,

help_string,

prompt_user,

build_text_conflict_options,

build_prop_conflict_options,

build_prop_text_conflict_options,

handle_one_prop_conflict.

build_tree_conflict_options,

handle_tree_conflict): Accept options as apr_array_header_t.

Patch by: Patrick Steinhardt <ps{_AT_}pks.im>

* STATUS: Use fixed revision instead of HEAD in '1.9.x-fsfs-pack-fixes'

nomination, otherwise nomination may change silently without been tracked

in STATUS file.

* STATUS: Remove my veto from '1.9.x-fsfs-pack-fixes' nomination since

revision in question was removed from the nomination.

* STATUS: Veto r1759116 group.

Follow-up to r1764423: tweak initial size of APR array for the text conflict

options to match maximum number of entries to be added.

* subversion/libsvn_client/conflicts.c

(svn_client_conflict_text_get_resolution_options): Pass 7 instead of 6 as

initial APR array size.

Found by: luke1410

Refactor svn_client_conflict_text_get_resolution_options() and

svn_client_conflict_prop_get_resolution_options().

* subversion/libsvn_client/conflicts.c

(text_conflict_options, binary_conflict_options, prop_conflict_options):

Remove.

(svn_client_conflict_text_get_resolution_options,

svn_client_conflict_prop_get_resolution_options): Inline the code to add

conflict resolution options instead of make a copy from

text_conflict_options/binary_conflict_options/prop_conflict_options arrays.

Fix minor bug in property conflict interactive resolver.

* subversion/svn/conflict-callbacks.c

(merge_prop_conflict): Check THEIR_PROPVAL for NULL instead of checking

MY_PROPVAL twice.

* STATUS: Nominate r1764034.

* STATUS: Vote for r1763934.

Use 'Apache Software Foundation' instead of 'http://subversion.apache.org' as

CompanyName/Publisher for Windows executables.

* build/win32/svn.rc

(CompanyName): Change to 'Apache Software Foundation'.

Extract code that creates svn_client_conflict_option_t and adds it to array

of options.

* subversion/libsvn_client/conflicts.c

(add_resolution_option): New.

(svn_client_conflict_text_get_resolution_options,

svn_client_conflict_prop_get_resolution_options,

configure_option_accept_current_wc_state,

configure_option_update_move_destination,

configure_option_update_raise_moved_away_children,

configure_option_incoming_add_ignore,

configure_option_incoming_added_file_text_merge,

configure_option_incoming_added_file_replace,

configure_option_incoming_added_file_replace_and_merge,

configure_option_incoming_added_dir_merge,

configure_option_incoming_added_dir_replace,

configure_option_incoming_added_dir_replace_and_merge,

configure_option_incoming_delete_ignore,

configure_option_incoming_delete_accept,

configure_option_incoming_move_file_merge,

configure_option_incoming_dir_merge,

svn_client_conflict_tree_get_resolution_options): Use

add_resolution_option().

* subversion/libsvn_client/conflicts.c

(svn_client_conflict_text_get_resolution_options,

svn_client_conflict_prop_get_resolution_options): Set CONFLICT member to

proper value instead of NULL.

Add basic tests for svn_wc__internal_file_modified_p() function.

* subversion/tests/libsvn_wc/wc-test.c

(test_internal_file_modified): New.

(test_funcs): Add test_internal_file_modified to the list.

* STATUS: Vote for r1759686.

Follow-up to r1759177: Add explicit cast to silence compiler warning.

* subversion/libsvn_subr/string.c

(svn_stringbuf_set): Cast str->data to void ** in call to membuf_ensure.

Use SHA-1 checksum to find whether files are actually modified in working

copy if timestamps don't match.

Before this change we were doing this:

1. Compare file timestamps: if they match, assume that files didn't change.

2. Open pristine file.

3. Read properties from wc.db and find whether translation is required.

4. Compare filesize with pristine filesize for files that do not

require translation. Assume that file is modified if the sizes differ.

5. Compare detranslated contents of working file with pristine.

Now behavior is the following:

1. Compare file timestamps: if they match, assume that files didn't change.

3. Read properties from wc.db and find whether translation is required.

3. Compare filesize with pristine filesize for files that do not

require translation. Assume that file is modified if the sizes differ.

4. Calculate SHA-1 checksum of detranslated contents of working file

and compare it with pristine's checksum stored in wc.db.

* subversion/libsvn_wc/questions.c

(compare_and_verify): Replace PRISTINE_STREAM and PRISTINE_SIZE arguments

with PRISTINE_CHECKSUM. Calculate SHA-1 checksum of detranslated

(normalized) content and compare it with what's stored in wc.db. Open

pristine file only if exact comparison is requested.

(svn_wc__internal_file_modified_p): Do not open pristine file here, just

pass pristine's checksum to compare_and_verify().

Save few cycles in svn_stringbuf_set().

* subversion/libsvn_subr/string.c

(svn_stringbuf_set): Do not use svn_stringbuf_ensure() because it will

preserve existing stringbuf content if any. Use membuf_ensure() directly.

* subversion/tests/libsvn_subr/string-test.c

(test_stringbuf_set): Add simple tests for svn_stringbuf_set().

(test_funcs): Add test.

Follow-up to r1612823: Rename test_string_skip_prefix() to

test_cstring_skip_prefix() since it tests svn_cstring_skip_prefix().

* subversion/tests/libsvn_subr/string-test.c

(test_string_skip_prefix): Rename to test_cstring_skip_prefix().

(test_funcs): Update reference to test_cstring_skip_prefix.