summaryrefslogtreecommitdiff
path: root/Version_Control
diff options
context:
space:
mode:
authorikkiran2012-05-11 15:57:46 +0530
committerikkiran2012-05-11 15:57:46 +0530
commiteb9617e16c502f82bc4e70ebab8948ffd42aef67 (patch)
treec143f1dd2ff0ac011f6deadec07ef81656c73143 /Version_Control
parentaad8d25dd892162e3293fe768eedd0c12fc4dec7 (diff)
downloadsdes-stscripts-eb9617e16c502f82bc4e70ebab8948ffd42aef67.tar.gz
sdes-stscripts-eb9617e16c502f82bc4e70ebab8948ffd42aef67.tar.bz2
sdes-stscripts-eb9617e16c502f82bc4e70ebab8948ffd42aef67.zip
Update Version_Control/vcs1/vcs1.rst
Diffstat (limited to 'Version_Control')
-rw-r--r--Version_Control/vcs1/vcs1.rst242
1 files changed, 64 insertions, 178 deletions
diff --git a/Version_Control/vcs1/vcs1.rst b/Version_Control/vcs1/vcs1.rst
index 83049f7..bd222bb 100644
--- a/Version_Control/vcs1/vcs1.rst
+++ b/Version_Control/vcs1/vcs1.rst
@@ -5,7 +5,7 @@
.. Author : Primal Pappachan
Internal Reviewer : Kiran Isukapatla
- Date: Jan 8, 2012
+ Date: May 10 , 2012
--------
Script
--------
@@ -16,7 +16,7 @@ Script
i.. R1
-Hello friends and welcome to the tutorial on 'Version Control with Hg'
+Hello friends and welcome to the tutorial on 'Version Control with Hg'
.. L2
@@ -26,30 +26,29 @@ Hello friends and welcome to the tutorial on 'Version Control with Hg'
At the end of this tutorial you will be able to
-1. Understand what is Version Control and the need for it.
+1. Understand what is Version Control.
-#. Create and use a repository on a daily basis.
+#. Identify the need for using Version Control.
-.. R3
-
-First, let's understand what 'Version Control' is.
+#. Install Mercurial.
.. 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.
+.. R3
+
+First, let's understand what 'Version Control' is. '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.
.. L4
{{{Show the slide 'Home-brewed'}}}
-.. R5
+.. R4
-Let's look at an example of home-brew Version Control system
+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.
@@ -57,17 +56,24 @@ Version control is a way of backing up files, before making changes. Most people
{{{Show the slide 'Problems'}}}
+.. R5
+
Let's look at the various problems associated with this set-up.
-.. R6
+1. Name and changes made are not related or linked.
+
+#. Can’t track sequence of changes made to a file.
+
+#. Does not scale.
-Now, let's move to identifying the needs for a 'Version Control System'.
.. L6
{{{Show the slide 'The need for Version Control'}}}
-.. R7
+.. R6
+
+Now, let's move to identifying the needs for a 'Version Control System'.
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.
@@ -84,7 +90,7 @@ We have seen that one of the main motivations to use a Version Control system is
{{{Show the slide 'How does it work? - Analogy}}}
-.. R8
+.. R7
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 state of the game.
@@ -92,214 +98,94 @@ It is, in some ways, similar to playing a video game. We generally play games in
{{{Show the slide 'Mercurial or hg'}}}
-.. R9
-
-Some of the Version Control tools available and used widely are:
-
-1. cvs(Concurrent Version Systems)
-
-#. svn(subversion)
-
-#. hg(mercurial)
+.. R8
-#. git
+mercurial or hg is:
-.. R10
+1. Easy to learn and use
+
+#. Lightweight
-Each of these tools have their own merits and demerits. In this tutorial we shall learn how to use mercurial or hg.
+#. Scales excellently
-Let's now get into Installation
-
-.. L8
+#. Written in Python
-sudo apt-get install mercurial
+Some of the Version Control tools available and used widely are:
-.. R11
+cvs, svn, git and so on.
-For Windows,
+Each of these tools have their own merits and demerits. In this tutorial we shall learn how to use mercurial or hg.
.. L9
-http://mercurial.selenic.com/downloads/
+{{{Show the slide 'Installation'}}}
-Type 'hg' which lists out all the commands
+.. R9
-.. L10
+Let's now get into Installation
-$hg
+sudo apt-get install mercurial
-.. R12
+$hg
and 'hg version' which gives the version number.
-.. L11
-
$hg version
-.. R13
-
-Now, what exactly is a repo? A repo/repository is a folder with contains all the files and information on all the changes that were made to it. To save disk space, hg doesn't save all files, but only saves only a series of changes made to the files.
-
-.. L13
-
-{{{Show the slide for 'We need a repo!'}}}
-
-.. R14
-
-Let's now see how to initialize a repo.
-
-.. L14
-
-cd working-directory/
-
-$hg init
-
-ls -a
-
-.. R15
-
-The .hg directory indicates that our book directory is now a hg repository. Mercurial keeps all the history of the changes made and a few other config files etc. in this directory.
-
-.. L13
-
-$hg status
-
-.. R15
-Gives the status of our repo. As a beginner, use it often.
-
-.. L14
-
-$hg help 'status'
-
-.. R16
-
-You can use 'hg help commandname' which gives the details about the command. For example.
-
-.. L15
-
-hg help status
-
-{{{Show the slides for 'Status Codes'}}}
-
-.. R17
-
-Have a look at what various status codes, associated with the files mean. By looking at the codes, it is clear that our files are not being tracked by hg yet. Now let's move onto 'Adding Files'.
-
-.. L16
-
-$hg status
-
-.. R18
-
-This shows that none of the files in the folder have been added yet.
-
-.. L17
-
-$hg add
-
-.. R19
-
-This simply adds all the files in the (working) directory, to the repository. As expected, the status command shows an 'A' has been appended to the filenames. We could also specify files individually, for example
-
-.. L18
-
-$ hg add filename
-
-.. R20
-
-We have added a set of files to the repository, but we haven't told mercurial to remember these changes. Now let's take a snapshot of this working directory. This can be done by using commit command.
-
-.. L19
-
-$hg commit -u "username <user@domain.com>" -m "Commit message."
-
-.. R20
-
-The -u parameter allows to specify the user details. The parameter -m is used to attach a commit message which gives a description of the changes committed to the repository. Check the status of repository by typing
-
-.. L20
-
-$ hg st
-
-.. R21
-
-To see the history of changes made to our repository, we use hg log. We can view the change that we just made to our repository.
-
-.. L21
-
-{{{Show the slide 'Thumbnail views'}}}
-
-.. R21
-
-hg log gives the log of the changes made in the form of changesets. A changeset is a set of changes made to the repository between two consecutive commits. It also shows the date at which the commit was made.
-
-
-.. R22
-
-User information is set in the hgrc file. It can be either set globally or locally to the project.
-
-For linux systems
-.. L23
-
-cat ~/.hgrc
-[ui]
-username = username <user@domain.com>
-editor = vim
-
-
-.. R23
+.. L10
+{{{Show the 'summary' slide'}}}
-We have now set the user-name details for mercurial to use.
+.. R10
-.. L24
+This brings us to the end of the tutorial. In this tutorial, we have
+learnt:
-{{{Show the slide 'Advice: commits, messages'}}}
+1. What is Version Control.
-.. R24
+#. Identify the need for using Version Control
-1. Atomic changes; one change with one commit
+#. Install Mercurial.
-#. Single line summary — 60 to 65 characters long
+.. L11
-#. Followed by paragraphs of detailed description
- - Why the change?
- - What does it effect?
- - Known bugs/issues?
- - etc.
+{{{Show self assessment questions slide}}}
-.. L25
+.. R11
-{{{Show the 'summary' slide'}}}
+Here are some self assessment questions for you to solve
-.. R25
+1. Is Mercurial a Centralized VCS or Distributed
+VCS? Justify your reasoning.
-This brings us to the end of the tutorial. In this tutorial, we have
-learnt to,
+#. How can you verify whether Mercurial has been
+installed properly?
-.. L26
+#. What is the command for accessing built-in help
+system of Mercurial?
-{{{Show self assessment questions slide}}}
+.. L12
-.. R26
+{{{Show the solutions slide to self assessment questions }}}
-Here are some self assessment questions for you to solve
+.. R12
-.. L27
+And the answers,
-{{{Show the solutions slide to self assessment questions }}}
+1. Mercurial is a Distributed Version Control system.
-.. R27
+#. hg version
-And the answers,
+#. hg help command
-.. L27
+.. L13
{{{Show the thank you slide}}}
-.. R28
+.. R13
Hope you have enjoyed this tutorial and found it useful.
Thank you
+