Mercurial > hg > mercurial-talk
changeset 9:173132961212
Introduction.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Fri, 14 Aug 2009 21:00:05 +0200 |
parents | 1a1e5c98f5b0 |
children | 244ac1c0be30 |
files | mercurial.tex |
diffstat | 1 files changed, 290 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial.tex +++ b/mercurial.tex @@ -58,4 +58,294 @@ \tableofcontents \end{frame} +\section{Introduction} + +\subsection{Basic Concepts} + +\begin{frame}{What do we want from a version control system?} + Very basic features: + \begin{itemize} + \item let you save changes + \item browser the history + \end{itemize} + + \pause + Basic features: + \begin{itemize} + \item collaboration + \item branches + \item tags + \end{itemize} + + \pause + Nice features: + \begin{itemize} + \item speed! + \item much more, as you will see\dots + \end{itemize} +\end{frame} + +\begin{frame}{Branches} + A central concept: + \begin{itemize} + \item parallel lines of development + \item used to track releases + \item used to isolate disruptive changes + \end{itemize} + + \begin{tikzpicture} + \path[use as bounding box] (0, -1.5) rectangle (10, 1.5); + + \tikzstyle{branch}=[blue!60, ->, >=latex, line join=round] + \tikzstyle{tag}=[draw=yellow!50!orange, fill=yellow!50] + + \draw<2->[->] (0, -1) -- +(10, 0) node[below left] {time}; + + \draw<5>[branch, blue!30, line width=2mm] + (v10) -- ++(1,1) + -- coordinate[pos=0.4] (v101) ++(3,0); + + \draw<6->[branch, blue!30, line width=2mm] + (v10) -- ++(1,1) + -- coordinate[pos=0.2] (v101) + coordinate[pos=0.7] (v102) ++(6,0); + + \draw<2-3>[branch, line width=3mm] + (0,0) -- coordinate[pos=0.4] (v10) +(2.5,0); + + \draw<4-6>[branch, line width=3mm] + (0,0) -- coordinate[pos=0.2] (v10) +(5,0); + + \draw<3-> (v10) ++(0, 0.3) -- ++(0, -0.6) node[below, tag] {1.0}; + \draw<5-> (v101) ++(0, 0.2) -- +(0, -0.4) node[below, tag] {1.0.1}; + \draw<6-> (v102) ++(0, 0.2) -- +(0, -0.4) node[below, tag] {1.0.2}; + \end{tikzpicture} +\end{frame} + +\begin{frame}{Merging} + The oposite of branching: + \begin{itemize} + \item combines two branches + \item used to merge back bugfixes + \item used to integrate feature branches + \end{itemize} + + \begin{tikzpicture} + \path[use as bounding box] (0, -1.5) rectangle (10, 1.5); + + \tikzstyle{branch}=[blue!60, ->, >=latex, line join=round] + \tikzstyle{tag}=[draw=yellow!50!orange, fill=yellow!50] + + \draw[->] (0, -1) -- +(10, 0) node[below left] {time}; + + \draw<1-2>[branch, blue!30, line width=2mm] + (v10) -- ++(1,1) + -- coordinate[pos=0.2] (v101) + coordinate[pos=0.7] (v102) ++(6,0); + + \draw<3->[branch, blue!30, line width=2mm] + (v10) -- ++(1,1) + -- coordinate[pos=0.2] (v101) + coordinate[pos=0.7] (v102) ++(6,0) + -- +(1, -1); + + \draw<2->[branch, blue!30, line width=2mm] + (v101) ++(0.8, 0) -- +(1,-1); + + \draw<1>[branch, line width=3mm] + (0,0) -- coordinate[pos=0.2] (v10) +(5,0); + + \draw<2>[branch, line width=3mm] + (0,0) -- coordinate[pos=0.125] (v10) +(8,0); + + \draw<3>[branch, line width=3mm] + (0,0) -- coordinate[pos=0.1] (v10) +(10,0); + + \draw<1-> (v10) ++(0, 0.3) -- ++(0, -0.6) node[below, tag] {1.0}; + \draw<1-> (v101) ++(0, 0.2) -- +(0, -0.4) node[below, tag] {1.0.1}; + \draw<1-> (v102) ++(0, 0.2) -- +(0, -0.4) node[below, tag] {1.0.2}; + \end{tikzpicture} +\end{frame} + + + +\subsection{Historic Context} + +\begin{frame}{Revision Control System (RCS)} + Version control from the 1980s: + \begin{itemize} + \item store changes (date, commit message) + \item browse history + \end{itemize} + + \bigskip + + \begin{tikzpicture} + \begin{scope}[start chain] + \node<2->[on chain,left] at (0, 0.5) {hello.c}; + \node<3->[on chain,xshift=-8mm, rev] {}; + \node<4->[on chain,join,rev] {}; + \node<5->[on chain,join,rev] {}; + \end{scope} + \begin{scope}[start chain] + \node<2->[on chain,left] at (0, 0) {Makefile}; + \node<3->[on chain,xshift=-8mm,rev] {}; + \node<6->[on chain,join,rev] {}; + \end{scope} + \end{tikzpicture} +\end{frame} + +\begin{frame}{Concurrent Versions System (CVS)} + Version control in the 1990s: + \begin{itemize} + \item collaboration over the network + \item several working copies + \item one central repository + \end{itemize} + + \pause + + \begin{center} + \begin{tikzpicture} + \begin{scope}[start chain, node distance=16mm] + \node[working copy, on chain, label=above:Alice] (Alice) + {hello.c\\ Makefile}; + \node[repository, on chain, label=above:CVS Server] (repository) {}; + \node[working copy, on chain, label=above:Bob] (Bob) + {hello.c\\ Makefile}; + \end{scope} + + \begin{scope}[scale=0.5,transform shape] + \begin{scope}[start chain] + \node[on chain,left, yshift=3mm, xshift=-2mm] at (repository) + {hello.c}; + \node[on chain,xshift=-8mm,rev] {}; + \node[on chain,join,rev] {}; + \end{scope} + \begin{scope}[start chain] + \node[on chain,left, yshift=-3mm, xshift=-2mm] at (repository) + {Makefile}; + \node[on chain,xshift=-8mm,rev] {}; + \node<3->[on chain,join,rev] {}; + \end{scope} + \end{scope} + + \draw<3>[->] (Alice) -- node[above] {commit} (repository); + \draw<4>[->] (repository) -- node[above] {update} (Bob); + \end{tikzpicture} + \end{center} +\end{frame} + +\begin{frame}{So, everything is good?} + CVS has many limitations: + \begin{itemize} + \item no atomic commits + \item no rename information + \item branches? I hope you have a CVS guru at hand\dots + \end{itemize} +\end{frame} + +\begin{frame}{Subversion (SVN)} + Version control from this millennia --- ``\emph{CVS done right}'': + \begin{itemize} + \item atomic commits + \item tracks renames + \item supports some operations without network access + \end{itemize} +\end{frame} + +\begin{frame}{Branches in SVN} + Subversion knows nothing about branches! + \begin{itemize} + \item but SVN has a cheap copy mechanism + \item used for tags and branches + \end{itemize} + + \begin{tikzpicture} + \node<2->[working copy, below, text width=20mm, label=above:r10] + (a) at (0, 0) { + trunk/\\ + \quad hello.c\\ + \quad Makefile\\ + branches/ + }; + \node<3->[working copy, below, text width=25mm, label=above:r11] + (b) at (3.5, 0) { + trunk/\\ + \quad hello.c\\ + \quad Makefile\\ + branches/\\ + \quad goodbye/\\ + \qquad hello.c\\ + \qquad Makefile\\ + }; + \node<4->[working copy, below, text width=30mm, label=above:r12] + (c) at (7.5, 0) { + trunk/\\ + \quad hello.c\\ + \quad Makefile\\ + branches/\\ + \quad goodbye/\\ + \qquad hello.c\\ + \qquad goodbye.c\\ + \qquad Makefile\\ + }; + + \tikzstyle{s}=[yshift=-5mm] + \tikzstyle{every pin edge}=[draw, red, <-] + + \draw<3->[->] ([s] a.north east) -- ([s] b.north west); + \draw<4->[->] ([s] b.north east) -- ([s] c.north west); + \end{tikzpicture} +\end{frame} + +\begin{frame}{Merging Branches in SVN} + Branches are only interesting if you can merge them: + \begin{itemize} + \item before SVN 1.5: no built-in support for merging(!) + \item SVN 1.5 and later: tracks info needed for merging + \end{itemize} + + \pause + + \begin{center} + \begin{tikzpicture} + \node[draw=structure, fill=structure!20!white, text justified, + text width=0.9\textwidth, font=\small] {The bottom line is that + Subversion's merge-tracking feature has an \alert{extremely + complex} internal implementation, and the + \texttt{svn:mergeinfo} property is the only window the user has + into the machinery. Because the feature is \alert{relatively + new}, a numbers of edge cases and possible unexpected + behaviors may pop up. \hfill\itshape ---Version Control with + Subversion}; + \end{tikzpicture} + \end{center} + + (Mercurial has robust built-in support for merging branches.) +\end{frame} + + +%% \begin{frame}{Basic Version Control} +%% Working alone: +%% \begin{itemize} +%% \item store changes (date, commit message) +%% \item browse history +%% \end{itemize} +%% (RCS did this in the 1980s) +%% \end{frame} +%% +%% \begin{frame}{Working with Others} +%% Distributing changes: +%% \begin{itemize} +%% \item get new changes from a server +%% \item send new commits to a server +%% \item \emph{resolve} conflicts between you and server +%% \end{itemize} +%% (CVS did this in 1990s) +%% \end{frame} + + \end{document} + +% LocalWords: SVN Makefile