Source

yt.workshop2012.dvcs / dvcs.tex

\documentclass[14pt]{beamer}
\newcommand\smfont{\fontsize{8}{6.4}\selectfont}
\newcommand{\bigsimple}[1]{
  \begin{frame}[c]{}
  \begin{center}
    {\huge \textbf{#1} }
  \end{center}
  \end{frame}
}
\newcommand{\mediumsimple}[1]{
  \begin{frame}[c]{}
  \begin{center}
    \textbf{#1}
  \end{center}
  \end{frame}
}
\newcommand{\fullimage}[1]{
  {
    \usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{#1}}
    \begin{frame}[plain]{}
    \end{frame}
  }
}
\newcommand{\defslide}[2]{
  \begin{frame}[t]{}
  \begin{center}
  ``#1''
  \end{center}
  \\
  \vspace{1in}
  \\
  #2
  \end{frame}
}

\setbeamercolor{normal text}{bg=black,fg=white}
\setbeamertemplate{navigation symbols}{}
\usecolortheme[named=white]{structure}
\usetheme{default}
\usepackage{relsize}
\newcommand{\yt}{{\larger\texttt{yt}}}
\newcommand{\hg}{{\larger\texttt{hg}}}

\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

%\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{tgadventor}

\usepackage{graphicx}
\usepackage{color}
\usepackage{fancyvrb}
\usepackage{../pastie}

\title{Version Control with Mercurial}

\begin{document}

\begin{frame}
 \titlepage
\end{frame}

\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)}

\defslide{DAG}{
The river of changes: a directed acyclic graph showing ins and outs.  Each node
is a changeset.
}

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

\defslide{Head}{
A changeset with no children.
}

\fullimage{hg_graph.png}

\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 BitBucket.org.}

\begin{frame}[t]{}
\vspace{1in}
\begin{itemize}
\item Network effect: Enzo uses it
\item Immutable history
\item Nice and easy API
\item Easy to learn
\item Few dependencies
\item Extensions!  Python!
\end{itemize}
\end{frame}

\defslide{Repository}{
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}
\end{frame}

% Cover hg whoami and bootstrap_dev

\begin{frame}[fragile,t]{Bootstrap}
\vspace{1in}
The command \texttt{yt bootstrap} will set up an environment.
\begin{itemize}
\item Set up an \hg{} username
\item Set up a BitBucket.org username
\item Set up \hg{} extensions
\end{itemize}
\end{frame}

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

\begin{frame}[fragile,t]{Let's try it together.}
\tiny
<<d['scripts/hginit.shx|fn|bashx|pyg|l']>>
\end{frame}

\begin{frame}[t]{\hg{} Cheat Sheet}
\smfont{}
\begin{center}
\begin{tabular}{l|p{2.5in}}
\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]
\multicolumn{2}{c}{http://hginit.com/}\\
\multicolumn{2}{c}{http://mercurial.selenic.com/}
\end{tabular}
\end{center} 
\end{frame} 

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

\end{document}
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 ProjectModifiedEvent.java.
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.