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

Re: svn commit: r1339892 - /subversion/trunk/subversion/libsvn_fs/editor.c

From: Greg Stein <gstein_at_gmail.com>
Date: Thu, 17 May 2012 20:48:25 -0400

Notes:

copy 29: a mixed-rev child of a copied parent that is re-copied to
pick up a different source revision needs to specify that parent
revision for REPLACES_REV. Since it passes SVN_INVALID_REVNUM, the
existence check comes into play, and the node exists (implicitly as a
result of copying the parent).

merge 18: same. I_at_2 and I/theta_at_6 are copied to L. It copies I_at_2, then
it (re)copies I_at_6 without specifying REPLACES_REV=2.

switch 33: a little bit different, but copied children again. In this
case, R/G is switched to a different subtree than the R/G_at_1 subtree.
So the commit process copies R, and then it must replace R/G with a
different subtree. Again: it needs to specify REPLACES_REV.

Hope that helps,
-g

On Thu, May 17, 2012 at 7:32 PM, Greg Stein <gstein_at_gmail.com> wrote:
> Hyrum,
>
> This fixes the two tree_conflict tests you mentioned, and blame 7
> continues to fail.
>
> However, it introduced failures in copy 29, merge 18, and switch 33.
> Each one has the error that I just added. I haven't investigated yet:
> it could be that a different error was expected.
>
> (all this on the ev2-export branch, of course, and on ra_local)
>
> Cheers,
> -g
>
> On Thu, May 17, 2012 at 6:27 PM,  <gstein_at_apache.org> wrote:
>> Author: gstein
>> Date: Thu May 17 22:27:03 2012
>> New Revision: 1339892
>>
>> URL: http://svn.apache.org/viewvc?rev=1339892&view=rev
>> Log:
>> Generate out-of-date errors for paths which already exist (rather than
>> waiting for an error when we try to write over existing content).
>>
>> * subversion/libsvn_fs/editor.c:
>>  (can_create): new helper function
>>  (add_directory_cb, add_file_cb, add_symlink_cb, copy_cb, move_cb):
>>    call the new can_create() helper
>>
>> Modified:
>>    subversion/trunk/subversion/libsvn_fs/editor.c
>>
>> Modified: subversion/trunk/subversion/libsvn_fs/editor.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/editor.c?rev=1339892&r1=1339891&r2=1339892&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_fs/editor.c (original)
>> +++ subversion/trunk/subversion/libsvn_fs/editor.c Thu May 17 22:27:03 2012
>> @@ -268,6 +268,25 @@ can_modify(svn_fs_root_t *txn_root,
>>  }
>>
>>
>> +/* Can we create a node at FSPATH in TXN_ROOT? If something already exists
>> +   at that path, then the client is out of date.  */
>> +static svn_error_t *
>> +can_create(svn_fs_root_t *txn_root,
>> +           const char *fspath,
>> +           apr_pool_t *scratch_pool)
>> +{
>> +  svn_node_kind_t kind;
>> +
>> +  SVN_ERR(svn_fs_check_path(&kind, txn_root, fspath, scratch_pool));
>> +  if (kind != svn_node_none)
>> +    return svn_error_createf(SVN_ERR_FS_OUT_OF_DATE, NULL,
>> +                             _("'%s' already exists, so may be out"
>> +                               " of date; try updating"),
>> +                             fspath);
>> +  return SVN_NO_ERROR;
>> +}
>> +
>> +
>>  /* This implements svn_editor_cb_add_directory_t */
>>  static svn_error_t *
>>  add_directory_cb(void *baton,
>> @@ -291,7 +310,10 @@ add_directory_cb(void *baton,
>>       SVN_ERR(can_modify(root, fspath, replaces_rev, scratch_pool));
>>       SVN_ERR(svn_fs_delete(root, fspath, scratch_pool));
>>     }
>> -  /* else better not be there!  */
>> +  else
>> +    {
>> +      SVN_ERR(can_create(root, fspath, scratch_pool));
>> +    }
>>
>>   SVN_ERR(svn_fs_make_dir(root, fspath, scratch_pool));
>>   SVN_ERR(add_new_props(root, fspath, props, scratch_pool));
>> @@ -321,7 +343,10 @@ add_file_cb(void *baton,
>>       SVN_ERR(can_modify(root, fspath, replaces_rev, scratch_pool));
>>       SVN_ERR(svn_fs_delete(root, fspath, scratch_pool));
>>     }
>> -  /* else better not be there!  */
>> +  else
>> +    {
>> +      SVN_ERR(can_create(root, fspath, scratch_pool));
>> +    }
>>
>>   SVN_ERR(svn_fs_make_file(root, fspath, scratch_pool));
>>
>> @@ -353,7 +378,10 @@ add_symlink_cb(void *baton,
>>       SVN_ERR(can_modify(root, fspath, replaces_rev, scratch_pool));
>>       SVN_ERR(svn_fs_delete(root, fspath, scratch_pool));
>>     }
>> -  /* else better not be there!  */
>> +  else
>> +    {
>> +      SVN_ERR(can_create(root, fspath, scratch_pool));
>> +    }
>>
>>   /* ### we probably need to construct a file with specific contents
>>      ### (until the FS grows some symlink APIs)  */
>> @@ -506,6 +534,10 @@ copy_cb(void *baton,
>>       SVN_ERR(can_modify(root, dst_fspath, replaces_rev, scratch_pool));
>>       SVN_ERR(svn_fs_delete(root, dst_fspath, scratch_pool));
>>     }
>> +  else
>> +    {
>> +      SVN_ERR(can_create(root, dst_fspath, scratch_pool));
>> +    }
>>
>>   SVN_ERR(svn_fs_revision_root(&src_root, svn_fs_root_fs(root), src_revision,
>>                                scratch_pool));
>> @@ -541,6 +573,10 @@ move_cb(void *baton,
>>       SVN_ERR(can_modify(root, dst_fspath, replaces_rev, scratch_pool));
>>       SVN_ERR(svn_fs_delete(root, dst_fspath, scratch_pool));
>>     }
>> +  else
>> +    {
>> +      SVN_ERR(can_create(root, dst_fspath, scratch_pool));
>> +    }
>>
>>   /* ### would be nice to have svn_fs_move()  */
>>
>>
>>
Received on 2012-05-18 02:49:00 CEST

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.