# Re: Ev2 as a move-aware editor

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Wed, 26 Jun 2013 12:25:39 +0300

Philip Martin wrote on Wed, Jun 26, 2013 at 09:30:42 +0100:
> Greg Stein <gstein_at_gmail.com> writes:
>
> > You're affecting six nodes, so I think you should be able to pack this
> > down into touching 6 nodes once each. I believe this will work:
> >
> > move(A/B, X/Y/Z/B)
> > rotate(A, X/Y/Z)
> > move(X/Y, A/B/C/Y)
> > rotate(X, A/B/C)
>
> Yes, I think that works.
>

This effectively uses temporary nodes (X/Y/Z/B and A/B/C/Y). I thought
one of the goals of Ev2 design was to not need such nodes. (This also
ties to my thread about what state the SRC argument of move() should be
relative to.)

> > Insert appropriate alter() calls. Each operation can be performed as
> > it arrives, as the later calls depend upon those moves/rotates.
>
> alter(A)
> alter(X/Y/Z)
> move(A/B, X/Y/Z/B)
> alter(.)
> alter(X/Y)
> rotate(A, X/Y/Z)
> alter(X)
> alter(A/B/C) was A/B/C
> move(X/Y, A/B/C/Y)
> alter(.) elided ?
> alter(A/B) was A/B
> rotate(X, A/B/C)
>
> In this instance when the alters affect moved nodes the nodes have been
> moved back to their original position.
>
> I wonder if we can do the same with Daniel's 9 node example? It has an
> odd number of elements so either one node occurs in two operations or
> one node doesn't need an operation at all.
>

move() calls affect just one node, rotate() calls can affect 2 or
6 nodes, so the parity sanity check comes out fine I think. I'll

Daniel

> We need a client algorithm that converts an arbitrary sequence of moves
> into this minimal sequence of moves and rotates. We also need a server
> algorithm that combines an arbitrary sequence of moves and rotates into
> a minimal sequence so that the server can combine multiple revisions.
> The two algorithms are essentially the same.
>
> --
> Philip Martin | Subversion Committer
> WANdisco | Non-Stop Data
> www.wandisco.com