yt.workshop2012.dvcs / dvcs.tex

    {\huge \textbf{#1} }

\setbeamercolor{normal text}{bg=black,fg=white}
\setbeamertemplate{navigation symbols}{}

% or whatever

% or whatever



\title{Version Control with Mercurial}



\mediumsimple{Codes change with time.}
\bigsimple{Track changes}
\bigsimple{Distribute changes}

\defslide{Version Control}{
Systematic method of identifying and governing changes to a set of files.

\defslide{Centralized Version Control}{
A single authoritative location contains the code history.

\mediumslide{RCS (1982)}
\mediumslide{CVS (1990)}
\mediumslide{SVN (2000)}

\defslide{Distributed Version Control}{
Each ``copy'' contains a mutable copy of the code history, which also means
multiple descendents.

\mediumslide{Everything is change.}

\mediumslide{hg (2005) \\\& git (2005) \\\& bzr (2007) \\\& monotone (2003) \\\& darcs (2003)}

The river of changes: a directed acyclic graph showing ins and outs.  Each node
is a changeset.

(or ``hash'' or ``revision'')\\
Some identifiable, atomic location in the history of the code.  Numbers are
local, SHAs are global.

A changeset with no children.


\bigslide{Why hg?}

\mediumslide{2009 \yt{} began using hg on top of svn, moved there full time in 2011.}

\mediumsimple{On top of \hg{}, \yt{} hosts its repositories on}

\item Network effect: Enzo uses it
\item Immutable history
\item Nice and easy API
\item Easy to learn
\item Few dependencies
\item Extensions!  Python!

A complete history of the changes in a project.

\mediumsimple{\yt{} uses \hg{}, and it comes with the installation.}

\begin{frame}[t]{Try it:}
\texttt{\$ cd \$YT\_DEST/src/yt-hg}\\
\texttt{\$ hg log}\\
\texttt{\$ hg log -r 91619245def3}

% Cover hg whoami and bootstrap_dev

The command \texttt{yt bootstrap} will set up an environment.
\item Set up an \hg{} username
\item Set up a username
\item Set up \hg{} extensions

\mediumsimple{Give it a shot.\\\texttt{yt bootstrap}}

\begin{frame}[fragile,t]{Let's try it together.}

\begin{frame}[t]{\hg{} Cheat Sheet}
\texttt{init} & Create a new repo in current directory\\[9pt]
\texttt{add} & Track a new file\\[9pt]
\texttt{rm} & Remove a file from tracking \\[9pt]
\texttt{commit} & Create a new changeset with current directory \\[9pt] 
\texttt{update} & Change working directory to another revision \\[9pt]
\texttt{pull} & Retrieve new changesets from repository \\[9pt]
\texttt{push} & Share new changesets with repository \\[9pt]
\texttt{merge} & Reduce the number of heads by one \\[9pt]
\texttt{serve} & Webserver to transmit repos\\[9pt]

\mediumsimple{Heads have no children}
\mediumsimple{You can go back in time and make a new head}

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.