Checkout Tools
  • last updated 2 hours ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1051778 is being indexed.

Have all remaining calls of svn_fs_commit_txn() and

svn_repos_fs_commit_txn() use the contract that a commit was

successful if the returned revision is a valid revision number. The

returned error, if any, is no longer used as an indication of commit


* subversion/mod_dav_svn/version.c



Use revision number returned from svn_repos_fs_commit_txn() to

test for a successful commit.

* subversion/mod_dav_svn/lock.c



* subversion/libsvn_repos/load-fs-vtable.c



* subversion/libsvn_repos/commit.c



The post-commit hook script should always be executed if the commit

succeeded. Use the proper test on svn_fs_txn_commit()'s result to

determine if the transaction was committed.

* subversion/libsvn_repos/fs-wrap.c


Instead of failing immediately if svn_fs_txn_commit() returns an

error, use the returned revision number to test if the

transaction was committed.

If the transaction was committed, regardless if

svn_fs_txn_commit() returned an error, then execute the

post-commit script.

Return a composed error, using the error from svn_fs_txn_commit()

and the error from the post-commit script.

Add a private function that takes the error returned from

svn_repos_fs_commit_txn() and builds a error message string containing

either or both of the svn_fs_commit_txn() error and the

SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped post-commit error. The

function skips over tracing errors.

* subversion/include/private/svn_repos_private.h


New private function.

* subversion/libsvn_repos/commit.c




Use svn_repos__post_commit_error_str() instead of processing the


* subversion/mod_dav_svn/version.c


Use svn_repos__post_commit_error_str() instead of processing the


Constify another variable.

* subversion/libsvn_repos/commit.c


Declare post_commit_err as a const char *.

Another whitespace fix.

* subversion/libsvn_repos/commit.c


Fix indentation.

Ensure that in a fsfs repository that the callers of svn_fs_txn_commit()

and svn_repos_fs_txn_commit() are informed that the commit succeeded

regardless of any errors after the commit is globally visible.

I looked at the BDB implementation and from a cursory review, it looks

like it is fine.

* subversion/libsvn_fs_fs/fs_fs.c


Set the revision pointer value to the newly committed revision

number immediately after the 'current' file is atomically moved

into place, do not set it after the transaction is deleted because

the deletion could fail (not that this is likely).

Update test_commit_txn() to handle svn_fs_commit_txn()'s return


* subversion/tests/libsvn_fs/fs-test.c


If svn_fs_commit_txn() returns an error, then always return an

error to the caller, just use a different wrapping error message

if the commit succeeded or failed.

If svn_fs_commit_txn() returns no error, than assert that a valid

revision number was returned.

Add assertions in all tests that all the commits done with

svn_fs_commit_txn() and svn_repos_fs_commit_txn() return a valid

revision number, per their contract that this is the true indicator of

a commits success.

The only code not touched is test_commit_txn() in fs-test.c, which is

handled in the next commit.

* subversion/tests/libsvn_client/client-test.c,

* subversion/tests/libsvn_fs/fs-test.c,

* subversion/tests/libsvn_fs/locks-test.c,

* subversion/tests/libsvn_fs_base/changes-test.c,

* subversion/tests/libsvn_fs_base/fs-base-test.c,

* subversion/tests/libsvn_fs_fs/fs-pack-test.c,

* subversion/tests/libsvn_repos/repos-test.c,

* subversion/tests/svn_test_fs.c:

Follow any call to svn_fs_commit_txn() and svn_repos_fs_commit_txn()

that is expected to succeed with an assertion that the returned

revision number is valid, likewise, assert the reverse, that a

failed commit returns an invalid revision number.

Constify. This commit will let a successive commit introduce a

utility function that generates a const char * message combining an

error from svn_fs_commit_txn() and/or from the post-commit hook.

* subversion/mod_dav_svn/dav_svn.h,

* subversion/mod_dav_svn/merge.c


Change the char *post_commit_err argument to be a const char *.

* subversion/mod_dav_svn/version.c


Declare the local char *post_commit_err as a const char *.

Whitespace fix.

* subversion/mod_dav_svn/dav_svn.h


Fix indentation.

Another documentation improvement.

Suggested by: danielsh

* subversion/include/svn_error.h


Document that the input error should not be cleared because the

output one shares memory with it.

* subversion/include/svn_error.h

(svn_error_purge_tracing): Update doxygen syntax.

Documentation addition.

* subversion/include/svn_error.h


Document that the input svn_error_t * can be NULL or SVN_NO_ERROR.

Replace svn_error_has_cause() with svn_error_find_cause() that instead

of returning a Boolean, returns the actual matching cause. Users can

still use a Boolean context to determine if there was a match, so

there's no drawback to this change.

* subversion/include/svn_error.h,

* subversion/libsvn_subr/error.c


Renamed from svn_error_has_cause(). Change the return type from

svn_boolean_t to svn_error_t *.

* subversion/include/svn_ra.h


Refer to the new function name.

* subversion/libsvn_ra/util.c


Use the new function.

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


Use the new function.

Following r1051632, if any work is done that can return an error

before the real svn_fs_commit_txn() implementation is executed, then

make sure to set *new_rev to SVN_INVALID_REVNUM so callers can check

if the commit was successful.

This satisfies svn_fs_commit_txn()'s contract when it is used through


* subversion/libsvn_repos/fs-wrap.c


Set *new_rev to SVN_INVALID_REVNUM before doing anything.

If any work is done that can return an error before the real

svn_fs_commit_txn() implementation is executed, then make sure to set

*new_rev to SVN_INVALID_REVNUM so callers can check if the commit was


This partially implements svn_fs_commit_txn()'s contract that *new_rev

tells if the transaction was committed; if it isn't set, then callers

will not be able to tell if the transaction was committed unless they

set the revision number to SVN_INVALID_REVNUM themselves, which isn't


* subversion/libsvn_fs/fs-loader.c




* subversion/libsvn_fs_fs/fs_fs.c

(svn_fs_fs__commit): Update TODO comment to say why nothing needs to be done.

Whitespace fix.

* subversion/libsvn_subr/io.c


Fix indentation.

When ignoring a warning, do so noisily if in maintainer mode.

* subversion/libsvn_ra_local/ra_plugin.c


In maintainer mode, output notice that an error is being ignored.

Update the comment, which was outdated by r1051559.

* subversion/libsvn_fs_fs/fs_fs.c


On failure to open the rep-cache DB, log a warning but do not treat

that as a fatal error.

Caveat: the FS warning function defaults to a function that crashes the

process, so any FS API consumers that don't set that function will experience

a regression --- what used to be a 'normal' error now becomes an abort().

The FS API consumers in the core do set the FS warning function explicitly.

Fix's importing of paths that contain an '@' character.

(This looks reasonable but I haven't tested it, and I note that Subversion's

'configure' script no longer generates from

See email thread " and paths with '@'", started 2010-12-20,


* contrib/client-side/svn_load_dirs/

(make_targets_file): Append '@' to each path in the TARGETS file.

Patch by: Kevinm <kevinmusker{_AT_}>

* site/publish/contributing.html,

* site/publish/dev/index.html,

* site/publish/issue-tracker.html,

* site/publish/source-code.html

<title> tweaks only.

* subversion/libsvn_fs_fs/rep-cache.c

(svn_fs_fs__open_rep_cache): Use a more specific error message.

Enforce in the WC DB schema that a pristine text checksum always references

a pristine text that is in the store. To accord with this, change the

1.6-to-1.7 upgrade code so that it populates the pristine store before the

NODES table, and so that it always writes the SHA-1 checksum (not the MD-5)

into the NODES table.

The assertions in write_entry are a bit ugly and in one case incomplete.

* subversion/libsvn_wc/wc-metadata.sql

(ACTUAL_NODE): Declare 'older_checksum', 'left_checksum', 'right_checksum'

as referencing a pristine text.

(NODES): Declare 'checksum' as referencing a pristine text.

(format: 99): Note these changes.

* subversion/libsvn_wc/entries.c

(write_entry): Receive the text-base checksums through a new 'text_base_info'

parameter and use them in the NODES table rows.

(entries_write_baton, entries_write_new_cb, svn_wc__write_upgraded_entries):

Pass the text base info down the call stack to write_entry().

* subversion/libsvn_wc/entries.h

(svn_wc__text_base_file_info_t, svn_wc__text_base_info_t): New structs.

(svn_wc__write_upgraded_entries): Take a 'text_bases_info' parameter.

* subversion/libsvn_wc/upgrade.c

(migrate_text_bases): Return the checksums of all the files. Remove the

'dir_relpath' parameter and the code that filled in checksum columns in

existing NODES rows.

(upgrade_to_wcng): Migrate the text bases before the 'entries', and pass

all the text-base checksums from the former to the latter.

* subversion/tests/cmdline/

(replaced_files): Expect SHA-1 instead of MD-5 checksums after upgrade.

Extend a 1.6-to-wcng upgrade test.

* subversion/tests/cmdline/

(simple_checksum_verify): New.

(replaced_files): Verify checksums.

Make the node walker pass the node kind to the walker callback to

remove a few redundant sqlite queries.

This has been suggested in a comment and makes a lot of sense for

upcoming proplist changes I'm planning to make.

However, this change also shows that concurrently maintaining two node

kind types in the code is starting to become a burden.

But I'm leaving this problem as an open question in a comment.

Because I'm on a train and about to arrive I couldn't run all tests.

Apologies if this breaks the bots.

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

(print_dir): Adjust svn_wc__node_found_func_t implementation.

* subversion/include/private/svn_wc_private.h

(svn_wc__node_found_func_t): Add svn_node_kind_t argument.

* subversion/libsvn_wc/revision_status.c

(analyze_status): Adjust svn_wc__node_found_func_t implementation.

* subversion/libsvn_wc/update_editor.c

(modcheck_found_node): Adjust svn_wc__node_found_func_t implementation.

Add comment about a possible future enhancement.

* subversion/libsvn_wc/node.c

(convert_db_kind_to_node_kind): New, split off from ...

(svn_wc_read_kind): ... this function, so that the same code can be used ...

(walker_helper): ... here to convert the DB kind into a node kind.

Pass the resulting node kind to the walker callback.

(svn_wc__internal_walk_children): Pass a node kind to the walker callback.

* subversion/libsvn_client/info.c

(info_found_node_callback): Adjust svn_wc__node_found_func_t implementation.

* subversion/libsvn_client/merge.c

(get_mergeinfo_walk_cb, get_subtree_mergeinfo_walk_cb): Adjust

svn_wc__node_found_func_t implementations.

* subversion/libsvn_client/prop_commands.c

(propset_walk_cb, propget_walk_cb, proplist_walk_cb): Adjust

svn_wc__node_found_func_t implementations.

(get_prop_from_wc): Pass node kind to walker callback.

* subversion/libsvn_client/ra.c

(invalidate_wcprop_for_node): Adjust svn_wc__node_found_func_t implementation.

* subversion/libsvn_client/mergeinfo.c

(get_subtree_mergeinfo_walk_cb): Adjust svn_wc__node_found_func_t


* subversion/libsvn_client/changelist.c

(set_node_changelist, get_node_changelist): Adjust

svn_wc__node_found_func_t implementations.

* subversion/libsvn_client/commit_util.c

(add_lock_token): Adjust svn_wc__node_found_func_t implementation.

* /site/publish/issue-tracker.html:

Clarify the status of our bug tracker.

Found by: Nick <>

Correct an @since.

* subversion/include/svn_error.h


This function isn't in 1.6.x, so update @since to 1.7.

* build.conf

(__ALL_TESTS__): Add subst_translate-test, as required on Windows. A follow-

up to r1051322.

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_}>