versionControl/vcs.tex
author Shantanu <shantanu@fossee.in>
Thu, 21 Jan 2010 15:49:34 +0530
changeset 82 1d623f8d52a3
parent 81 3d20090b7cbd
child 83 c52c9a615356
permissions -rw-r--r--
add hgignore file.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    30
\lstset{language=Python,
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
%%% This is from Fernando's setup.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    54
% \usepackage{color}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    55
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    56
% % Use and configure listings package for nicely formatted code
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    57
% \usepackage{listings}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    58
% \lstset{
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    59
%    language=Python,
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    60
%    basicstyle=\small\ttfamily,
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    61
%    commentstyle=\ttfamily\color{blue},
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    62
%    stringstyle=\ttfamily\color{orange},
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    63
%    showstringspaces=false,
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    64
%    breaklines=true,
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    65
%    postbreak = \space\dots
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    66
% }
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
% Title page
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    70
\title[Version Control Systems]{SEES: Version Control Systems}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    71
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    72
\author[FOSSEE] {FOSSEE}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    73
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    74
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    75
\date[]{}
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
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    78
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    79
%\logo{\pgfuseimage{iitmlogo}}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    80
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    81
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    82
%% Delete this, if you do not want the table of contents to pop up at
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    83
%% the beginning of each subsection:
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    84
\AtBeginSubsection[]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    85
{
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    86
  \begin{frame}<beamer>
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    87
    \frametitle{Outline}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    88
    \tableofcontents[currentsection,currentsubsection]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    89
  \end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    90
}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    91
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    92
\AtBeginSection[]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    93
{
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    94
  \begin{frame}<beamer>
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    95
    \frametitle{Outline}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    96
    \tableofcontents[currentsection,currentsubsection]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    97
  \end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    98
}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    99
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   100
% If you wish to uncover everything in a step-wise fashion, uncomment
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   101
% the following command: 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   102
%\beamerdefaultoverlayspecification{<+->}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   103
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   104
%%\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   105
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   106
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   107
% DOCUMENT STARTS
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   108
\begin{document}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   109
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   110
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   111
  \maketitle
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   112
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   113
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   114
% CREATING TOC 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   115
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   116
  \frametitle{Outline}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   117
  \tableofcontents
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   118
  % You might wish to add the option [pausesections]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   119
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   120
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   121
%% There are some %$ used just to minimise the effect of $ sign used in lstlisting. In emacs it looks unhealthy.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   122
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   123
% 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
   124
\section{Introduction}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   125
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   126
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   127
  \frametitle{What is Version Control?}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   128
  \begin{block}{From a blog post}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   129
    ``Version control (or source control) is nothing more arcane than keeping copies of ones work as one make changes to it.''
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   130
  \end{block}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   131
  \pause
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   132
  \begin{block}{}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   133
    It is better to use these tools rather then wasting creativity to invent VCS which have files with names like \begin{color}{red}{prog1.py, prog2.py}\end{color} or \begin{color}{red}prog-old.py, prog.py.\end{color}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   134
  \end{block}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   135
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   136
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   137
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   138
  \frametitle{Motivation behind such tools}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   139
  \begin{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   140
  \item Track the history and evolution of a program.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   141
  \item To collaborate effectively on a project.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   142
  \item \begin{color}{red}``To err is Human''\end{color} \pause for recovery we have ``Version Control''
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   143
  \end{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   144
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   145
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   146
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   147
  \frametitle{How is done What is done?}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   148
  \begin{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   149
  \item It keeps track of changes you make to a file. You can improvise, revisit, and amend.
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   150
  \item All procedure is logged/recorded, so you and others can follow the development cycle.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   151
  \end{itemize}  
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   152
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   153
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   154
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   155
  \frametitle{Do we really need this?}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   156
  \emphbar{For team of people working remotely(even different computers/machines) on a project, use of version control is inevitable!}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   157
  \vspace{0.15in}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   158
  \emphbar{For single person: managing projects and assignments becomes easy}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   159
  \vspace{0.15in}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   160
  \pause
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   161
  \emphbar{\color{red}{It is a good habit!}}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   162
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   163
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   164
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   165
  \frametitle{Whats on the menu!}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   166
  \begin{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   167
  \item cvs (Concurrent Version System)
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   168
  \item svn (Subversion)
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   169
  \item hg (Mercurial)
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   170
  \item bzr (Bazaar)
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   171
  \item git
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   172
  \end{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   173
  \inctime{10}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   174
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   175
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   176
% Introduction to jargons 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   177
\section{Learning the Lingo!}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   178
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   179
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   180
  \frametitle{Common jargons: Basic setup}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   181
  \begin{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   182
  \item Repository(repo):\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   183
        The folder with all files.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   184
  \item Server:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   185
        Machine with main inventory/repo.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   186
  \item Client:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   187
        Local machines with copy of main repo.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   188
  \end{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   189
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   190
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   191
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   192
  \frametitle{Actions}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   193
  \begin{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   194
  \item Add:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   195
    Adding file into the repo for the first time.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   196
  \item Version:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   197
    Version number of a file.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   198
  \item Head/Tip:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   199
    The latest revision of the repo.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   200
  \item Check out/Clone:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   201
    Initial download of repo onto machine.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   202
  \item Commit:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   203
    Recording a change.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   204
  \item Change log/History:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   205
    List of changes made to repo.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   206
  \end{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   207
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   208
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   209
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   210
  \frametitle{Actions cont...}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   211
  \begin{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   212
  \item Branch:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   213
    Separate local copy of repo for bug fixing, testing.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   214
  \item Diff/Change:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   215
    Finding the differences in a file in two versions.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   216
  \item Merge (or patch):\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   217
    Apply the changes to file, to make it up-to-date.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   218
  \item Conflict:\\
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   219
    When merging a file is not obvious.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   220
  \item Resolve:\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   221
    Fixing the conflict manually.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   222
  \end{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   223
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   224
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   225
% Types of Version Controls
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   226
\section{Types of VCS}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   227
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   228
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   229
  \frametitle{Types:}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   230
  Based on way of managing the repo there are two types of VCS:
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   231
  \begin{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   232
  \item Centralized VCS\\
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   233
    cvs, svn falls under this category.
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   234
  \item Distributed VCS\\
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   235
    hg, bzr, git follows this methodology.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   236
  \end{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   237
  \emphbar{We would be covering \typ{hg}}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   238
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   239
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   240
\begin{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   241
  \frametitle{Why hg?}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   242
    \includegraphics[height=.75in, interpolate=true]{mercurial}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   243
  \begin{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   244
  \item Easy to learn and use.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   245
  \item Lightweight.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   246
  \item Scales excellently.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   247
  \item Based on Python.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   248
  \end{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   249
  \inctime{10}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   250
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   251
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   252
% Initializing the repo, cloning, committing changes, pushing, pulling to repo.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   253
\section{Getting Started}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   254
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   255
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   256
  \frametitle{Getting comfortable:}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   257
  For checking \typ{hg} installation and its version try:
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   258
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   259
    $ hg version    
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   260
  \end{lstlisting}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   261
  To get broad help on \typ{hg} and commands available:
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   262
  \begin{lstlisting}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   263
    $ man hg
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   264
    $ hg help
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   265
  \end{lstlisting}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   266
  To get help on particular \typ{hg} related option try:
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   267
  \begin{lstlisting}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   268
    $ hg help diff
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   269
  \end{lstlisting} %$
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   270
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   271
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   272
\begin{frame}[fragile]
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   273
  \frametitle{Getting working/existing code base}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   274
  \typ{clone} is used to make a copy of an existing repository. It can be both local or remote.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   275
  \begin{lstlisting}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   276
$ hg clone 
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   277
  http://hg.serpentine.com/tutorial/hello 
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   278
  localCopyhello
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   279
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   280
  And we get a local copy of this repository. 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   281
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   282
$ ls localCopyhello/
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   283
hello.c  Makefile
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   284
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   285
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   286
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   287
\begin{frame}[fragile]
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   288
  \frametitle{To start track-record on existing files}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   289
  I have some files which I want to bring under version control. \typ{hg} provides \typ{init} command for this: 
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   290
  \begin{lstlisting}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   291
$ ls -a circulate/
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   292
.  ..  lena.png  pendulum.txt  points.txt  pos.txt  sslc1.py  sslc1.txt
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   293
$ cd circulate/
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   294
$ hg init
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   295
$ ls -a
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   296
.  ..  .hg  lena.png  pendulum.txt  points.txt  pos.txt  sslc1.py  sslc1.txt    
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   297
  \end{lstlisting}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   298
  \emphbar{\typ{.hg} directory keeps log of changes made henceforth.}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   299
\end{frame}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   300
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   301
\begin{frame}[fragile]
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   302
  \frametitle{Starting fresh}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   303
  We can use \typ{init} to start a new repository also
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   304
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   305
$ mkdir Fevicol
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   306
$ cd Fevicol/
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   307
$ echo "print 'Yeh Fevicol ka majboot 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   308
              jod hai'" > feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   309
$ ls -a
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   310
.  ..  feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   311
$ hg init
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   312
$ ls -a
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   313
.  ..  feviStick.py  .hg
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   314
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   315
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   316
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   317
\begin{frame}[fragile]
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   318
  \frametitle{Making copies: Branching}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   319
  All \typ{hg} repositories are self-contained, and independent which can be copied(cloned):
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   320
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   321
$ hg clone localCopyhello newCopy
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   322
updating working directory
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   323
2 files updated, 0 files merged, 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   324
0 files removed, 0 files unresolved
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   325
  \end{lstlisting}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   326
  or
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   327
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   328
$ hg clone Fevicol Fevicol-pull
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   329
updating working directory
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   330
0 files updated, 0 files merged, 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   331
0 files removed, 0 files unresolved
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   332
  \end{lstlisting}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   333
  \inctime{15}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   334
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   335
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   336
%% Should we here stress on how are distribute VCS have 
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   337
%% different approach then centralized ones? Maybe a pic
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   338
%% or some other graphical representation.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   339
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   340
%% Introduction to how logs are managed in VCS.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   341
%% A analogy in logs and day-to-day life?
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   342
\begin{frame}[fragile]
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   343
  \frametitle{How does it work?}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   344
  It can roughly be related to Computer/Video Games.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   345
  \begin{itemize}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   346
  \item We play games in stages.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   347
  \item We pass a stage/task- We save the game.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   348
  \item We resume playing from that point.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   349
  \item In-case we want to replay or revisit some particular stage, we have it saved.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   350
  \item Even we can change the course of play henceforth.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   351
  \end{itemize}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   352
\end{frame}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   353
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   354
\begin{frame}[fragile]
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   355
  \frametitle{Better way to say:}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   356
  \begin{center}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   357
    \includegraphics[height=2.5in,width=2.5in, interpolate=true]{mario}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   358
  \end{center}  
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   359
  \emphbar{\typ{hg} provides power to save and resume from a stage.}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   360
\end{frame}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   361
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   362
\begin{frame}[fragile]
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   363
  \frametitle{Revisiting saved points:history/logs}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   364
  In \typ{hg}, the difference between consecutive stages is termed as changeset.\\
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   365
  Once we have saved stages, we need a mechanism to review and access them, for that use \typ{log} command.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   366
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   367
$ cd localCopyhello
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   368
$ hg log    
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   369
  \end{lstlisting}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   370
\end{frame}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   371
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   372
\begin{frame}[fragile]
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   373
  \frametitle{Understanding output}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   374
  The output provides following information:
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   375
  \begin{itemize}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   376
  \item changeset: Identifiers for the changeset.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   377
  \item user: Person who created the changeset.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   378
  \item date: Date and time of creation of changeset.
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   379
  \item summary: One line description.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   380
  \end{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   381
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   382
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   383
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   384
  \frametitle{History/Logs cont...}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   385
  By default \typ{log} returns complete list of all changes. \\
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   386
  For selective view try:
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   387
\begin{lstlisting}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   388
$ hg log -r 3
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   389
$ hg log -r 2:4
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   390
\end{lstlisting}
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   391
  tip/latest changes can be seen via:
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   392
  \begin{lstlisting}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   393
$ hg tip    
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   394
  \end{lstlisting} %%$
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   395
  \inctime{10}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   396
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   397
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   398
\begin{frame}[fragile]
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   399
  \frametitle{Advancing through state:status}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   400
  We often need to add/delete some files from directory(repo). The structure keeps on evolving, and tools for handling them are needed.\\
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   401
  We will use the Fevicol repo we created earlier.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   402
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   403
$ cd Fevicol
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   404
$ hg log
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   405
$ hg st
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   406
? feviStick.py
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   407
  \end{lstlisting} %%$
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   408
  \typ{st} (aka status) is command to show changed files in the working directory.\\
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   409
\end{frame}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   410
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   411
\begin{frame}[fragile]
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   412
  \frametitle{Adding files}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   413
  "?" indicates that these file are aliens to track record.\\
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   414
  \typ{add} command is available to add new files to present structure.
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   415
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   416
$ hg add feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   417
$ hg st
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   418
A feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   419
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   420
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   421
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   422
\begin{frame}[fragile]
81
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   423
  \frametitle{Saving present stage: committing}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   424
  \emphbar{This is equivalent to completing tasks, before reaching a stage where you want to save.}
3d20090b7cbd Making changes according to need-to-know approach.
Shantanu <shantanu@fossee.in>
parents: 80
diff changeset
   425
  \typ{hg} uses \typ{ci}(aka \typ{commit}) command to save changes. So after adding file, we have to commit it also:
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   426
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   427
$ hg ci -u "Shantanu <shantanu@fossee.in>" 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   428
        -m "First commit."
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   429
$ hg log
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   430
changeset:   0:84f5e91f4de1
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   431
tag:         tip
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   432
user:        Shantanu <shantanu@fossee.in>
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   433
date:        Fri Aug 21 23:37:13 2009 +0530
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   434
summary:     First commit.    
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   435
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   436
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   437
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   438
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   439
  \frametitle{More basic operations}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   440
  \begin{lstlisting}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   441
$ hg cp feviStick.py pidiLite.py
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   442
$ hg rename pidiLite.py feviCol.py
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   443
$ hg st
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   444
A feviCol.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   445
$ hg ci -u "Shantanu <shantanu@fossee.in>" 
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   446
        -m "Added feviCol.py."
80
e5dcba8a6b13 More changes to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 79
diff changeset
   447
$ hg tip| grep summary 
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   448
summary:     Renamed feviStick.py.
80
e5dcba8a6b13 More changes to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 79
diff changeset
   449
  \end{lstlisting} %$
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   450
%% Other commands which can be handy are \typ{cp}, \typ{remove}, \typ{revert} etc.
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   451
  \inctime{10}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   452
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   453
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   454
% Introduction to concepts of branches, merging patch?
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   455
\section{Sharing and Collaborating}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   456
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   457
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   458
  \frametitle{Distributing changes}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   459
  As this repo is self-contained, hence changeset just created are local and are not propagated to previously cloned Fevicol-pull.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   460
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   461
$ hg pull 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   462
pulling from /home/baali/Fevicol
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   463
requesting all changes
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   464
adding changesets
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   465
adding manifests
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   466
adding file changes
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   467
added 2 changesets with 2 changes to 2 files
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   468
(run 'hg update' to get a working copy)
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   469
  \end{lstlisting} %$
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   470
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   471
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   472
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   473
  \frametitle{Pulling changesets cont...}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   474
  As pointed by previous command output, hg \typ{pull} does not(by default) update current directory. It just imports changesets. To add all these changesets one have to update using \typ{up} command:
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   475
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   476
$ cd Fevicol-pull
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   477
$ ls -a
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   478
.  ..  .hg
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   479
$ hg up
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   480
2 files updated, 0 files merged, 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   481
0 files removed, 0 files unresolved
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   482
$ ls -a
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   483
.  ..  feviCol.py  feviStick.py  .hg    
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   484
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   485
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   486
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   487
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   488
  \frametitle{Making changes across the repos}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   489
  \begin{lstlisting}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   490
$ Fevicol-clone/
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   491
  \end{lstlisting} %$
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   492
  Lets edit and correct the feviStick.py 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   493
\begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   494
$ echo "print 'Ab no more Chip Chip'" 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   495
        > feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   496
$ hg st
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   497
M feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   498
\end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   499
  'M' sign indicates that Mercurial has noticed change.\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   500
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   501
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   502
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   503
  \frametitle{Revisiting changes}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   504
To revisit changes made earlier use \typ{diff} command:
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   505
\begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   506
$ hg diff
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   507
diff -r a7912d45f47c feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   508
--- a/feviStick.py   Sun Aug 23 22:34:35 2009 +0530
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   509
+++ b/feviStick.py   Sun Aug 23 22:47:49 2009 +0530
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   510
@@ -1,1 +1,1 @@
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   511
-print 'Yeh Fevicol ka Majboot jod hai'
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   512
+print 'Ab no more Chip Chip'
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   513
  \end{lstlisting} %$
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   514
  These changes are not logged until you commit them.\\
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   515
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   516
$ hg ci -u "Shantanu <shantanu@fossee.in>" 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   517
      -m "Changed tagline for feviStick.py."
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   518
  \end{lstlisting} %$
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   519
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   520
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   521
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   522
  \frametitle{Syncing two repos}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   523
  Now to bring both the repos to same stage one have to \typ{push} changes.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   524
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   525
$ hg push 
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   526
pushing to /home/baali/Fevicol
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   527
searching for changes
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   528
adding changesets
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   529
adding manifests
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   530
adding file changes
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   531
added 1 changesets with 1 changes to 1 files
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   532
  \end{lstlisting} %$
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   533
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   534
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   535
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   536
\begin{frame}[fragile]
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   537
  \frametitle{Syncing cont...}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   538
  Same as pulling, pushing wont update the main repo by default. Try running following command:
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   539
  \begin{lstlisting}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   540
$ cd Fevicol
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   541
$ hg tip    
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   542
$ cat feviStick.py
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   543
  \end{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   544
  \typ{tip} shows latest changeset, but content of file are not updated. We have to use \typ{up} on main branch
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   545
  \begin{lstlisting}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   546
$ hg up
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   547
1 files updated, 0 files merged, 0 files removed, 0 files unresolved    
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   548
  \end{lstlisting} %$
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   549
  \inctime{15}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   550
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   551
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   552
\begin{frame}[fragile]
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   553
  \frametitle{Merging: Scenario}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   554
  One very useful feature is merging work of different peers working on same project.\\
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   555
  We consider scenario, two person on one project, both have local copies, and one among them is main branch.\\
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   556
  \begin{center}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   557
    \includegraphics[height=1in, interpolate=true]{scenario}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   558
  \end{center}  
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   559
\end{frame}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   560
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   561
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   562
\begin{frame}[fragile]
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   563
  \frametitle{Making changes to one of repo}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   564
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   565
$ cd Fevicol-pull
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   566
$ echo "print 'Yeh Fevicol ka Majboot jod 
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   567
        hai, tootega nahin'" > feviCol.py
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   568
$ hg st
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   569
M feviStick.py
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   570
$ hg ci -u "Shantanu <shantanu@fossee.in>" 
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   571
     -m "Updated tag line for feviCol.py."
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   572
$ hg tip| grep changeset
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   573
changeset:   4:caf986b15e05
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   574
  \end{lstlisting} %$
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   575
\end{frame}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   576
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   577
\begin{frame}[fragile]
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   578
  \frametitle{In the meanwhile, other repo is ...}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   579
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   580
$ cd Fevicol
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   581
$ echo "print 'Jor laga ke hayyiya'" 
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   582
        > firstAdd.py
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   583
$ hg add 
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   584
$ hg st
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   585
A firstAdd.py
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   586
$ hg ci -u "Shantanu <shantanu@fossee.in>"
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   587
        -m "Added firsAdd.py."
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   588
$ hg tip|grep changeset
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   589
changeset:   4:fadbd6492cc4    
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   590
  \end{lstlisting}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   591
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   592
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   593
\begin{frame}[fragile]
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   594
  \frametitle{Merging}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   595
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   596
$ hg pull ../Fevicol-pull
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   597
pulling from ../Fevicol-pull
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   598
searching for changes
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   599
adding changesets
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   600
adding manifests
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   601
adding file changes
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   602
added 1 changesets with 1 changes to 1 files (+1 heads)
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   603
(run 'hg heads' to see heads, 'hg merge' to merge)    
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   604
  \end{lstlisting} %$
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   605
  Output is already suggesting something!
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   606
\end{frame}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   607
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   608
%% Here one can mention the point of having push and pull separate. Because of this policy, changes made are not lost.
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   609
\begin{frame}[fragile]
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   610
  \frametitle{Analyzing events in detail}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   611
  Since hg \typ{pull} don't update the files directly, our changes are still safe. Following command can help us deal this merging problem in better way:
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   612
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   613
$ hg heads
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   614
  \end{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   615
  This commands shows repo/branch heads.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   616
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   617
$ hg glog    
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   618
  \end{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   619
  It shows revision history alongside an ASCII revision graph.\\
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   620
  Because of different track, \typ{up} command fails.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   621
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   622
$ hg up
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   623
abort: crosses branches (use 'hg merge' or 'hg update -C')
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   624
  \end{lstlisting} %$
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   625
\end{frame}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   626
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   627
\begin{frame}[fragile]
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   628
  \frametitle{Merging}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   629
  \typ{hg merge} command merge working directory with another revision.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   630
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   631
$ hg merge    
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   632
  \end{lstlisting} %$
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   633
  After merging two branches, we have to commit the results to create a common head.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   634
  \begin{lstlisting}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   635
$ hg ci -u "Shantanu <shantanu@fossee.in>" 
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   636
        -m "Merged branches."
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   637
$ hg heads    
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   638
$ hg glog
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   639
  \end{lstlisting} %$
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   640
  \inctime{15}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   641
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   642
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   643
% Steps to follow to make life easier. How to avoid/handle manual merges.
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   644
\section{Work flow: DOS and DON'Ts}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   645
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   646
\begin{frame}
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   647
  \frametitle{Motto behind hg}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   648
  \begin{center}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   649
  \color{red}{``Commit Early Commit Often.''}\\  
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   650
  \end{center}  
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   651
\end{frame}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   652
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   653
\begin{frame}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   654
  \frametitle{Cheat Sheet}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   655
  \begin{center}
80
e5dcba8a6b13 More changes to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 79
diff changeset
   656
  \includegraphics[height=2.8in]{mod}  
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   657
  \end{center}  
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   658
\end{frame}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   659
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   660
\begin{frame}
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   661
  \frametitle{Steps to be followed}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   662
  \begin{itemize}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   663
  \item Make changes.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   664
  \item Commit.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   665
  \item Pull changesets.
80
e5dcba8a6b13 More changes to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 79
diff changeset
   666
  \item Merge(if required).
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   667
  \item Push.
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   668
  \end{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   669
  \inctime{10}
78
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   670
\end{frame}
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   671
216f6670abfd Added merging part in VCS slides.
Shantanu <shantanu@fossee.in>
parents: 77
diff changeset
   672
\begin{frame}
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   673
  \frametitle{Suggested Readings:}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   674
  \begin{itemize}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   675
  \item \url{http://mercurial.selenic.com/guide/}
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   676
  \item \url{http://hgbook.red-bean.com/}    
77
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   677
  \item \url{http://karlagius.com/2009/01/09/version-control-for-the-masses/}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   678
  \item Articles related to version control available on \url{http://betterexplained.com/}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   679
  \item \url{http://en.wikipedia.org/wiki/Revision_control}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   680
  \item \url{http://wiki.alliedmods.net/Mercurial_Tutorial}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   681
  \end{itemize}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   682
\end{frame}
708e1f6a9a89 Created initial slides for VCS till merging.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   683
\end{document}
79
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   684
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   685
Notes
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   686
-----
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   687
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   688
From http://mercurial.selenic.com/
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   689
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   690
Quick Start
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   691
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   692
Clone a project and push changes
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   693
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   694
$ hg clone http://selenic.com/repo/hello
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   695
$ cd hello
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   696
$ (edit files)
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   697
$ hg add (new files)
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   698
$ hg commit -m 'My changes'
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   699
$ hg push
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   700
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   701
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   702
Create a project and commit
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   703
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   704
$ hg init (project-directory)
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   705
$ cd (project-directory)
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   706
$ (add some files)
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   707
$ hg add
d6dd6541a887 Added some images to VCS slides.
Shantanu <shantanu@fossee.in>
parents: 78
diff changeset
   708
$ hg commit -m 'Initial commit'