Greg,
Sounds good. I'll take another look at blame 7, probably early next week.
Best,
-Hyrum
On Fri, May 18, 2012 at 4:19 PM, Greg Stein <gstein_at_gmail.com> wrote:
> Hyrum,
>
> This fixes all tests except for blame 7 [on the ev2-export branch].
>
> There is a potential hole, noted in the comments which I may try to
> write a test for.
>
> Cheers,
> -g
>
> On Fri, May 18, 2012 at 4:47 PM, Â <gstein_at_apache.org> wrote:
>> Author: gstein
>> Date: Fri May 18 20:47:43 2012
>> New Revision: 1340245
>>
>> URL: http://svn.apache.org/viewvc?rev=1340245&view=rev
>> Log:
>> Improve the detection of whether a node can be created at a given path.
>>
>> Specifically, if the path represents a child from an ancestor's copy,
>> move, or rotate, then we should allow further changes to that child.
>> Since the child is uncommitted, the REPLACES_REV will be
>> SVN_INVALID_REVNUM.
>>
>> * subversion/libsvn_fs/editor.c:
>> Â (can_create): update docstring. add ancestor checks for *-here ops.
>>
>> 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=1340245&r1=1340244&r2=1340245&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_fs/editor.c (original)
>> +++ subversion/trunk/subversion/libsvn_fs/editor.c Fri May 18 20:47:43 2012
>> @@ -34,6 +34,8 @@
>>
>> Â #include "fs-loader.h"
>>
>> +#include "private/svn_fspath.h"
>> +
>>
>> Â struct edit_baton {
>> Â /* The transaction associated with this editor. Â */
>> @@ -269,21 +271,56 @@ 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. Â */
>> + Â at that path, then the client MAY be out of date. We then have to see if
>> + Â the path was created/modified in this transaction. IOW, it is new and
>> + Â can be replaced without problem.
>> +
>> + Â Note: the editor protocol disallows double-modifications. This is to
>> + Â ensure somebody does not accidentally overwrite another file due to
>> + Â being 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;
>> + Â const char *cur_fspath;
>>
>> Â 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;
>> + Â if (kind == svn_node_none)
>> + Â Â return SVN_NO_ERROR;
>> +
>> + Â /* ### I'm not sure if this works perfectly. We might have an ancestor
>> + Â Â ### that was modified as a result of a change on a cousin. We might
>> + Â Â ### misinterpret that as a *-here node which brought along this
>> + Â Â ### child. Need to write a test to verify. We may also be able to
>> + Â Â ### test the ancestor to determine if it has been *-here in this
>> + Â Â ### txn, or just a simple modification. Â */
>> +
>> + Â /* Are any of the parents copied/moved/rotated-here? Â */
>> + Â for (cur_fspath = fspath;
>> +    strlen(cur_fspath) > 1;  /* not the root  */
>> + Â Â Â cur_fspath = svn_fspath__dirname(cur_fspath, scratch_pool))
>> + Â Â {
>> + Â Â Â svn_revnum_t created_rev;
>> +
>> + Â Â Â SVN_ERR(svn_fs_node_created_rev(&created_rev, txn_root, cur_fspath,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â scratch_pool));
>> + Â Â Â if (!SVN_IS_VALID_REVNUM(created_rev))
>> + Â Â Â Â {
>> + Â Â Â Â Â /* The node has no created revision, meaning it is uncommitted.
>> + Â Â Â Â Â Â Thus, it was created in this transaction, or it has already
>> + Â Â Â Â Â Â been modified in some way (implying it has already passed a
>> + Â Â Â Â Â Â modification check. Â */
>> + Â Â Â Â Â /* ### verify the node has been *-here ?? Â */
>> + Â Â Â Â Â return SVN_NO_ERROR;
>> + Â Â Â Â }
>> + Â Â }
>> +
>> + Â return svn_error_createf(SVN_ERR_FS_OUT_OF_DATE, NULL,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â _("'%s' already exists, so may be out"
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â " of date; try updating"),
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â fspath);
>> Â }
>>
>>
>>
>>
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2012-05-19 15:12:53 CEST