[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1051745 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: Wed, 22 Dec 2010 12:45:53 +0530

On 12/22/2010 09:38 AM, blair_at_apache.org wrote:
> Author: blair
> Date: Wed Dec 22 04:08:14 2010
> New Revision: 1051745
>
> URL: http://svn.apache.org/viewvc?rev=1051745&view=rev
> Log:
> Update test_commit_txn() to handle svn_fs_commit_txn()'s return
> semantics.
>
> * subversion/tests/libsvn_fs/fs-test.c
> (test_commit_txn):
> 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.
>
> Modified:
> subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
>
> Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1051745&r1=1051744&r2=1051745&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Wed Dec 22 04:08:14 2010
> @@ -61,6 +61,7 @@
> * EXPECTED_CONFLICT. If they don't match, return error.
> *
> * If a conflict is expected but the commit succeeds anyway, return
> + * error. If the commit fails but does not provide an error, return
> * error.
> */
> static svn_error_t *
> @@ -110,13 +111,24 @@ test_commit_txn(svn_revnum_t *new_rev,
> "conflicting commit returned valid new revision");
> }
> }
> - else if (err) /* commit failed, but not due to conflict */
> + else if (err) /* commit may have succeeded, but always report an error */
> {
> - return svn_error_quick_wrap
> - (err, "commit failed due to something other than a conflict");
> + if (SVN_IS_VALID_REVNUM(*new_rev))
> + return svn_error_quick_wrap
> + (err, "commit succeeded but something else failed");

Should this error not be wrapped inside "_()"?

> + else
> + return svn_error_quick_wrap
> + (err, "commit failed due to something other than a conflict");

Same as above.

> }
> - else /* err == NULL, so commit succeeded */
> + else /* err == NULL, commit should have succeeded */
> {
> + if (! SVN_IS_VALID_REVNUM(*new_rev))
> + {
> + return svn_error_create
> + (SVN_ERR_FS_GENERAL, NULL,
> + "commit failed but no error was returned");

Same as above.

Thanks
With regards
Kamesh Jayachandran
Received on 2010-12-22 08:16:34 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.