Checkout Tools
  • last updated 4 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix issue #4859 "Merge removing a folder with non-inheritable mergeinfo ->

E155023: can't set properties: invalid status for updating properties".

The code was attempting to set mergeinfo on a path that is being deleted by

the merge. This happened only in certain unusual cases such as when

deleting a folder that had non-inheritable mergeinfo and had children.

This patch fixes the problem by removing the 'children_with_mergeinfo'

entries for sub-paths of a deleted folder.

* subversion/libsvn_client/merge.c

(merge_cmd_baton_t): Allow modifying 'children_with_mergeinfo'.

(record_update_delete): Remove from 'children_with_mergeinfo' all paths

in the subtree.

* subversion/tests/cmdline/merge_tests.py

(merge_deleted_folder_with_mergeinfo): Remove 'XFail'.

(merge_deleted_folder_with_mergeinfo_2): New test.

(test_list): Add the new test.

  1. … 1 more file in changeset.
Add a test for issue #4859: Merge removing a folder with non-inheritable

mergeinfo.

The merge fails like this:

> svn merge -c4 ^/branch_A .../A

> --- Merging r4 into '.../A':

> D .../A/D

> svn: E155023: Can't set properties on '/.../A/D/gamma':

> invalid status for updating properties.

* subversion/tests/cmdline/merge_tests.py

(merge_deleted_folder_with_mergeinfo): New test.

(test_list): Run it.

Follow up to r1878909: Fix test description and ignore build artefacts.

* build.conf (filesize-test): Fix test description.

* subversion/tests/client: Add svn:ignore property.

  1. … 1 more file in changeset.
Fix a number of thinkos in human-readable file size formatting.

* subversion/svn/filesize.c

(format_size): Be smarter about predicting floating-point rounding to

decide whether to show decimal places or not.

(get_base2_unit_file_size): Fix human-readable size order calculation.

(get_base10_unit_file_size): Likewise.

* build.conf (filesize-test): New test suite.

(private-includes): Add subversion/svn/filesize.c for filesize-test.

* subversion/tests/client/filesize-test.c: New.

Found by: Tobias Bading <tbading{_AT_}web.de>

Patch by: me

  1. … 2 more files in changeset.
* subversion/tests/cmdline/svndumpfilter_tests.py (filter_and_return_output)

Use list complehension instead of map function, which returns iterator

on Python 3, to get EOL translated list of lines on Windows.

Reported by: jcorvel

Tested by: jcorvel

* subversion/tests/cmdline/svntest/main.py (wait_on_pipe):

Accept any sequence of bytes even if it is not valid UTF-8 character

sequence.

Reported by: jcorvel

Tested by: jcorvel

Fix eol style treatment in command tests on Windows.

[in subversion/tests/cmdline]

* merge_tests.py (merge_conflict_markers_matching_eol,

merge_eolstyle_handling),

* patch_tests.py (patch_no_svn_eol_style,

patch_with_svn_eol_style,

patch_with_svn_eol_style_uncommitted),

* update_tests.py (conflict_markers_matching_eol,

update_eol_style_handling):

Specify keep_eol_style = True evne if platform is Windows.

* merge_tests.py (merge_conflict_markers_matching_eol),

* patch_tests.py (patch_no_svn_eol_style,

patch_with_svn_eol_style,

patch_with_svn_eol_style_uncommitted),

* update_tests.py (conflict_markers_matching_eol):

Use binary mode to write file contents for strict eol style.

* merge_tests.py (merge_conflict_markers_matching_eol),

* patch_tests.py (patch_with_svn_eol_style,

patch_with_svn_eol_style_uncommitted),

* conflict_markers_matching_eol):

Switch per platform eol value for 'native' svn:eol-style

* svntest/wc.py (State.from_wc):

Use io.open() explicitly to specify 'newline' parameter for universal

newline, even on Python 2. With this change, '\r' end of line chracters in

files are also translated to '\n' if keep_eol_style=False (or unspicified)

on Python 2. Also explicitly specify encoding to 'utf-8' not to be affected

by Python's file system encoding.

Reported by: jcorvel

Tested by: jcorvel

Follow-up to r187712: entries-dump: Use escape string-typed value for two

more char * type values.

* subversion/tests/cmdline/entries-dump.c

(print_prefix): Add new Python function _to_str and then use it in

Entry.set_strval.

(print_as_bytes): New function.

(str_value):

- Quote human-readable value when print it.

- Use print_as_bytes to print the value of "value"

(entries_dump):

- Use iterpool in the loop to print each entry.

- Use an escaped string for the key value of the "entries" dict object.

(tree_dump_dir): Use an escaped string for the key value of the "dirs"

dict object.

Reported by: jcorvel

Tested by: jcorvel

Use safe bytes literals when set string values in working copy entries.

* subversion/tests/cmdline/entries-dump.c

(print_prefix): New function.

(str_value):

- Add argument to specify pool.

- Print human readable value of "value" as is in comment, then set it

as str value by using hex escaped bytes literal.

(entries_dump): Add pool argument to str_value() calls.

(main):

- Print "Entry" class definition as prefix before entry_dump() or tree_dump()

- Style fix on if statement (using blocks).

(): Add include files for assert() and svn_xml_escape_attr_cstring()

* subversion/tests/cmdline/svntest/main.py

(run_entiresdump, run_entriesdump_tree): Move definition of "Entry" class

into generated code by entries-dump execution.

Review By: danielsh

Fix svnrdump tests on Windows with Python 3

* subversion/tests/cmdline/svntest/actions.py (run_and_verify_svnrdump):

Use list complehension instead of map function, which returns iterator

on Python 3, to get EOL translated list of lines on Windows.

Reported by: jcorvel

Tested by: jcorvel

Add a test for issue #4711, "invalid xml file produced by: svn log --xml

--verbose --use-merge-history --search".

* subversion/tests/cmdline/log_tests.py

(log_with_merge_history_and_search): New test.

(test_list): Run it.

Follow-up to 1877300: Fix incorrect exception name.

* subversion/tests/cmdline/svndumpfilter_tests.py (match_empty_prefix)

* subversion/tests/cmdline/svndumpfilter_tests.py (match_empty_prefix):

Fix qualified name of exception

svnmucc: Change an error message to state another possible cause of the error.

Fixes issue #4854.

* subversion/libsvn_client/mtcc.c

(mtcc_verify_create): Reword error message.

* subversion/tests/cmdline/svnmucc_tests.py

(svnmucc_type_errors, svnmucc_propset_and_put): Update expectations.

  1. … 1 more file in changeset.
* subversion/tests/cmdline/blame_tests.py (blame_youngest_to_oldest):

Use svntest.main.file_write to avoid end of line conversion.

Reported by: jcorvel

Tested by: jcorvel

Escape special characters in path when construct expected output regex.

* subversion/tests/cmdline/svntest/actions.py (_run_and_verify_resolve)

Reported by: jcorvel

Tested by: jcorvel

Fix various typos detected by codespell

* tests/cmdline/externals_tests.py, tests/cmdline/lock_tests.py,

tests/cmdline/log_tests.py, tests/cmdline/merge_authz_tests.py,

tests/cmdline/merge_tests.py, tests/cmdline/move_tests.py,

tests/cmdline/svnadmin_tests.py, tests/cmdline/switch_tests.py,

tests/libsvn_client/conflicts-test.c, tests/libsvn_client/mtcc-test.c,

tests/libsvn_fs/fs-test.c, tests/libsvn_fs_x/fs-x-pack-test.c,

tests/svn_test_main.c:

(): Spelling fixes

Follow-up to r1875921: Add missing test decorator.

Skip build_repcache() test if read_rep_cache() is not supported

by Python-SQLite version.

* subversion/tests/cmdline/svnadmin_tests.py

(build_repcache): Add missing SkipUnless decorator.

Patch by: Denis Kovalchuk <denis.kovalchuk@visualsvn.com>

Found by: svn-windows-local buildbot

Introduce 'svnadmin build-repcache' command.

Implement the 'svnadmin build-repcache' CLI and add an ioctl API for building

the representation cache.

The implementation iterates over revisions in the specified range and recursively

processes the changed nodes, starting from the corresponding revision roots.

For each changed node, it ensures that its data and property representations

exist in the rep-cache. The nodes are processed in the same order as when

committing a transaction (see write_final_rev() function in libsvn_fs_fs/transaction.c),

so that the rep-cache.db files are fully consistent.

* subversion/svnadmin/svnadmin.c

(cmd_table): Add and document the 'build-repcache' command.

(subcommand_build_repcache,

build_rep_cache,

build_rep_cache_progress_func): New.

* subversion/include/svn_error_codes.h

(SVN_ERR_FS_REP_SHARING_NOT_ALLOWED,

SVN_ERR_FS_REP_SHARING_NOT_SUPPORTED): New error codes.

* subversion/include/private/svn_fs_fs_private.h

(svn_fs_fs__ioctl_build_rep_cache_input_t,

SVN_FS_FS__IOCTL_BUILD_REP_CACHE): New.

* subversion/libsvn_fs_fs/fs.c

(fs_ioctl): Handle SVN_FS_FS__IOCTL_BUILD_REP_CACHE.

* subversion/libsvn_fs_fs/fs_fs.h

* subversion/libsvn_fs_fs/fs_fs.c

(): Include 'low_level.h'.

(svn_fs_fs__build_rep_cache,

reindex_node,

ensure_representation_sha1): New. Iterate over revisions and recursively

process the changed nodes. For each changed node, ensure that its data

and property representations exist in the rep-cache.

* subversion/tests/cmdline/svnadmin_tests.py

(build_repcache): New test.

(test_list): Add the new test.

* subversion/tests/libsvn_fs_fs/fs-fs-private-test.c

(): Include 'libsvn_fs_fs/rep-cache.h' and 'libsvn_fs/fs-loader.h'.

(build_rep_cache): New test.

(test_funcs): Add the new test.

* tools/client-side/bash_completion

(_svnadmin): Add the 'build-repcache' command.

Patch by: Denis Kovalchuk <denis.kovalchuk@visualsvn.com>

  1. … 7 more files in changeset.
* subversion/tests/cmdline/svnadmin_tests.py

(load_normalize_node_props): Rewrite without literal trailing spaces, to

prevent the bug fixed in r1875620 from recurring.

Increment the trunk version number to 1.15, and introduce a new CHANGES

section, following the creation of the 1.14.x release branch.

* subversion/include/svn_version.h,

subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java,

subversion/tests/cmdline/svntest/main.py

(SVN_VER_MINOR): Increment to 15.

* CHANGES: New section for 1.15.0.

  1. … 3 more files in changeset.
* subversion/tests/cmdline/svnadmin_tests.py

(load_normalize_node_props): Restore intended trailing whitespace which

was removed in r1875617.

Update svn_ra_open4() to svn_ra_open5() across the tree.

Most of these changes are mechanical. JavaHL gains a redirect cycle fix.

The set_svn_ra_open() callback gets updated to the new API.

* subversion/bindings/javahl/native/CommitEditor.cpp

(open_callback_session): Use svn_ra_open5() and show the redirected URL in

an error message.

* subversion/bindings/javahl/native/RemoteSession.cpp

(RemoteSession::RemoteSession): Use svn_ra_open5() and detect redirect

cycles based on the actual redirection URL sent by the server.

* subversion/libsvn_client/ra.c

(svn_client__open_ra_session_internal): Use svn_ra_open5().

* subversion/libsvn_ra/ra_loader.c

(svn_ra_open5): Pass svn_ra_open5 to the svn_svn_ra_open() callback.

* subversion/libsvn_ra/ra_loader.h

(svn_ra__open_func_t): Update to match svn_ra_open5().

* subversion/libsvn_ra_serf/serf.c

(svn_ra_serf__open): Update comment referring to svn_ra_open4().

* subversion/svnsync/svnsync.c

(do_initialize, open_source_session,

open_target_session): Update to svn_ra_open5().

* subversion/tests/cmdline/atomic-ra-revprop-change.c

(change_rev_prop): Update to svn_ra_open5().

* subversion/tests/libsvn_ra/ra-test.c

(make_and_open_repos, check_tunnel_callback_test, tunnel_callback_test,

tunnel_run_checkout, commit_locked_file): Update to svn_ra_open5().

  1. … 7 more files in changeset.
* everywhere: Run tools/dev/remove-trailing-whitespace.sh to remove

trailing whitespace before we branch 1.14.

  1. … 91 more files in changeset.
* libsvn_subr/mergeinfo-test.c

(test_rangelist_merge_random_non_validated_inputs): Indentation fix.

Plug error leaks in newly added mergeinfo tests.

Found by: svn-bb-openbsd buildbot

https://ci.apache.org/builders/svn-bb-openbsd/builds/510/steps/Test/logs/faillog-ra_svn-fsfs

[[[

subversion/tests/svn_test_main.c:475: (apr_err=SVN_ERR_TEST_FAILED)

svn_tests: E200006: Test crashed (run in debugger with '--allow-segfaults')

FAIL: mergeinfo-test 25: test rangelist merge random non-validated inputs

]]]

Core was generated by `mergeinfo-test'.

Program terminated with signal SIGABRT, Aborted.

#0 *_libc_abort () at /usr/src/lib/libc/stdlib/abort.c:57

57 memset(&sa, 0, sizeof(sa));

(gdb) up

#1 0x0000010070bcff68 in err_abort (data=0x10022671880)

156 abort();

(gdb) list

151 {

152 svn_error_t *err = data; /* For easy viewing in a debugger */

153 SVN_UNUSED(err);

154

155 if (!getenv("SVN_DBG_NO_ABORT_ON_ERROR_LEAK"))

156 abort();

157 return APR_SUCCESS;

158 }

159 #endif

160

(gdb) p *err

$3 = {apr_err = 235000,

message = 0x1001bc9c280 "In file 'subversion/libsvn_subr/mergeinfo.c' line 1096: assertion failed (rangelist_is_sorted(chg))", child = 0x0,

pool = 0x10085adbc00,

file = 0x10070d799b0 "subversion/libsvn_subr/mergeinfo.c", line = 1096}

(gdb)

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

(clear_failure_mode_errors): New helper function. Clears errors accumulated

during a test run.

(test_rangelist_merge_random_canonical_inputs,

test_rangelist_merge_random_semi_c_inputs,

test_rangelist_merge_random_non_validated_inputs): Clear accumulated errors.

Adjust tests following r1875039 (disable shelving by default).
Merge the 'decouple-shelving-cli' branch to trunk.

Summary:

Add the shelving v2 implementation from Subversion 1.11, as an alternative

to the shelving v3 implementation from Subversion 1.12.

They have substantially different pros and cons, so it is beneficial for the

user to be able to choose.

Make the shelving CLI version selectable by an environment variable:

env. var. not set => shelving v3 enabled

SVN_EXPERIMENTAL_COMMANDS=shelf3 => shelving v3 enabled

SVN_EXPERIMENTAL_COMMANDS=shelf2 => shelving v2 enabled

SVN_EXPERIMENTAL_COMMANDS= => no shelving CLI

  1. … 15 more files in changeset.
Followup to r1874057, escape whitespace instead of quoting filename

As danielsh pointed out, only specific characters can be escaped by a backslash

in quoted shell strings. Rather than surrounding the escaped path with double

quotes, post-process the quoted path and manually escape any whitespace that is

present.

* subversion/libsvn_subr/cmdline.c

(escape_path): New function, wrapper around apr_pescape_shell(), which

handles escaping of whitespace.

(svn_cmdline__edit_file_externally, svn_cmdline__edit_string_externally):

Call the new function instead of apr_pescape_shell()

* subversion/tests/cmdline/update_tests.py

(update_accept_conflicts): Include ';' in renamed path ("p; i"), to ensure

non-whitespace escaping is handled correctly.

  1. … 1 more file in changeset.
Escape filenames when invoking $SVN_EDITOR

Per https://subversion.apache.org/faq.html#svn-editor, $SVN_EDITOR is invoked

through the shell instead of directly executed. The user is expected to

properly escape/quote $SVN_EDITOR, but svn was putting the filename directly

into the command without any escaping. This therefore breaks attempts to,

e.g., run the editor from the merge conflict dialog when a path has special

characters.

Update locations where we invoke the editor to quote the filename as well as

escape shell special characters using apr_pescape_shell(). The quotes are

needed in addition to the escaping, since apr_pescape_shell() does not escape

whitespace.

* subversion/libsvn_subr/cmdline.c

(svn_cmdline__edit_file_externally, svn_cmdline__edit_string_externally):

Quote and escape, via apr_pescape_shell(), the filename in the command line.

* subversion/tests/cmdline/update_test.py

(update_accept_conflicts): Rename "A/D/G/pi" to "A/D/G/p i" before performing

the merge, so the test exercises the changes above.

  1. … 1 more file in changeset.