summaryrefslogtreecommitdiff
path: root/Version_Control/vcs1/vcs1.rst
blob: 306dfda791a2f52d49d813a3dc27cd8d09f9e373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
---------------------------------
Version Control using Hg Part I 
---------------------------------

.. Prerequisites
.. -------------

.. None

.. Author : Primal Pappachan
   Internal Reviewer : Kiran Isukapatla
   Date: Jan 27, 2012

----------------------
Spoken Tutorial Script
----------------------

.. L1

{{{ Show the first slide containing title, name of the production team along
with the logo of MHRD}}}

.. R1

Hello friends and welcome to the first part of tutorial on 'Version Control
using Hg' 

.. L2

{{{Show the slide containing the objectives}}}

.. R2

At the end of this tutorial you will be able to

 1. Understand what is Version Control
 #. Identify the need for using Version Control
 #. Install Mercurial and intialize a repository

.. R3

First, let's understand what 'Version Control' is.

.. L3

{{{Show the slide 'what is version control'}}}

.. R4

'Version control' is a way to track files over time and share them. This allows
access to earlier versions of a file(s) if and when required. It therefore
enables us to make changes to the content of a file, view it's change log and
collaborate on a single piece of work with a team of people.
 
As the quote from the famous blog post 'Version Control for masses' says

"Version control is one of those weird, geeky things that never really gained
much ground in non-geek fields, despite the fact that it’s blindingly useful." 

Over the course of these 3 spoken tutorials, we are going to see a handful of
such things, which are widely used in the programmer world, but not so much in
the scientific computing world, even when if they would be very useful.

.. L4

{{{Show the slide 'Home-brewed'}}}

.. R5

Let's look at an example of home-brewed Version Control system

Version control is a way of backing up files, before making changes. Most
people would have cooked up their own version control system, without
realizing, there were tools built by others, that performs the task in a more
organized and systematic way.  

.. L5

{{{Show the slide 'Problems'}}}

.. R6

Let's look at the various problems associated with this set-up.

 1. Name and changes made are not related or linked.
 #. Can't track sequence of changes made to a file
 #. Does not scale

.. L6

{{{Show the slide 'The need for Version Control'}}}

.. R7

Having seen the problems of a home brewed setup, let's now move onto
identifying the needs for a 'Version Control System'.

 1. To err is Human . . .
 #. Tracking the history and evolution of a project
 #. To collaborate effectively on a project
 #. To efficiently track down bugs and pin-point the
 #. changes that caused it

.. L7

{{{Show the slide 'The need for Version Control'}}}

.. R8

We have seen that one of the main motivations to use a Version Control system
is the ability to go back to a working version of a file, when something goes
wrong. Below are a few more advantages of using an automated version control
system.

 1. By tracking the history of a project, any person may see the evolution of a
project. This helps to track what changes were made at what point of time, when
and by whom.
 #. Allows for effective collaboration on a project, as everything is shared.
 #. Helps to identify which additions have broken down a project and thus aids
 in efficient tracking down of the bugs.
 #. It is good for a one man show as it is for a big group of people working on
 a project.

Keeping your stuff version controlled will help avoid accidental deletion of
individual files etc. Hosting it on a remote server will protect your sanity
from a hard disk crash.

.. L8

{{{Show the slide 'How does it work? - Analogy}}}

.. R9

It is, in some ways, similar to playing a video game. We generally play games
in stages. While playing, we save the game at some instances as per our choice.
We continue playing, but we could, if necessary, choose to go back to one of
the saved states and start over. In this manner, we could change the course of
the game.

.. L9

{{{Show the slide 'Mercurial or hg'}}}

.. R10

Some of the Version Control tools available and used widely are:

 1. cvs(Concurrent Version Systems)	
 #. svn(subversion)
 #. hg(mercurial)
 #. git

.. R11

Each of these tools have their own merits and demerits. In this tutorial we
shall learn how to use mercurial or hg which is easy to learn and use and
comparatively light weight. Once you learn how to use hg, you can easily try
other tools and switch to one that you feel most comfortable with.

Let's now get into Installation. For Linux distributions, Ubuntu and Debian
type the following in command line terminal

.. L10

sudo apt-get install mercurial

.. R12

For Windows,

.. L11

http://mercurial.selenic.com/downloads/

http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html

.. R 13

For any other Operating system, please refer the hg book for installation
instruction - 

Type 'hg' which lists out all the commands 

.. L12

$hg

.. R14

and 'hg version' which gives the version number.

.. L13

$hg version

.. L14

{{{Show the 'summary' slide'}}}

.. R15

This brings us to the end of the tutorial. In this tutorial, we have
seen,
 1. the motivation to use version control
 #. an analogy of version control with playing a video game
 #. how to check if mercurial is installed, and it's version using hg version

.. L15

{{{Show self assessment questions slide}}}

.. R16 

Here are some self assessment questions for you to solve

 1. Is Mercurial a Centralized VCS or Distributed VCS? Justify your reasoning.
 #. How can you verify whether Mercurial has been installed properly?
 #. What is the command for accessing built-in help system of Mercurial?	

.. L16

{{{Show the solutions slide to self assessment questions }}}

.. R17

And the answers,

 1. Mercurial is a Centralized Version Control system. To read more go here,
 http://en.wikipedia.org/wiki/Distributed_revision_control
 #. $hg version - 	
 #. $hg help command	


.. L17

{{{Show the thank you slide}}}

.. R18

Hope you have enjoyed this tutorial and found it useful. Feel free to play
around with Mercurial and read the documentation given by hg help command. When
you are ready to move on, please proceed to the second tutorial on 'Version
Control using Hg'

Thank you