Re: Design query: Ev2 and multiple moves
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 8 Nov 2011 11:22:16 +0000 (GMT)
Hi Bill.
Let me see if I understand.
You describe a procedure for converting a set of parallel renames into an equivalent incremental sequence of renames. That is, the input is a list of N independent renames, where each "rename[i]" (for 0 <= i < N) describes a move from a path in the initial tree state "S0" to a path in the final tree state "SN". The output is a sequence of renames, where each "rename[i]" in turn describes a move from a path in the preceding tree state S[i] to the next intermediate tree state S[i+1], the final state S[N] being equal to the desired state "SN".
That transformation can be useful in itself, for example it might be useful for managing renames within the working copy library code.
However, the really interesting property of this algorithm is the meaning -- the implied ordering -- that this particular algorithm defines for renames that happen in parallel, based on their depth in the tree. Presumably, this meaning is believed to be what a user would most reasonably expect in most cases. It makes sense to me.
And so this would seem to provide a good definition for how we should combine renames when merging changes from one branch to another[1].
Now, some speculation on how this could work.
When we look at renames in the history of a single branch in Subversion, it is easy to see that we already have a partially sequential ordering: each revision makes changes based on the state left by the previous revision. At the same time, within a single revision we currently don't record any sequential information about renames, and I'm not sure if we ever will. If we infer renames within revision R from the current copy-from information then we have a list of parallel renames each based on the previous revision (R-1) [2].
Assuming we know how to decompose a sequence of renames into a parallel set [3], we can do things like convert the renames on each branch into a parallel set, merge the two parallel sets, and then convert back to a sequence. Or, depending on what merge we're doing, we may want to track the renames backward through one branch to the common ancestor and then forward on the other branch, which sounds like it should be just as easy.
We'll have to see how to do conflict resolution while merging the two sets.
I think we'll also have to account for non-rename changes within the same algorithm. I think that's necessary in order to handle sequences such as:
rename trunk tmp
As a set of parallel renames and other operations, this is:
[NIL] -> trunk
Does that sound right that we'd want to extend the algorithm to include adds (creation of new nodes) and deletes?
- Julian
[1] At least when the branches share a common ancestor; maybe even when they don't but I haven't thought about that.
[2] Or, for added complexity, based on a revision earlier than (R-1).
[3] It seems obvious -- just compare the initial and final states with regard to object identities -- but I don't know whether it's really that simple.
Bill Tutt wrote:
|
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.