view pull-merge.tex @ 311:093a6fc8a608

Correct pull/merge slide
author Martin Geisler <mg@aragost.com>
date Thu, 09 Jun 2011 00:29:44 +0200
parents 7b96e9c37b20
children d3c8c0b3ab3c
line wrap: on
line source

\begin{frame}{Moving Changesets Around}
  \tikzstyle{rev}+=[on chain, minimum size=6mm, font=\small]
  \tikzstyle{a}=[rev, draw=green!30!black!50, bottom color=green!30!black!20]
  \tikzstyle{b}=[rev, draw=red!50!black!50, bottom color=red!50!black!20]
  \tikzstyle{join-above}=[out=0, in=240]
  \tikzstyle{join-below}=[out=-90, in=180]
  \tikzset{node distance=10mm and 12mm, on grid}

  Pull and merge:
  \medskip

  \begin{tikzpicture}
    \begin{scope}[start chain=alice]
      \node[rev,on chain,label=above:Alice] {$I$};
      \begin{scope}[start branch=bob]
        \node<5->[b,on chain=going below right, join=by join-below] {$B_1$};
      \end{scope}
      \node<2->[a,join] {$A_1$};
      \path<2> (alice-1.south) -- node[below] {\cmd{commit}} (alice-2.south);
      \node<3->[a,join] {$A_2$};
      \path<3> (alice-2.south) -- node[below] {\cmd{commit}} (alice-3.south);
      \node<6->[a,join,join=with alice/bob-end by join-above] {$A_3$};
    \end{scope}

    \begin{scope}[start chain=bob, shift={(7, 0)}]
      \node[rev,label=above:Bob] {$I$};
      \node<4->[b,join] {$B_1$};
      \path<4> (bob-1.south) -- node[below] {\cmd{commit}} (bob-2.south);
    \end{scope}

    \node<1-5>[fit=(alice-begin) (alice-end)] (A) {};
    \node<6->[fit=(alice-begin) (alice-end) (alice/bob-end)] (A) {};
    \node[fit=(bob-begin) (bob-end)] (B) {};

    \tikzstyle{every path}=[->, short]
    \draw<5> (B) -- node[below] {\cmd{pull}} (A);
    \node<6>[above] at (alice-end.north) {\cmd{merge}};
  \end{tikzpicture}

  \onslide<7->

  \medskip
  Merging:
  \begin{itemize}
    \item find common ancestor of $A_2$ and $B_1$: $I$
    \item do three-way merge between $I$, $A_2$, and $B_1$
    \item merge often $\Rightarrow$ common ancestor is close to tip
  \end{itemize}
\end{frame}