You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2012/07/17 23:06:01 UTC
Ev2 -- Driving Order Restrictions
Can the Ev2 experts comment on these queries?
Index: subversion/include/svn_editor.h
===================================================================
--- subversion/include/svn_editor.h (revision 1362611)
+++ subversion/include/svn_editor.h (working copy)
@@ -247,18 +247,26 @@
* must be driven in adherence to these rules:
*
* - If any path is added (with add_*) or deleted/moved/rotated, then
+ * ### JAF: Or copied?
+ * ### JAF: Rewrite as: "If any path is added or removed or replaced
+ * (with add_*, delete, copy, move, rotate), then ..."?
* an svn_editor_alter_directory() call must be made for its parent
* directory with the target/eventual set of children.
+ * ### JAF: Even if initial & eventual sets of children are identical?
*
* - svn_editor_add_directory() -- Another svn_editor_add_*() call must
+ * ### JAF: Or copy-here or move-here call?
* follow for each child mentioned in the @a children argument of any
* svn_editor_add_directory() call.
+ * ### JAF: Also for each new child of any alter_directory() call?
*
* - For each node created with add_*, if its parent was created using
+ * ### JAF: node created with add_* or copy or move-here?
* svn_editor_add_directory(), then the new child node MUST have been
* mentioned in the @a children parameter of the parent's creation.
* This allows the parent directory to properly mark the child as
* "incomplete" until the child's add_* call arrives.
+ * ### JAF: Also for each new child of any alter_directory() call?
*
* - A path should never be referenced more than once by the add_*, alter_*,
* and delete operations (the "Once Rule"). The source path of a copy (and
- Julian
--
Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/download
Re: Ev2 -- Driving Order Restrictions
Posted by Julian Foad <ju...@btopenworld.com>.
Ping... any Ev2 gurus?
Especially my question about delete, at the end of this email...
I (Julian Foad) wrote:
> Greg Stein wrote:
>>> * - If any path is added (with add_*) or deleted/moved/rotated, then
[...]
>>> + * ### JAF: Rewrite as: "If any path is added or removed or replaced
>>> + * (with add_*, delete, copy, move, rotate), then ..."?
>>
>> Yes.
>>
>>> * an svn_editor_alter_directory() call must be made for its parent
>>> * directory with the target/eventual set of children.
>>> + * ### JAF: Even if initial & eventual sets of children are identical?
>>
>> No. If they are identical, then you are replacing one or more nodes.
>
> OK. In that case, 'replace' and 'rotate' are superfluous in
> this rule as they don't change the existence of a node at a given path. The
> rule should be:
>
> If any path is added or removed (with add_*, delete, copy
> or move), such that the target/eventual set of children
> of its parent directory differs from the initial set, then
> an svn_editor_alter_directory() call must be made for its
> parent directory with the target/eventual set of children.
>
> Or we could shorten that to:
>
> If the target/eventual set of children of a directory
> differs from its initial set of children, then an
> svn_editor_alter_directory() call must be made for the
> directory, specifying the target/eventual set of children.
>
>>> *
>>> * - svn_editor_add_directory() -- Another svn_editor_add_*() call must
>>> + * ### JAF: Or copy-here or move-here call?
>>
>> Or rotate, yes.
>
> Rotate can't create a node at a given path where there wasn't a node
> before, so there needs to be an add or copy-here or move-here[1].
>
>>> * follow for each child mentioned in the @a children argument of any
>>> * svn_editor_add_directory() call.
>>> + * ### JAF: Also for each new child of any alter_directory() call?
>>
>> Yes.
>>
>>> *
>>> * - For each node created with add_*, if its parent was created using
>>> + * ### JAF: node created with add_* or copy or move-here?
>>
>> No. Copy/move arrives with children already.
>>
>>> * svn_editor_add_directory(), then the new child node MUST have been
>>> * mentioned in the @a children parameter of the parent's creation.
>>> * This allows the parent directory to properly mark the child as
>>> * "incomplete" until the child's add_* call arrives.
>
> Are you saying, if the child is created by
> 'copy' or 'move' then the WC won't need to mark it
> 'incomplete' so the
> editor doesn't need to pre-notify it in a 'children' argument? This
> seems to be a bit too specific to the current needs of WC-NG.
>
> But wait-a-sec. We can simply delete this rule, because it is already redundant
> with the first rule which already says that if a new child is to be added in any
> way then the new list of children must have been provided in a
> 'children' argument, period.
>
>
>>> + * ### JAF: Also for each new child of any alter_directory() call?
>>
>> Yes.
>
>
> OK.
>
> A question about delete. If a path is deleted and not replaced, then the new
> list of children for the parent directory must have been provided (first rule).
> But conversely, if a path is removed from a directory by alter_directory's
> 'children' parameter, then must there necessarily be a delete or
> move-away for that child?
This 'delete' question is, essentially, starting from the following tree of three nodes:
D
D/D1
D/D2
which of the following are valid ways to delete 'D1'?
(1)
delete('D/D1')
complete()
(2)
alter_dir('D', children={D2})
complete()
(3)
alter_dir('D', children={D2})
delete('D/D1')
complete()
(4)
delete('D/D1')
alter_dir('D', children={D2})
complete()
Sequence (1) is forbidden by the first rule; (2) and (3) and (4) are not forbidden by the Driving Order Restrictions as currently stated in svn_editor.h as far as I can see.
Sending a delete() operation for each deleted child as well as an alter_directory() is of course redundant, so in the interest of efficiency, and thinking just of the deletion of many files, I assume we would consider making the delete() call optional or forbidden; but I don't know what's already been decided or if there are other factors in play.
- Julian
Re: Ev2 -- Driving Order Restrictions
Posted by Julian Foad <ju...@btopenworld.com>.
Greg Stein wrote:
> On Jul 17, 2012 2:06 PM, "Julian Foad" <ju...@btopenworld.com> wrote:
>> * - If any path is added (with add_*) or deleted/moved/rotated, then
>> + * ### JAF: Or copied?
>
> Yes. The add_* is too narrow.
>
>> + * ### JAF: Rewrite as: "If any path is added or removed or replaced
>> + * (with add_*, delete, copy, move, rotate), then ..."?
>
> Yes.
>
>> * an svn_editor_alter_directory() call must be made for its parent
>> * directory with the target/eventual set of children.
>> + * ### JAF: Even if initial & eventual sets of children are identical?
>
> No. If they are identical, then you are replacing one or more nodes.
OK. In that case, 'replace' and 'rotate' are superfluous in this rule as they don't change the existence of a node at a given path. The rule should be:
If any path is added or removed (with add_*, delete, copy
or move), such that the target/eventual set of children
of its parent directory differs from the initial set, then
an svn_editor_alter_directory() call must be made for its
parent directory with the target/eventual set of children.
Or we could shorten that to:
If the target/eventual set of children of a directory
differs from its initial set of children, then an
svn_editor_alter_directory() call must be made for the
directory, specifying the target/eventual set of children.
>> *
>> * - svn_editor_add_directory() -- Another svn_editor_add_*() call must
>> + * ### JAF: Or copy-here or move-here call?
>
> Or rotate, yes.
Rotate can't create a node at a given path where there wasn't a node before, so there needs to be an add or copy-here or move-here[1].
>> * follow for each child mentioned in the @a children argument of any
>> * svn_editor_add_directory() call.
>> + * ### JAF: Also for each new child of any alter_directory() call?
>
> Yes.
>
>> *
>> * - For each node created with add_*, if its parent was created using
>> + * ### JAF: node created with add_* or copy or move-here?
>
> No. Copy/move arrives with children already.
>
>> * svn_editor_add_directory(), then the new child node MUST have been
>> * mentioned in the @a children parameter of the parent's creation.
>> * This allows the parent directory to properly mark the child as
>> * "incomplete" until the child's add_* call arrives.
Are you saying, if the child is created by
'copy' or 'move' then the WC won't need to mark it 'incomplete' so the
editor doesn't need to pre-notify it in a 'children' argument? This seems to be a bit too specific to the current needs of WC-NG.
But wait-a-sec. We can simply delete this rule, because it is already redundant with the first rule which already says that if a new child is to be added in any way then the new list of children must have been provided in a 'children' argument, period.
>> + * ### JAF: Also for each new child of any alter_directory() call?
>
> Yes.
OK.
A question about delete. If a path is deleted and not replaced, then the new list of children for the parent directory must have been provided (first rule). But conversely, if a path is removed from a directory by alter_directory's 'children' parameter, then must there necessarily be a delete or move-away for that child?
- Julian
[1] 'move-here' or 'copy-here' meaning a move or copy where 'this' path is the target.
Re: Ev2 -- Driving Order Restrictions
Posted by Greg Stein <gs...@gmail.com>.
On Jul 17, 2012 2:06 PM, "Julian Foad" <ju...@btopenworld.com> wrote:
>
> Can the Ev2 experts comment on these queries?
>
>
> Index: subversion/include/svn_editor.h
> ===================================================================
> --- subversion/include/svn_editor.h (revision 1362611)
> +++ subversion/include/svn_editor.h (working copy)
> @@ -247,18 +247,26 @@
> * must be driven in adherence to these rules:
> *
> * - If any path is added (with add_*) or deleted/moved/rotated, then
> + * ### JAF: Or copied?
Yes. The add_* is too narrow.
> + * ### JAF: Rewrite as: "If any path is added or removed or replaced
> + * (with add_*, delete, copy, move, rotate), then ..."?
Yes.
> * an svn_editor_alter_directory() call must be made for its parent
> * directory with the target/eventual set of children.
> + * ### JAF: Even if initial & eventual sets of children are identical?
No. If they are identical, then you are replacing one or more nodes.
> *
> * - svn_editor_add_directory() -- Another svn_editor_add_*() call must
> + * ### JAF: Or copy-here or move-here call?
Or rotate, yes.
> * follow for each child mentioned in the @a children argument of any
> * svn_editor_add_directory() call.
> + * ### JAF: Also for each new child of any alter_directory() call?
Yes.
> *
> * - For each node created with add_*, if its parent was created using
> + * ### JAF: node created with add_* or copy or move-here?
No. Copy/move arrives with children already.
> * svn_editor_add_directory(), then the new child node MUST have been
> * mentioned in the @a children parameter of the parent's creation.
> * This allows the parent directory to properly mark the child as
> * "incomplete" until the child's add_* call arrives.
> + * ### JAF: Also for each new child of any alter_directory() call?
Yes.
> *
> * - A path should never be referenced more than once by the add_*,
alter_*,
> * and delete operations (the "Once Rule"). The source path of a copy
(and
>
>
> - Julian
>
> --
> Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download