Checkout Tools
  • last updated 10 mins ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1051322 is being indexed.

Add a public API function, svn_subst_translate_string2(), an extension of

svn_subst_translate_string(), that has two additional output parameters for

determining whether re-encoding and/or line ending translation were performed.

As discussed at:



The essential changes are to the translate_newline() function, which now takes

an svn_boolean_t pointer, the value at which is set to TRUE if the pointer is

non-NULL and a different newline is written out. Most other changes are to pass

the svn_boolean_t pointer through to translate_newline().

* build.conf

Configure subversion/tests/libsvn_subr/subst_translate-test

* subversion/include/svn_subst.h

(svn_subst_translate_string2): New function.

(svn_subst_translate_string): Deprecate in favor of


* subversion/libsvn_subr/subst.c

(STRING_IS_EOL): New macro that tests whether a string is an end-of-line

string ("\n", "\r", "\r\n").

(DIFFERENT_EOL_STRINGS): New macro that tests whether two end-of-line strings

are different.

(translate_newline): Add the TRANSLATED_EOL parameter. If the function

writes out a different newline, then it sets TRANSLATED_EOL to TRUE.

(translation_baton): Add the TRANSLATED_EOL field.

(create_translation_baton): Add a new parameter TRANSLATED_EOL that is

passed to the resulting translation_baton.

(translate_chunk): When calling translate_newline(), pass TRANSLATED_EOL from

the translation_baton.

(stream_translated): New static function. Its implementation is the old

implementation of svn_subst_stream_translated(), but accepting another

parameter, TRANSLATED_EOL, that is passed to the in/out translation batons

that it creates.

(svn_subst_stream_translated): Now a wrapper for stream_translated().

(translate_cstring): New static function. Its implementation is the old

implementation of svn_subst_translate_cstring2(), but modified to accept

another parameter, TRANSLATED_EOL, that is passed to stream_translated().

(svn_subst_translate_cstring2): Now a wrapper for translate_cstring().

(svn_subst_translate_string): Move to deprecated.c.

(svn_subst_translate_string2): New function. It takes three additional

parameters: TRANSLATED_TO_UTF8, TRANSLATED_LINE_ENDINGS, and another pool

parameter. The task of recording whether it translates a line ending is

delegated to translate_cstring().

* subversion/libsvn_subr/deprecated.c

(svn_subst_translate_string): Now a wrapper for svn_subst_translate_string2().

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

New test suite for the svn_subst_translate_* functions.

Patch by: Danny Trebbien <dtrebbien{_AT_}>

Revert r1051164.

* subversion/libsvn_ra/util.c

(svn_ra__release_operational_lock): Re-switch the sense of the boolean

return from svn_string_compare().

Found by: philip

*** THIS COMMIT REVERTED IN r1051270 ***

Another follow-up to r1050216.

* subversion/libsvn_ra/util.c

(svn_ra__release_operational_lock): Switch the sense of the boolean

return from svn_string_compare(). I forgot that it returns TRUE for

"matches", the opposite of the previous strcmp() code that was in place.

Follow-up to r1050216.

* subversion/libsvn_ra/util.c

(svn_ra__release_operational_lock): Note who stole the lock, not

just that it was stolen.

Suggested by: danielsh

Follow-up to r1049646.

* subversion/svnadmin/main.c

(subcommand_load): Mark an error string for localization.

Found by: danielsh

Make 'svn move' display the correct error message while moving a URL onto or

into itself. (Instead of 'Cannot move URL', it was displaying 'Cannot move

path' with the URL formatted as if it were a local path.) Add missing tests.

* subversion/libsvn_client/copy.c

(try_copy): Display error message based on source type.

(repos_to_repos_copy): Remove redundant code.

* subversion/tests/cmdline/

(move_wc_and_repo_dir_to_itself, test_list): New test.

Patch by: Noorul Islam K M <noorul{_AT_}>

* subversion/libsvn_wc/wc_db.c

(wclock_owns_lock): Add a doc string. A follow-up to r1050557.

* subversion/tests/svn_test_main.c

(do_test_num): Improve error message.

Suggested by: danielsh

Make svn_wc__internal_walk_children() issue sqlite queries per directory

instead of per node.

This should theoretically improve performance for some usage patterns by

trading a bit of memory usage overhead against sqlite queries. But I haven't

taken any measurements since I didn't have a profiling build around.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_NODE_CHILDREN_WALKER_INFO): New query that gathers data

of interest to the node walker. Note in a comment that it may be possible

to speed up this query by handling local_relpath grouping and op_depth

sorting in the C code, as done in svn_wc__db_read_children_info().

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_read_children_walker_info): New. Returns info about immediate

child nodes of a directory the walker is interested in.

Basically a smaller cousin of svn_wc__db_read_children_info().

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_walker_info_t): New struct. Contains all information about

child nodes the walker is interested in. Currently this is status and kind.

(svn_wc__db_read_children_walker_info): Declare.

* subversion/libsvn_wc/node.c

(walker_helper): Replace calls to svn_wc__db_read_children() and

svn_wc__db_read_info() with call to svn_wc__db_read_children_walker_info().

Make an internal version of another WC DB function, to avoid needless

conversions between DB+ABSPATH and PDH+RELPATH.

* subversion/libsvn_wc/wc_db.c

(wclock_owns_lock): New function, extracted from


(svn_wc__db_wclock_owns_lock): Re-implement as a wrapper around


(wclock_obtain_cb): Use wclock_owns_lock() to avoid conversion of

PDH+RELPATH to DB+ABSPATH and back again. Use path_for_error_message()

to hide construction of an abspath in the error case.

(wclock_obtain_baton): Remove the 'db' field, as it is now unused.

(svn_wc__db_wclock_obtain): Don't initialize the baton's 'db' field. Use

path_for_error_message() to hide construction of an abspath in an error


* subversion/libsvn_wc/lock.c

(open_single): Replace an error report that 'should never be reached' with

an assertion.

* tools/dev/unix-build/Makefile.svn: Always do a short sleep after stopping

httpd. If httpd attempts to re-start too quickly it can fail to start

and abort a test run, e.g. during the transition from "neon x bdb"

to "serf x fsfs".

* subversion/svnversion/main.c

(help): Update the help text, following the changes of output from

'exported' to more specific messages that were made in r877617, r935177.

Suggested by: Vijayaguru G <vijay{_AT_}>

Move the "please run 'svn upgrade'" text out of libsvn_wc and into the

command-line client, as it may not be appropriate for non-command-line


(The error message for early WCNG formats still refers to command-line

commands and remains in the library, and now it will have an irrelevant

"please see 'svn upgrade'" message displayed as well; but none of that

matters because nobody but developers will ever see that message.)

* subversion/libsvn_wc/upgrade.c

(svn_wc__upgrade_sdb): Remove "please run 'svn upgrade'" from the error

message when an upgrade is required.

* subversion/svn/main.c

(main): If any subcommand fails with an 'upgrade required' error code,

wrap the error message with one referring to the 'svn upgrade' command.

* subversion/tests/cmdline/

(wc_is_too_old_regex): Adjust the expected error message.

Make 1.6-to-wcng upgrade handle replaced files that are not copied.

* subversion/libsvn_wc/entries.c

(write_entry): Non-copied working node always has its own op_depth.

* subversion/tests/libsvn_wc/wc_db.c

(svn_wc__db_upgrade_apply_props): Tweak comment.

* subversion/tests/cmdline/

(replaced_files): Expect and revert replacements that are not copied.

* subversion/tests/cmdline/upgrade_tests_data/replaced-files.tar.bz2:

Update to include replacements that are not copies.

Modify the libtool transformation script in an another attempt to

fix the OpenBSD buildbot. The preload list will be empty and should

be removed.

* build/generator/

(write_transform_libtool_scripts): Don't bother looking for .so.0.0 as

they don't work.

Modify the libtool transformation script to attempt to fix the OpenBSD


* build/generator/

(write_transform_libtool_scripts): Look for .so.0 and .so.0.0, don't

write LD_PRELOAD lines if empty.

Implement a --steal-lock option for svnsync.

This is part of issue #3309 ("Add support for graceful handling of

non-fatal error conditions in svnsync").

* subversion/svnsync/main.c

(enum svnsync__opt): Add new 'svnsync_opt_steal_lock' enum value.

(svnsync_options): Add record for new '--steal-lock' option. While here,

tweak '--disable-locking' help to have two spaces between sentences.

(svnsync_cmd_table): Make the 'init', 'synchronize', and

'copy-revprops' subcommands accept --steal-lock.

(opt_baton_t): Add 'steal_lock' member.

(get_lock): Add 'steal_lock' parameter, passed to

svn_ra__get_operational_lock(). If the lock was stolen, tell the

user that.

(with_locked): Add 'steal_lock' parameter, passed to get_lock().

(initialize_cmd, synchronize_cmd, copy_revprops_cmd): Update call to

with_locked(), passing opt_baton->steal_lock.

(main): Add handling of --steal-lock, but disallow its concurrent

use with --disable-locking.

* subversion/svnrdump/svnrdump.c

(main): Don't print 'Subcommand required' when svnrdump is invoked

without a subcommand. The second message "Type 'svnrdump help'

for usage." is both sufficient and consistent with what our other

binaries do.

Finish issue #3766 ("Unify svnsync and svnrdump repos-locking logic").

* subversion/include/private/svn_ra_private.h

(svn_ra__lock_retry_func_t): New callback type.

(svn_ra__get_operational_lock, svn_ra__release_operational_lock):

New semi-private functions.

* subversion/libsvn_ra/util.c

(is_atomicity_error): Moved here from svnsync/main.c.

(svn_ra__release_operational_lock): New, abstracted from


(svn_ra__get_operational_lock): New, abstracted from


* subversion/svnsync/main.c

(is_atomicity_error, maybe_unlock): Remove as unused.

(lock_retry_func): New.

(get_lock): Now just a thin wrapper around svn_ra__get_operational_lock().

(with_locked): Simplify, and use svn_ra__release_operational_lock().

* subversion/svnrdump/load_editor.c

(LOCK_RETRIES, is_atomicity_error): Remove as unused.

(lock_retry_func): New.

(get_lock): Now just a thin wrapper around svn_ra__get_operational_lock().

(drive_dumpstream_loader): Now use svn_ra__release_operational_lock().

* subversion/libsvn_subr/prompt.c

(plaintext_prompt_helper): Allow "y" and "n" as answers, in addition

to "yes" and "no".

Remove code that has been redundant since update's "copy from" functionality

was removed in r998193.

* subversion/libsvn_wc/update_editor.c

(file_baton): Remove all the 'copied_*' fields: they are never set.

(apply_textdelta, merge_file, close_file): Remove code that used them.

* subversion/libsvn_wc/update_editor.c

(close_file): Further simplify the code, eliminating two local variables,

following r1049819 and r1049948.

Use svn_io_start_cmd2 in run_hook_cmd.

* subversion/libsvn_repos/hooks.c

(run_hook_cmd): Use svn_io_start_cmd2.

Patch by: Martin Furter <>

Rev the svn_io_start_cmd() API, adding pipe support.

* subversion/libsvn_subr/io.c

(svn_io_start_cmd2): New revision of svn_io_start_cmd(), adding

booleans to indicate where pipes should be used instead of file


(svn_io_start_cmd): Moved to deprecated.c.

* subversion/libsvn_subr/deprecated.c

(svn_io_start_cmd): Moved here from io.c, and reduced to a mere

wrapper around svn_io_start_cmd2().

* subversion/include/svn_io.h

(svn_io_start_cmd2): New revision of svn_io_start_cmd2().

(svn_io_start_cmd): Deprecate this function.

Patch by: Martin Furter <>

(Tweaked by cmpilato.)

Make upgrades handle revert properties for working-only replaced files.

* subversion/libsvn_wc/wc-queries.sql



* subversion/libsvn_wc/wc_db.c

(prop_upgrade_trees): Remove.

(svn_wc__db_upgrade_apply_props): Handle revert-props for working-only


* subversion/tests/cmdline/

(replaced_files): New.

(test_list): Mark replaced_files PASS.

* subversion/tests/cmdline/upgrade_tests_data/replaced-files.tar.bz2: New.

* build: add to svn:ignore
* subversion/tests/cmdline/

(status_unversioned_dir): Take another crack at getting a regexp

that works both for folks testing inside and outside of ${srcdir}.

Suggested by: pburba

* build/generator/

(write_transform_libtool_scripts): Exclude libsvn_test from the


* subversion/libsvn_wc/update_editor.c

(merge_file, close_file): Fix indentation and a comment, as a follow-up to