On 23 March 2010 09:11, Greg Stein <gstein_at_gmail.com> wrote:
> On Mon, Mar 22, 2010 at 17:59, Philip Martin <philip.martin_at_wandisco.com> wrote:
>> $ svn cp $url/A wc
>> $ svn add wc/A/Y
>> Suppose $url/A contains $url/A/X. How do I distinguish between a
>> copied child, like wc/A/X, and an added node like wc/A/Y? Neither has
>> copyfrom set. How do I know that A/X inherits from it's parent A
>> while A/Y does not?
> Yes, you brought up this hole in the design a while back, and we've
> had some discussion on ways to solve it. As Bert points out, you can
> use changed_* to detect the local-add, rather than local-copies.
> We may introduce a special copyfrom_* value to indicate "local-add"
> rather than "copy-from". Or maybe rely on changed_*. It is unclear on
> what is the best approach right now.
May I suggest to use the WORKING node's 'presence', as we already do
with subpath deletions inside copied trees. A presence of
'not-present' currently indicates that a subpath of a recursive copy
is excluded from the copy, IOW that it is the root of a delete
operation inside a copy. A new value called 'not-related' could
indicate that a path is the root of an *add* operation that is not
related to the add operation of its parent. (Copies inside copies
would also have this presence. And we'd have a new svn_wc__db_status_t
CREATE TABLE WORKING_NODE (
/* Is this node "present" or has it been excluded for some reason?
Only allowed values: normal, not-present, incomplete, base-deleted.
(the others do not make sense for the WORKING tree)
normal: this node has been added/copied/moved-here. There may be an
underlying BASE node at this location, implying this is a replace.
Scan upwards from here looking for copyfrom or moved_here values
to detect the type of operation constructing this node.
not-present: the node (or parent) was originally copied or moved-here.
[Note: only makes sense when a *parent* was originally copied here!]
A subtree of that source has since been deleted. There may be
underlying BASE node to replace. For a move-here or copy-here, the
records are simply removed rather than switched to not-present.
Note this reflects a deletion only. It is not possible move-away
nodes from the WORKING tree. The purported destination would receive
a copy from the original source of a copy-here/move-here, or if the
nodes were plain adds, those nodes would be shifted to that target
incomplete: nodes are being added into the WORKING tree, and the full
information about this node is not (yet) present.
base-deleted: the underlying BASE node has been marked for deletion due
to a delete or a move-away (see the moved_to column to determine
which), and has not been replaced. */
presence TEXT NOT NULL,
Received on 2010-03-23 22:20:31 CET