| author | Puneeth Chaganti <punchagan@fossee.in> |
| Sun, 06 Feb 2011 17:57:03 +0530 | |
| changeset 157 | 3174d4803cd5 |
| parent 156 | 8f4806a1a64d |
| permissions | -rw-r--r-- |
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
2 |
% Version Control Systems |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
3 |
% |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
4 |
% Author: FOSSEE |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
5 |
% Copyright (c) 2009, FOSSEE, IIT Bombay |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
6 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
7 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
8 |
\documentclass[14pt,compress]{beamer}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
9 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
10 |
\mode<presentation> |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
11 |
{
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
12 |
\usetheme{Warsaw}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
13 |
\useoutertheme{infolines}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
14 |
\setbeamercovered{transparent}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
15 |
} |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
16 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
17 |
\usepackage[english]{babel}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
18 |
\usepackage[latin1]{inputenc}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
19 |
%\usepackage{times}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
20 |
\usepackage[T1]{fontenc}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
21 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
22 |
% Taken from Fernando's slides. |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
23 |
\usepackage{ae,aecompl}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
24 |
\usepackage{mathpazo,courier,euler}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
25 |
\usepackage[scaled=.95]{helvet}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
26 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
27 |
\definecolor{darkgreen}{rgb}{0,0.5,0}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
28 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
29 |
\usepackage{listings}
|
| 138 | 30 |
\lstset{language=bash,
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
31 |
basicstyle=\ttfamily\bfseries, |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
32 |
commentstyle=\color{red}\itshape,
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
33 |
stringstyle=\color{darkgreen},
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
34 |
showstringspaces=false, |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
35 |
keywordstyle=\color{blue}\bfseries}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
36 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
37 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
38 |
% Macros |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
39 |
\setbeamercolor{emphbar}{bg=blue!20, fg=black}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
40 |
\newcommand{\emphbar}[1]
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
41 |
{\begin{beamercolorbox}[rounded=true]{emphbar}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
42 |
{#1}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
43 |
\end{beamercolorbox}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
44 |
} |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
45 |
\newcounter{time}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
46 |
\setcounter{time}{0}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
47 |
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
48 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
49 |
\newcommand{\typ}[1]{\lstinline{#1}}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
50 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
51 |
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} }
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
52 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
53 |
% Title page |
|
144
c592f2304cff
vcs: Change \title in vcs.tex.
Puneeth Chaganti <punchagan@fossee.in>
parents:
143
diff
changeset
|
54 |
\title[Mercurial]{SEES: Version Control with \typ{hg}}
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
55 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
56 |
\author[FOSSEE] {FOSSEE}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
57 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
58 |
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
59 |
\date[]{}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
60 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
61 |
\AtBeginSection[] |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
62 |
{
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
63 |
\begin{frame}<beamer>
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
64 |
\frametitle{Outline}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
65 |
\tableofcontents[currentsection,currentsubsection] |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
66 |
\end{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
67 |
} |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
68 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
69 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
70 |
% DOCUMENT STARTS |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
71 |
\begin{document}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
72 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
73 |
\begin{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
74 |
\maketitle |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
75 |
\end{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
76 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
77 |
% CREATING TOC |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
78 |
\begin{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
79 |
\frametitle{Outline}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
80 |
\tableofcontents |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
81 |
% You might wish to add the option [pausesections] |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
82 |
\end{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
83 |
|
| 138 | 84 |
%% There are some %$ used just to minimise the effect of $ sign used |
85 |
%% in lstlisting. In emacs it looks dirty. |
|
|
78
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
86 |
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
87 |
% Introduction to course-need of version control, history, options available. |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
88 |
\section{Introduction}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
89 |
|
| 138 | 90 |
\begin{frame}
|
91 |
\frametitle{What is Version Control?}
|
|
92 |
\begin{block}{}
|
|
93 |
A way to track changes made to files over time, by keeping copies |
|
94 |
of files as we change them. |
|
95 |
\end{block}
|
|
96 |
\end{frame}
|
|
97 |
||
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
98 |
%% Home made version control system? |
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
99 |
\begin{frame}[fragile]
|
| 138 | 100 |
\frametitle{Home-brewed}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
101 |
\begin{center}
|
| 138 | 102 |
An example of a \typ{home-brew} Version Control system
|
103 |
\includegraphics[height=1.8in,width=4.2in]{images/folder.png}
|
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
104 |
\end{center}
|
| 138 | 105 |
\begin{lstlisting}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
106 |
$ ls |
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
107 |
a.out id1.txt id2.txt identifier.cpp id.txt lex pda1.cpp pda2.cpp pda.cpp pda.txt string.txt |
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
108 |
\end{lstlisting} %%$
|
| 138 | 109 |
%%a screen-shot of folder with all crazy names. |
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
110 |
\end{frame}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
111 |
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
112 |
\begin{frame}[fragile]
|
| 138 | 113 |
\frametitle{Problems}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
114 |
\begin{block}{}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
115 |
\begin{itemize}
|
| 138 | 116 |
\item Name and changes made are not related or linked. |
117 |
\item Can't track sequence of changes made to a file. |
|
118 |
\item Does not scale. |
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
119 |
\end{itemize}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
120 |
\end{block}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
121 |
\end{frame}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
122 |
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
123 |
\begin{frame}[fragile]
|
| 138 | 124 |
\frametitle{The need for Version Control}
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
125 |
\begin{itemize}
|
| 138 | 126 |
\item \alert{To err is Human} \ldots
|
127 |
\item Tracking the history and evolution of a project |
|
128 |
\item To collaborate effectively on a project |
|
129 |
\item To efficiently track down bugs and pin-point the changes that |
|
130 |
caused it |
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
131 |
\end{itemize}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
132 |
\end{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
133 |
|
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
134 |
%% Introduction to how logs are managed in VCS. |
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
135 |
%% A analogy in logs and day-to-day life? |
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
136 |
\begin{frame}[fragile]
|
| 138 | 137 |
\frametitle{How does it work? --- Analogy}
|
138 |
It is, in some ways, similar to playing an Video game. |
|
139 |
\begin{itemize}
|
|
140 |
\item We play games in stages |
|
141 |
\item Once we finish a stage or a task -- \alert{we SAVE}
|
|
142 |
\item We continue playing |
|
143 |
\item But, if necessary, we could choose from one of the saved |
|
144 |
states and start from there |
|
145 |
\item We could alter the course of the game |
|
146 |
\end{itemize}
|
|
147 |
\end{frame}
|
|
148 |
||
149 |
||
150 |
\begin{frame}
|
|
151 |
\frametitle{Mercurial or \typ{hg}}
|
|
152 |
\begin{center}
|
|
153 |
\includegraphics[height=.75in,interpolate=true]{images/mercurial_logo}
|
|
154 |
\end{center}
|
|
155 |
\begin{itemize}
|
|
156 |
\item Easy to learn and use |
|
157 |
\item Lightweight |
|
158 |
\item Scales excellently |
|
159 |
\item Written in Python |
|
160 |
\end{itemize}
|
|
161 |
\end{frame}
|
|
162 |
||
163 |
\begin{frame}
|
|
164 |
\frametitle{Installation}
|
|
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
165 |
\begin{itemize}
|
| 138 | 166 |
\item \typ{sudo apt-get install mercurial}
|
167 |
\item TortoiseHg |
|
168 |
\item \typ{\$ hg}
|
|
169 |
\item \typ{\$ hg version}
|
|
170 |
\end{itemize}
|
|
171 |
\end{frame}
|
|
172 |
||
173 |
\section{Let there be a Repo!}
|
|
174 |
% init, status, commit, log, [ui] |
|
175 |
\begin{frame}
|
|
176 |
\frametitle{We need a repo!}
|
|
177 |
\begin{itemize}
|
|
178 |
\item A Repository (repo) is where all the action is! |
|
179 |
\item Project's files plus a special folder that stores all the |
|
180 |
changes |
|
181 |
\item We take snapshots of the whole repository; not individual |
|
182 |
files. |
|
183 |
\end{itemize}
|
|
184 |
\end{frame}
|
|
185 |
||
186 |
\begin{frame}
|
|
187 |
\frametitle{Initializing a repo}
|
|
188 |
\begin{itemize}
|
|
189 |
\item \typ{\$ hg init}
|
|
190 |
\item Creates a fresh repository |
|
191 |
\item Adds a \typ{.hg} directory to our \emph{Working directory}
|
|
192 |
\end{itemize}
|
|
193 |
\emphbar{\typ{.hg} directory keeps log of changes made henceforth}
|
|
194 |
\end{frame}
|
|
195 |
||
196 |
\begin{frame}
|
|
197 |
\frametitle{Status report}
|
|
198 |
\begin{itemize}
|
|
199 |
\item \typ{hg status} gives the status of our repo
|
|
200 |
\item Use it often; at least as a beginner |
|
201 |
\item \typ{hg help command} gives us help about \typ{command}
|
|
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
202 |
\end{itemize}
|
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
203 |
\end{frame}
|
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
204 |
|
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
205 |
\begin{frame}[fragile]
|
| 138 | 206 |
\frametitle{Status codes}
|
207 |
\begin{lstlisting}
|
|
208 |
M = modified |
|
209 |
A = added |
|
210 |
R = removed |
|
211 |
C = clean |
|
212 |
! = missing |
|
213 |
? = not tracked |
|
214 |
I = ignored |
|
215 |
\end{lstlisting}
|
|
216 |
\end{frame}
|
|
217 |
||
218 |
\begin{frame}
|
|
219 |
\frametitle{Adding files}
|
|
220 |
\begin{itemize}
|
|
221 |
\item From \typ{hg status} we know, none of the files are being
|
|
222 |
tracked, yet. |
|
223 |
\item \typ{hg add} --- asking \typ{hg} to track these files
|
|
|
143
fde473906aac
vcs: Mention hg remove command.
Puneeth Chaganti <punchagan@fossee.in>
parents:
138
diff
changeset
|
224 |
\item As expected \typ{hg status} prepends an \typ{A} to the file
|
|
fde473906aac
vcs: Mention hg remove command.
Puneeth Chaganti <punchagan@fossee.in>
parents:
138
diff
changeset
|
225 |
names. |
|
fde473906aac
vcs: Mention hg remove command.
Puneeth Chaganti <punchagan@fossee.in>
parents:
138
diff
changeset
|
226 |
\item \typ{? --> A}
|
|
fde473906aac
vcs: Mention hg remove command.
Puneeth Chaganti <punchagan@fossee.in>
parents:
138
diff
changeset
|
227 |
\item \typ{! --> R} (\typ{hg remove})
|
| 138 | 228 |
\end{itemize}
|
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
229 |
\end{frame}
|
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
230 |
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
231 |
\begin{frame}
|
| 138 | 232 |
\frametitle{Taking Snapshots}
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
233 |
\begin{itemize}
|
| 138 | 234 |
\item \typ{hg commit}
|
235 |
\item Asking Mercurial to take a snapshot; remember the changes made |
|
236 |
to the repository. |
|
|
153
1e8b788a89b9
vcs: Add details about -u, -m parameters to commit
Puneeth Chaganti <punchagan@fossee.in>
parents:
145
diff
changeset
|
237 |
\item \typ{-u FirstName LastName <email>}
|
|
1e8b788a89b9
vcs: Add details about -u, -m parameters to commit
Puneeth Chaganti <punchagan@fossee.in>
parents:
145
diff
changeset
|
238 |
\item \typ{-m ``Commit message''} -- a description of changes committed.
|
| 138 | 239 |
\end{itemize}
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
240 |
\end{frame}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
241 |
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
242 |
\begin{frame}
|
| 138 | 243 |
\frametitle{Thumbnail views}
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
244 |
\begin{itemize}
|
| 138 | 245 |
\item \typ{hg log}~ gives the log of the changes made
|
246 |
\item A \typ{changeset} is an atomic collection of changes to the
|
|
247 |
files (between successive commits) |
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
248 |
\end{itemize}
|
| 138 | 249 |
\begin{block}{Log information}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
250 |
\begin{itemize}
|
| 138 | 251 |
\item \alert{changeset}: Identifiers for the changeset
|
252 |
\item \alert{user}: Details of user who created the changeset
|
|
253 |
\item \alert{date}: Date and time of creation
|
|
254 |
\item \alert{summary}: One line description
|
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
255 |
\end{itemize}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
256 |
\end{block}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
257 |
\end{frame}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
258 |
|
| 138 | 259 |
\begin{frame}
|
260 |
\frametitle{User information}
|
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
261 |
\begin{itemize}
|
| 138 | 262 |
\item User information is set in the \typ{hgrc} file
|
263 |
\item It can be set globally or local to the project |
|
264 |
\item Global \typ{hgrc}
|
|
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
265 |
\begin{itemize}
|
| 138 | 266 |
\item \typ{\$HOME/.hgrc} -- Unix like systems
|
267 |
\item \typ{\%HOME\%\\.hgrc} -- Windows
|
|
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
268 |
\end{itemize}
|
|
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
269 |
\end{itemize}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
270 |
\end{frame}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
271 |
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
272 |
\begin{frame}
|
| 138 | 273 |
\frametitle{\alert{Advice}: \typ{commits}, messages}
|
274 |
\begin{itemize}
|
|
275 |
\item Atomic changes; one change with one \typ{commit}
|
|
276 |
\item Single line summary --- 60 to 65 characters long |
|
277 |
\item Followed by paragraphs of detailed description |
|
278 |
\begin{itemize}
|
|
279 |
\item Why the change? |
|
280 |
\item What does it effect? |
|
281 |
\item Known bugs/issues? |
|
282 |
\item etc. |
|
283 |
\end{itemize}
|
|
284 |
\end{itemize}
|
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
285 |
\end{frame}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
286 |
|
| 138 | 287 |
\section{But Why \typ{commit}~?}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
288 |
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
289 |
\begin{frame}
|
| 138 | 290 |
\frametitle{Operational overhead?}
|
291 |
\begin{itemize}
|
|
292 |
\item But why do we \typ{commit}
|
|
293 |
\item Isn't all this just adding to operational costs? |
|
294 |
\item Isn't all this a waste of time? |
|
295 |
\end{itemize}
|
|
296 |
\begin{center}
|
|
297 |
\emphbar{No! You shall see the benefits, soon!}
|
|
298 |
\end{center}
|
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
299 |
\end{frame}
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
300 |
|
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
301 |
\begin{frame}
|
| 138 | 302 |
\frametitle{Revert Changes}
|
303 |
\begin{itemize}
|
|
304 |
\item Undo all changes; the editor can only do so much. |
|
305 |
\item \typ{hg revert --all}
|
|
306 |
\item \typ{hg revert filename}
|
|
307 |
\item Present file, with changes --- \typ{filename.orig}
|
|
308 |
\end{itemize}
|
|
309 |
\end{frame}
|
|
310 |
||
311 |
\begin{frame}[fragile]
|
|
312 |
\frametitle{Viewing Changes}
|
|
313 |
\begin{itemize}
|
|
314 |
\item \typ{hg diff} --- all changes since last commit
|
|
315 |
\end{itemize}
|
|
316 |
\begin{block}{}
|
|
317 |
\begin{lstlisting}
|
|
318 |
- this line was deleted |
|
319 |
+ this line was added |
|
320 |
\end{lstlisting}
|
|
321 |
\end{block}
|
|
322 |
\end{frame}
|
|
323 |
||
324 |
||
325 |
\begin{frame}[fragile]
|
|
326 |
\frametitle{Revision numbering}
|
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
327 |
\begin{itemize}
|
| 138 | 328 |
\item \typ{changeset: n:cbf6e2a375b4}
|
329 |
\item \typ{n} is the revision number
|
|
330 |
\item The revision number is local to a repository |
|
331 |
\item \typ{cbf6e2a375b4} is the unique identifier
|
|
332 |
\end{itemize}
|
|
333 |
\end{frame}
|
|
334 |
||
335 |
\begin{frame}[fragile]
|
|
336 |
\frametitle{Using revision numbers}
|
|
337 |
\begin{itemize}
|
|
338 |
\item \typ{-r n} can be passed as arguments to commands to specify
|
|
339 |
the revision number |
|
|
156
8f4806a1a64d
vcs: Remove all mention of use of -ve revision numbering.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
340 |
\item For instance, \typ{hg diff -r1 -r2}
|
| 138 | 341 |
\item \typ{m:n} specifies a range of revision numbers
|
|
156
8f4806a1a64d
vcs: Remove all mention of use of -ve revision numbering.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
342 |
\item For instance, \typ{hg log -r0:2}
|
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
343 |
\end{itemize}
|
| 138 | 344 |
\end{frame}
|
345 |
||
346 |
\section{Collaborating with Mercurial}
|
|
347 |
\begin{frame}[fragile]
|
|
348 |
\frametitle{Cloning Repositories}
|
|
349 |
\begin{itemize}
|
|
350 |
\item \typ{hg clone SOURCE [DEST]}
|
|
351 |
\item All \typ{hg} repositories are self-contained
|
|
352 |
\end{itemize}
|
|
353 |
\end{frame}
|
|
354 |
||
355 |
\begin{frame}[fragile]
|
|
356 |
\frametitle{Sharing Repositories}
|
|
357 |
\begin{itemize}
|
|
358 |
\item \typ{hg serve}
|
|
359 |
\item Can be cloned with \typ{hg clone http://my-ip-address:8000}
|
|
360 |
\item We share a central repository; work on our local copies. |
|
361 |
\item Set write permissions in \typ{.hg/hgrc}
|
|
362 |
\end{itemize}
|
|
363 |
\begin{lstlisting}
|
|
364 |
[web] |
|
365 |
push_ssl=False |
|
366 |
allow_push=* |
|
367 |
\end{lstlisting}
|
|
|
78
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
368 |
\end{frame}
|
|
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
369 |
|
|
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
370 |
\begin{frame}
|
| 138 | 371 |
\frametitle{Sharing Changes}
|
372 |
\begin{itemize}
|
|
373 |
\item Use \typ{hg push} to push your \typ{commits}
|
|
374 |
(\typ{changesets}) to the central repository
|
|
375 |
\end{itemize}
|
|
376 |
\end{frame}
|
|
377 |
||
378 |
||
379 |
\begin{frame}
|
|
380 |
\frametitle{Pulling Changes}
|
|
381 |
\begin{itemize}
|
|
382 |
\item \typ{hg incoming} shows new \typ{changesets} in the server
|
|
383 |
\item To get these \typ{changesets}, we use \typ{hg pull}
|
|
384 |
\item These changes do not affect our working directory |
|
385 |
\item \typ{hg parent} shows the parents of the working directory
|
|
386 |
\end{itemize}
|
|
387 |
\end{frame}
|
|
388 |
||
389 |
\begin{frame}
|
|
390 |
\frametitle{Pulling Changes \ldots}
|
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
391 |
\begin{itemize}
|
| 138 | 392 |
\item \typ{hg update} will update the working directory
|
393 |
\begin{itemize}
|
|
394 |
\item Updates to the \typ{tip} if no revision is specified
|
|
395 |
\item \typ{tip} is the most recently added changeset
|
|
396 |
\item Can specify revision number to update to |
|
397 |
\end{itemize}
|
|
398 |
\item \typ{hg tip} shows the \typ{tip} of the repository
|
|
399 |
\end{itemize}
|
|
400 |
\end{frame}
|
|
401 |
||
402 |
\begin{frame}
|
|
403 |
\frametitle{Simultaneous Changes}
|
|
404 |
\begin{itemize}
|
|
405 |
\item The logs of both repositories will be different |
|
406 |
\item The repositories have diverged |
|
407 |
\item \typ{hg push} fails, in such a scenario
|
|
408 |
\item \alert{Never, Never, Never, Ever} use \typ{hg push -f}
|
|
409 |
\end{itemize}
|
|
410 |
\end{frame}
|
|
411 |
||
412 |
\begin{frame}
|
|
413 |
\frametitle{Merging}
|
|
414 |
\begin{itemize}
|
|
415 |
\item Pull and merge, when \typ{abort: push creates new remote
|
|
416 |
heads!} |
|
417 |
\item \typ{hg merge} will merge the two diverged heads
|
|
418 |
\item \typ{commit} after you have \typ{merged}!
|
|
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
419 |
\end{itemize}
|
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
420 |
\end{frame}
|
| 138 | 421 |
|
422 |
\begin{frame}
|
|
423 |
\frametitle{Simultaneous Changes \ldots}
|
|
424 |
\begin{itemize}
|
|
425 |
\item \typ{outgoing} shows the \typ{changesets} that will be pushed
|
|
426 |
\item \typ{hg push} works!
|
|
427 |
\item Look at the `Change graph'! |
|
428 |
\end{itemize}
|
|
429 |
\end{frame}
|
|
430 |
||
431 |
\begin{frame}
|
|
432 |
\frametitle{Simultaneous Conflicting Changes}
|
|
433 |
\begin{itemize}
|
|
434 |
\item What if the changes conflict? -- overlapping edits |
|
435 |
\item \typ{hg push} fails; \typ{hg pull}; \typ{hg merge}
|
|
436 |
\item You now get a diff view with 3 panes |
|
437 |
\begin{itemize}
|
|
438 |
\item First --- current file |
|
|
145
48747fbfe47a
vcs: Fix errors in slides, after class.
Puneeth Chaganti <punchagan@fossee.in>
parents:
144
diff
changeset
|
439 |
\item Second --- \typ{changesets} that you pulled
|
|
48747fbfe47a
vcs: Fix errors in slides, after class.
Puneeth Chaganti <punchagan@fossee.in>
parents:
144
diff
changeset
|
440 |
\item Third --- file before you made your changes |
| 138 | 441 |
\end{itemize}
|
442 |
\item Resolve conflict and save |
|
443 |
\item \typ{hg commit}; \typ{hg push}
|
|
444 |
\item Look at the `Change graph'! |
|
445 |
\end{itemize}
|
|
446 |
\end{frame}
|
|
447 |
||
448 |
\section{Conclusion}
|
|
449 |
||
450 |
\begin{frame}
|
|
451 |
\frametitle{\alert{Advice}: Work-flow}
|
|
452 |
General work-flow |
|
453 |
\begin{itemize}
|
|
454 |
\item \typ{pull}; \typ{update}
|
|
455 |
\item Make changes |
|
456 |
\item \typ{commit}
|
|
457 |
\item If changes on repo, \typ{pull} and \typ{merge}
|
|
458 |
\item \typ{push}
|
|
459 |
\end{itemize}
|
|
460 |
\emphbar{Commit Early, Commit Often}
|
|
461 |
\end{frame}
|
|
462 |
||
463 |
\begin{frame}
|
|
464 |
\frametitle{References}
|
|
465 |
\begin{itemize}
|
|
466 |
\item \href{http://betterexplained.com/articles/a-visual-guide-to-version-control/}{A Visual Guide to Version Control}
|
|
467 |
\item \href{http://karlagius.com/2009/01/09/version-control-for-the-masses/}{Version Control for the Masses}
|
|
468 |
\item \href{http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/}{(Illustrated) Intro to Distributed Version Control}
|
|
469 |
\item \href{http://mercurial.selenic.com/wiki/UnderstandingMercurial}{Understanding Mercurial}
|
|
470 |
\item \href{http://mercurial.selenic.com/wiki/Tutorial}{A Tutorial on Using Mercurial}
|
|
471 |
\item \href{http://hginit.com/}{Hg Init: a Mercurial tutorial}
|
|
472 |
\item \href{http://mercurial.selenic.com/wiki/BeginnersGuides}{Beginners Guides}
|
|
473 |
\item \href{http://software-carpentry.org/4_0/vc/}{Software Carpentry}
|
|
474 |
\end{itemize}
|
|
475 |
\end{frame}
|
|
476 |
||
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
477 |
\end{document}
|
|
79
d6dd6541a887
Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents:
78
diff
changeset
|
478 |