author | Puneeth Chaganti <punchagan@fossee.in> |
Sun, 30 Jan 2011 20:15:30 +0530 | |
changeset 145 | 48747fbfe47a |
parent 144 | c592f2304cff |
child 153 | 1e8b788a89b9 |
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. |
|
237 |
\item Commit message is a description of the changes made. |
|
238 |
\end{itemize} |
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
239 |
\end{frame} |
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
240 |
|
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
241 |
\begin{frame} |
138 | 242 |
\frametitle{Thumbnail views} |
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
243 |
\begin{itemize} |
138 | 244 |
\item \typ{hg log}~ gives the log of the changes made |
245 |
\item A \typ{changeset} is an atomic collection of changes to the |
|
246 |
files (between successive commits) |
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
247 |
\end{itemize} |
138 | 248 |
\begin{block}{Log information} |
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
249 |
\begin{itemize} |
138 | 250 |
\item \alert{changeset}: Identifiers for the changeset |
251 |
\item \alert{user}: Details of user who created the changeset |
|
252 |
\item \alert{date}: Date and time of creation |
|
253 |
\item \alert{summary}: One line description |
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
254 |
\end{itemize} |
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
255 |
\end{block} |
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
256 |
\end{frame} |
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
257 |
|
138 | 258 |
\begin{frame} |
259 |
\frametitle{User information} |
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
260 |
\begin{itemize} |
138 | 261 |
\item User information is set in the \typ{hgrc} file |
262 |
\item It can be set globally or local to the project |
|
263 |
\item Global \typ{hgrc} |
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
264 |
\begin{itemize} |
138 | 265 |
\item \typ{\$HOME/.hgrc} -- Unix like systems |
266 |
\item \typ{\%HOME\%\\.hgrc} -- Windows |
|
83
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
267 |
\end{itemize} |
c52c9a615356
Added suggestions from Amit and Anoop and some images.
Shantanu <shantanu@fossee.in>
parents:
81
diff
changeset
|
268 |
\end{itemize} |
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
269 |
\end{frame} |
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
270 |
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
271 |
\begin{frame} |
138 | 272 |
\frametitle{\alert{Advice}: \typ{commits}, messages} |
273 |
\begin{itemize} |
|
274 |
\item Atomic changes; one change with one \typ{commit} |
|
275 |
\item Single line summary --- 60 to 65 characters long |
|
276 |
\item Followed by paragraphs of detailed description |
|
277 |
\begin{itemize} |
|
278 |
\item Why the change? |
|
279 |
\item What does it effect? |
|
280 |
\item Known bugs/issues? |
|
281 |
\item etc. |
|
282 |
\end{itemize} |
|
283 |
\end{itemize} |
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
284 |
\end{frame} |
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
285 |
|
138 | 286 |
\section{But Why \typ{commit}~?} |
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
287 |
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
288 |
\begin{frame} |
138 | 289 |
\frametitle{Operational overhead?} |
290 |
\begin{itemize} |
|
291 |
\item But why do we \typ{commit} |
|
292 |
\item Isn't all this just adding to operational costs? |
|
293 |
\item Isn't all this a waste of time? |
|
294 |
\end{itemize} |
|
295 |
\begin{center} |
|
296 |
\emphbar{No! You shall see the benefits, soon!} |
|
297 |
\end{center} |
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
298 |
\end{frame} |
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
299 |
|
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
300 |
\begin{frame} |
138 | 301 |
\frametitle{Revert Changes} |
302 |
\begin{itemize} |
|
303 |
\item Undo all changes; the editor can only do so much. |
|
304 |
\item \typ{hg revert --all} |
|
305 |
\item \typ{hg revert filename} |
|
306 |
\item Present file, with changes --- \typ{filename.orig} |
|
307 |
\end{itemize} |
|
308 |
\end{frame} |
|
309 |
||
310 |
\begin{frame}[fragile] |
|
311 |
\frametitle{Viewing Changes} |
|
312 |
\begin{itemize} |
|
313 |
\item \typ{hg diff} --- all changes since last commit |
|
314 |
\end{itemize} |
|
315 |
\begin{block}{} |
|
316 |
\begin{lstlisting} |
|
317 |
- this line was deleted |
|
318 |
+ this line was added |
|
319 |
\end{lstlisting} |
|
320 |
\end{block} |
|
321 |
\end{frame} |
|
322 |
||
323 |
||
324 |
\begin{frame}[fragile] |
|
325 |
\frametitle{Revision numbering} |
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
326 |
\begin{itemize} |
138 | 327 |
\item \typ{changeset: n:cbf6e2a375b4} |
328 |
\item \typ{n} is the revision number |
|
329 |
\item The revision number is local to a repository |
|
330 |
\item \typ{cbf6e2a375b4} is the unique identifier |
|
331 |
\end{itemize} |
|
332 |
\end{frame} |
|
333 |
||
334 |
\begin{frame}[fragile] |
|
335 |
\frametitle{Using revision numbers} |
|
336 |
\begin{itemize} |
|
337 |
\item \typ{-r n} can be passed as arguments to commands to specify |
|
338 |
the revision number |
|
339 |
\item For instance, \typ{hg log -r0} |
|
340 |
\item \typ{m:n} specifies a range of revision numbers |
|
341 |
\item \typ{-1} gives the \typ{tip}; Negative numbering can be used |
|
91
6f2f2f949e32
Done more changes to version control presentation.
Shantanu <shantanu@fossee.in>
parents:
84
diff
changeset
|
342 |
\end{itemize} |
138 | 343 |
\end{frame} |
344 |
||
345 |
\section{Collaborating with Mercurial} |
|
346 |
\begin{frame}[fragile] |
|
347 |
\frametitle{Cloning Repositories} |
|
348 |
\begin{itemize} |
|
349 |
\item \typ{hg clone SOURCE [DEST]} |
|
350 |
\item All \typ{hg} repositories are self-contained |
|
351 |
\end{itemize} |
|
352 |
\end{frame} |
|
353 |
||
354 |
\begin{frame}[fragile] |
|
355 |
\frametitle{Sharing Repositories} |
|
356 |
\begin{itemize} |
|
357 |
\item \typ{hg serve} |
|
358 |
\item Can be cloned with \typ{hg clone http://my-ip-address:8000} |
|
359 |
\item We share a central repository; work on our local copies. |
|
360 |
\item Set write permissions in \typ{.hg/hgrc} |
|
361 |
\end{itemize} |
|
362 |
\begin{lstlisting} |
|
363 |
[web] |
|
364 |
push_ssl=False |
|
365 |
allow_push=* |
|
366 |
\end{lstlisting} |
|
78
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
367 |
\end{frame} |
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
368 |
|
216f6670abfd
Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents:
77
diff
changeset
|
369 |
\begin{frame} |
138 | 370 |
\frametitle{Sharing Changes} |
371 |
\begin{itemize} |
|
372 |
\item Use \typ{hg push} to push your \typ{commits} |
|
373 |
(\typ{changesets}) to the central repository |
|
374 |
\end{itemize} |
|
375 |
\end{frame} |
|
376 |
||
377 |
||
378 |
\begin{frame} |
|
379 |
\frametitle{Pulling Changes} |
|
380 |
\begin{itemize} |
|
381 |
\item \typ{hg incoming} shows new \typ{changesets} in the server |
|
382 |
\item To get these \typ{changesets}, we use \typ{hg pull} |
|
383 |
\item These changes do not affect our working directory |
|
384 |
\item \typ{hg parent} shows the parents of the working directory |
|
385 |
\end{itemize} |
|
386 |
\end{frame} |
|
387 |
||
388 |
\begin{frame} |
|
389 |
\frametitle{Pulling Changes \ldots} |
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
390 |
\begin{itemize} |
138 | 391 |
\item \typ{hg update} will update the working directory |
392 |
\begin{itemize} |
|
393 |
\item Updates to the \typ{tip} if no revision is specified |
|
394 |
\item \typ{tip} is the most recently added changeset |
|
395 |
\item Can specify revision number to update to |
|
396 |
\end{itemize} |
|
397 |
\item \typ{hg tip} shows the \typ{tip} of the repository |
|
398 |
\end{itemize} |
|
399 |
\end{frame} |
|
400 |
||
401 |
\begin{frame} |
|
402 |
\frametitle{Simultaneous Changes} |
|
403 |
\begin{itemize} |
|
404 |
\item The logs of both repositories will be different |
|
405 |
\item The repositories have diverged |
|
406 |
\item \typ{hg push} fails, in such a scenario |
|
407 |
\item \alert{Never, Never, Never, Ever} use \typ{hg push -f} |
|
408 |
\end{itemize} |
|
409 |
\end{frame} |
|
410 |
||
411 |
\begin{frame} |
|
412 |
\frametitle{Merging} |
|
413 |
\begin{itemize} |
|
414 |
\item Pull and merge, when \typ{abort: push creates new remote |
|
415 |
heads!} |
|
416 |
\item \typ{hg merge} will merge the two diverged heads |
|
417 |
\item \typ{commit} after you have \typ{merged}! |
|
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
418 |
\end{itemize} |
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
419 |
\end{frame} |
138 | 420 |
|
421 |
\begin{frame} |
|
422 |
\frametitle{Simultaneous Changes \ldots} |
|
423 |
\begin{itemize} |
|
424 |
\item \typ{outgoing} shows the \typ{changesets} that will be pushed |
|
425 |
\item \typ{hg push} works! |
|
426 |
\item Look at the `Change graph'! |
|
427 |
\end{itemize} |
|
428 |
\end{frame} |
|
429 |
||
430 |
\begin{frame} |
|
431 |
\frametitle{Simultaneous Conflicting Changes} |
|
432 |
\begin{itemize} |
|
433 |
\item What if the changes conflict? -- overlapping edits |
|
434 |
\item \typ{hg push} fails; \typ{hg pull}; \typ{hg merge} |
|
435 |
\item You now get a diff view with 3 panes |
|
436 |
\begin{itemize} |
|
437 |
\item First --- current file |
|
145
48747fbfe47a
vcs: Fix errors in slides, after class.
Puneeth Chaganti <punchagan@fossee.in>
parents:
144
diff
changeset
|
438 |
\item Second --- \typ{changesets} that you pulled |
48747fbfe47a
vcs: Fix errors in slides, after class.
Puneeth Chaganti <punchagan@fossee.in>
parents:
144
diff
changeset
|
439 |
\item Third --- file before you made your changes |
138 | 440 |
\end{itemize} |
441 |
\item Resolve conflict and save |
|
442 |
\item \typ{hg commit}; \typ{hg push} |
|
443 |
\item Look at the `Change graph'! |
|
444 |
\end{itemize} |
|
445 |
\end{frame} |
|
446 |
||
447 |
\section{Conclusion} |
|
448 |
||
449 |
\begin{frame} |
|
450 |
\frametitle{\alert{Advice}: Work-flow} |
|
451 |
General work-flow |
|
452 |
\begin{itemize} |
|
453 |
\item \typ{pull}; \typ{update} |
|
454 |
\item Make changes |
|
455 |
\item \typ{commit} |
|
456 |
\item If changes on repo, \typ{pull} and \typ{merge} |
|
457 |
\item \typ{push} |
|
458 |
\end{itemize} |
|
459 |
\emphbar{Commit Early, Commit Often} |
|
460 |
\end{frame} |
|
461 |
||
462 |
\begin{frame} |
|
463 |
\frametitle{References} |
|
464 |
\begin{itemize} |
|
465 |
\item \href{http://betterexplained.com/articles/a-visual-guide-to-version-control/}{A Visual Guide to Version Control} |
|
466 |
\item \href{http://karlagius.com/2009/01/09/version-control-for-the-masses/}{Version Control for the Masses} |
|
467 |
\item \href{http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/}{(Illustrated) Intro to Distributed Version Control} |
|
468 |
\item \href{http://mercurial.selenic.com/wiki/UnderstandingMercurial}{Understanding Mercurial} |
|
469 |
\item \href{http://mercurial.selenic.com/wiki/Tutorial}{A Tutorial on Using Mercurial} |
|
470 |
\item \href{http://hginit.com/}{Hg Init: a Mercurial tutorial} |
|
471 |
\item \href{http://mercurial.selenic.com/wiki/BeginnersGuides}{Beginners Guides} |
|
472 |
\item \href{http://software-carpentry.org/4_0/vc/}{Software Carpentry} |
|
473 |
\end{itemize} |
|
474 |
\end{frame} |
|
475 |
||
77
708e1f6a9a89
Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff
changeset
|
476 |
\end{document} |
79
d6dd6541a887
Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents:
78
diff
changeset
|
477 |