You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2012/04/27 18:32:02 UTC
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
On Thu, Apr 26, 2012 at 10:06, Apache subversion Wiki
<co...@subversion.apache.org> wrote:
>...
> + == Problem Cases ==
> +
> + Move A to B:
> +
> + || op-depth || local-relpath || presence || revision || repos || moved-to ||
> + || 0 || A || normal || 1 || A || ||
> + || 0 || A/f || normal || 1 || A/f || ||
> + || 1 || A || base-deleted || 1 || A || B ||
> + || 1 || A/f || base-deleted || 1 || A/f || ||
> + || 1 || B || normal || 1 || A || ||
> + || 1 || B/f || normal || 1 || A/f || ||
> +
> + Delete B/f and replace with something copied from elsewhere:
> +
> + || op-depth || local-relpath || presence || revision || repos || moved-to ||
> + || 0 || A || normal || 1 || A || ||
> + || 0 || A/f || normal || 1 || A/f || ||
> + || 1 || A || base-deleted || 1 || A || B ||
> + || 1 || A/f || base-deleted || 1 || A/f || ||
> + || 1 || B || normal || 1 || A || ||
> + || 1 || B/f || normal || 1 || A/f || ||
> + || 2 || B/f || normal || 1 || X || ||
Wouldn't the B/f line at op_depth==1 have not-present to indicate that
it was deleted?
> +
> + Now update A and go through the mixed-revision base tree: we can't represent the mixed-revision copy since that would require B/f at op-depth=2 to record both A/f@2 and X@1.
Hm? I would expect the A/f@2 to be in the op_depth==1 line, and B/f at
op_depth==2 to continue to refer to X@1.
Cheers,
-g
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Greg Stein <gs...@gmail.com>.
On Fri, Apr 27, 2012 at 15:07, Philip Martin <ph...@wandisco.com> wrote:
> Greg Stein <gs...@gmail.com> writes:
>...
>> Stepping back, in 1.7, 'svn move' of a mixed-rev working copy is
>> actually just a set of copies (followed by a big delete). Each time a
>> revision differs from its parent, it performs another copy operation.
>> Thus, B is a copy of A@1, and B/f would be recorded as a
>> (possibly-replacing) copy of A/f@2.
>>
>> It seems that for a true move, we'd move A@1 to its new location. Any
>> children at different revisions would then become *copies*. In your
>> above example, pre-move, A/f might not even exist @1. (thus the
>> not-present for B/f) ... so the 'svn move A B' operation would also
>> do: 'svn copy A/f@2 B/f'.
>>
>> If you now delete B/f, then it is effectively reverting the copy that
>> occurred (still leaving B/f as not-present, aka "dunno if it is in
>> A@1"). Problem is: when you commit, B/f might be present, contrary to
>> what the working copy looked like. A/f@1 might have been present, and
>> it now shows up as B/f post-commit.
>
> That's not correct. Rows that are not-present at op-depth > 0 shows up
> as 'D' in status and causes commit to send a delete if required.
Oh, right. That is effectively a delete operation. 'not-present' at
op_depth==0 is what I'm thinking of.
Can we introduce a similar concept for moved nodes? "I'm not sure of
the status of this relpath in the repository. We have no local
information." Basically, a new form of absent.
>> In short, I think the schema is still fine. The trick is that children
>> of a mixed-rev move become copies. I don't see any other way to
>> represent the metadata in a mixed-rev move.
>
> One of the big problems with mixed-rev copies is that the committing the
> delete half is tricky since parts of the deleted tree are out of date.
Doesn't seem too tricky. Couldn't you do a depth-first deletion of the
source side? At each step, delete PATH@REV. That will ensure the
source tree still exists, unmodified, for all the various revisions.
This deletion process can be optimized by deleting subtrees where
rev_of(node) != rev_of(parent(node)). Whack whole subtrees that
consist of the same revision. As you move up, eventually you get to
OP_ROOT@REV and delete it.
It seems that would produce all the correct out-of-date checks. For a
single-rev source, it would devolve to a single delete(OP_ROOT@REV).
> There is a similar problem with single-rev moves when the source is
> out-of-date. This means that move isn't very useful until it supports
> update as that allows the out-of-date sorce to be brought up-to-date.
Not sure here. This just seems like a standard "incoming-edit vs
local-delete", like what we have in 1.7. The user can resolve to
delete (move) the edited file, too, or cancel the move and incorporate
the edits.
This seems to be a bit orthogonal to the representation issues which
started this thread, however.
> Running update also makes mixed-rev source into single-rev so I'd be
> happy not to support mixed-rev move, except that update a single-rev
> tree from one rev to another goes through mixed-rev.
Yup, but I think we "have to" support mixed-rev moves; otherwise, it
looks like a regression.
Cheers,
-g
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Philip Martin <ph...@wandisco.com>.
Stefan Sperling <st...@elego.de> writes:
> On Fri, Apr 27, 2012 at 08:07:47PM +0100, Philip Martin wrote:
>> Running update also makes mixed-rev source into single-rev so I'd be
>> happy not to support mixed-rev move, except that update a single-rev
>> tree from one rev to another goes through mixed-rev.
>
> IMO we don't need to support mixed-rev move at all if it causes
> too much pain. If people *really* needed that, they could still
> run a mixed-rev-copy+delete.
>
> Remember that this is a new feature. We can freely add constraints
> to it until it gets released.
I think we may be able to resolve the problem by using tree-conflicts.
Consider A moved-to B and an update to A/f that cannot be applied to
B/f. We can apply the update to the base node of A/f but we cannot
apply it to the moved node B/f for some reason (B/f is deleted or
replaced say). This will generate a tree-conflict. After the update we
have a move that is "broken" because the source has been updated and the
destination has not but it is still marked as a move, plus we have a
tree-conlfict. The process of resolving the tree-conflict will either
convert the move into delete+copy, or involve getting the tree into a
state such that the move can be followed.
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Greg Stein <gs...@gmail.com>.
On Fri, Apr 27, 2012 at 15:15, Stefan Sperling <st...@elego.de> wrote:
> On Fri, Apr 27, 2012 at 08:07:47PM +0100, Philip Martin wrote:
>> Running update also makes mixed-rev source into single-rev so I'd be
>> happy not to support mixed-rev move, except that update a single-rev
>> tree from one rev to another goes through mixed-rev.
>
> IMO we don't need to support mixed-rev move at all if it causes
> too much pain. If people *really* needed that, they could still
> run a mixed-rev-copy+delete.
>
> Remember that this is a new feature. We can freely add constraints
> to it until it gets released.
I thought about that, as I wrote my email. But it isn't a "new
feature" from the user's perspective. Subversion 1.7 has no problem
with 'svn move' on a mixed-revision working copy. Thus, requiring
single-rev would be a regression :-(
Cheers,
-g
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Stefan Sperling <st...@elego.de>.
On Fri, Apr 27, 2012 at 08:07:47PM +0100, Philip Martin wrote:
> Running update also makes mixed-rev source into single-rev so I'd be
> happy not to support mixed-rev move, except that update a single-rev
> tree from one rev to another goes through mixed-rev.
IMO we don't need to support mixed-rev move at all if it causes
too much pain. If people *really* needed that, they could still
run a mixed-rev-copy+delete.
Remember that this is a new feature. We can freely add constraints
to it until it gets released.
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Philip Martin <ph...@wandisco.com>.
Greg Stein <gs...@gmail.com> writes:
> Hmm. It seems there would be lots of problems with an 'svn move' of a
> mixed-revision working copy, once we record it as a true move.
There are problems defining how it should behave.
> Stepping back, in 1.7, 'svn move' of a mixed-rev working copy is
> actually just a set of copies (followed by a big delete). Each time a
> revision differs from its parent, it performs another copy operation.
> Thus, B is a copy of A@1, and B/f would be recorded as a
> (possibly-replacing) copy of A/f@2.
>
> It seems that for a true move, we'd move A@1 to its new location. Any
> children at different revisions would then become *copies*. In your
> above example, pre-move, A/f might not even exist @1. (thus the
> not-present for B/f) ... so the 'svn move A B' operation would also
> do: 'svn copy A/f@2 B/f'.
>
> If you now delete B/f, then it is effectively reverting the copy that
> occurred (still leaving B/f as not-present, aka "dunno if it is in
> A@1"). Problem is: when you commit, B/f might be present, contrary to
> what the working copy looked like. A/f@1 might have been present, and
> it now shows up as B/f post-commit.
That's not correct. Rows that are not-present at op-depth > 0 shows up
as 'D' in status and causes commit to send a delete if required.
> In short, I think the schema is still fine. The trick is that children
> of a mixed-rev move become copies. I don't see any other way to
> represent the metadata in a mixed-rev move.
One of the big problems with mixed-rev copies is that the committing the
delete half is tricky since parts of the deleted tree are out of date.
There is a similar problem with single-rev moves when the source is
out-of-date. This means that move isn't very useful until it supports
update as that allows the out-of-date sorce to be brought up-to-date.
Running update also makes mixed-rev source into single-rev so I'd be
happy not to support mixed-rev move, except that update a single-rev
tree from one rev to another goes through mixed-rev.
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Greg Stein <gs...@gmail.com>.
On Fri, Apr 27, 2012 at 12:59, Philip Martin <ph...@wandisco.com> wrote:
> Greg Stein <gs...@gmail.com> writes:
>...
>> Wouldn't the B/f line at op_depth==1 have not-present to indicate that
>> it was deleted?
>
> No. Before delete:
>
> op-depth local-relpath presence
> 1 B normal
> 1 B/f normal
>
> Delete B/f:
>
> op-depth local-relpath presence
> 1 B normal
> 1 B/f normal
> 2 B/f base-deleted
>
> Replace B/f
>
> op-depth local-relpath presence
> 1 B normal
> 1 B/f normal
> 2 B/f normal
Ah, right. Thanks for the correction.
>
>>> +
>>> + Now update A and go through the mixed-revision base tree: we can't represent the mixed-revision copy since that would require B/f at op-depth=2 to record both A/f@2 and X@1.
>>
>> Hm? I would expect the A/f@2 to be in the op_depth==1 line, and B/f at
>> op_depth==2 to continue to refer to X@1.
>
> No. When we have mixed-rev A and A/f and A gets moved to B the result
> is:
>
> op-depth local-relpath presence revision
> 0 A normal 1
> 0 A/f normal 2
> 1 B normal 1
> 1 B/f not-present
> 2 B/f normal 2
>
> and that's a problem if op-depth=2 B/f is already used for somethin
> else.
Hmm. It seems there would be lots of problems with an 'svn move' of a
mixed-revision working copy, once we record it as a true move.
Stepping back, in 1.7, 'svn move' of a mixed-rev working copy is
actually just a set of copies (followed by a big delete). Each time a
revision differs from its parent, it performs another copy operation.
Thus, B is a copy of A@1, and B/f would be recorded as a
(possibly-replacing) copy of A/f@2.
It seems that for a true move, we'd move A@1 to its new location. Any
children at different revisions would then become *copies*. In your
above example, pre-move, A/f might not even exist @1. (thus the
not-present for B/f) ... so the 'svn move A B' operation would also
do: 'svn copy A/f@2 B/f'.
If you now delete B/f, then it is effectively reverting the copy that
occurred (still leaving B/f as not-present, aka "dunno if it is in
A@1"). Problem is: when you commit, B/f might be present, contrary to
what the working copy looked like. A/f@1 might have been present, and
it now shows up as B/f post-commit.
In short, I think the schema is still fine. The trick is that children
of a mixed-rev move become copies. I don't see any other way to
represent the metadata in a mixed-rev move.
Cheers,
-g
Re: [Subversion Wiki] Update of "MultiLayerMoves" by PhilipMartin
Posted by Philip Martin <ph...@wandisco.com>.
Greg Stein <gs...@gmail.com> writes:
> On Thu, Apr 26, 2012 at 10:06, Apache subversion Wiki
> <co...@subversion.apache.org> wrote:
>>...
>> + == Problem Cases ==
>> +
>> + Move A to B:
>> +
>> + || op-depth || local-relpath || presence || revision || repos || moved-to ||
>> + || 0 || A || normal || 1 || A || ||
>> + || 0 || A/f || normal || 1 || A/f || ||
>> + || 1 || A || base-deleted || 1 || A || B ||
>> + || 1 || A/f || base-deleted || 1 || A/f || ||
>> + || 1 || B || normal || 1 || A || ||
>> + || 1 || B/f || normal || 1 || A/f || ||
>> +
>> + Delete B/f and replace with something copied from elsewhere:
>> +
>> + || op-depth || local-relpath || presence || revision || repos || moved-to ||
>> + || 0 || A || normal || 1 || A || ||
>> + || 0 || A/f || normal || 1 || A/f || ||
>> + || 1 || A || base-deleted || 1 || A || B ||
>> + || 1 || A/f || base-deleted || 1 || A/f || ||
>> + || 1 || B || normal || 1 || A || ||
>> + || 1 || B/f || normal || 1 || A/f || ||
>> + || 2 || B/f || normal || 1 || X || ||
>
> Wouldn't the B/f line at op_depth==1 have not-present to indicate that
> it was deleted?
No. Before delete:
op-depth local-relpath presence
1 B normal
1 B/f normal
Delete B/f:
op-depth local-relpath presence
1 B normal
1 B/f normal
2 B/f base-deleted
Replace B/f
op-depth local-relpath presence
1 B normal
1 B/f normal
2 B/f normal
>> +
>> + Now update A and go through the mixed-revision base tree: we can't represent the mixed-revision copy since that would require B/f at op-depth=2 to record both A/f@2 and X@1.
>
> Hm? I would expect the A/f@2 to be in the op_depth==1 line, and B/f at
> op_depth==2 to continue to refer to X@1.
No. When we have mixed-rev A and A/f and A gets moved to B the result
is:
op-depth local-relpath presence revision
0 A normal 1
0 A/f normal 2
1 B normal 1
1 B/f not-present
2 B/f normal 2
and that's a problem if op-depth=2 B/f is already used for somethin
else.
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com