summaryrefslogtreecommitdiff
path: root/Version_Control/vcs2/vcs2.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Version_Control/vcs2/vcs2.rst')
-rw-r--r--Version_Control/vcs2/vcs2.rst120
1 files changed, 90 insertions, 30 deletions
diff --git a/Version_Control/vcs2/vcs2.rst b/Version_Control/vcs2/vcs2.rst
index 1304b94..c69a30b 100644
--- a/Version_Control/vcs2/vcs2.rst
+++ b/Version_Control/vcs2/vcs2.rst
@@ -17,11 +17,13 @@ Spoken Tutorial Script
.. L1
-{{{ Show the first slide containing title, name of the production team along with the logo of MHRD}}}
+{{{ Show the first slide containing title, name of the production team along
+with the logo of MHRD}}}
.. R1
-Hello friends and welcome to the second part of tutorial on 'Version Control using Hg'
+Hello friends and welcome to the second part of tutorial on 'Version Control
+using Hg'
.. L2
@@ -29,7 +31,8 @@ Hello friends and welcome to the second part of tutorial on 'Version Control usi
.. R2
-Please make sure that you have gone through the following tutorials before you continue on this tutorial:
+Please make sure that you have gone through the following tutorials before you
+continue on this tutorial:
.. L3
@@ -51,9 +54,13 @@ At the end of this tutorial you will be able to
.. R4
-To start using Mercurial (or hg) and get the benefits of using a version control system, we should first have a repository.
+To start using Mercurial (or hg) and get the benefits of using a version
+control system, we should first have a repository.
-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.
+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.
.. L5
@@ -61,9 +68,12 @@ Now, what exactly is a repo? A repo/repository is a folder with contains all the
.. R5
-A repository can either be started using an init command or an existing repository could be cloned. Let us look at creating our own repository, now. We can look at obtaining already existing repositories, at a later stage.
+A repository can either be started using an init command or an existing
+repository could be cloned. Let us look at creating our own repository, now. We
+can look at obtaining already existing repositories, at a later stage.
-Let's say we have a folder called book, which has all the chapters of a book as text files. Let us convert that folder, into a hg repository.
+Let's say we have a folder called book, which has all the chapters of a book as
+text files. Let us convert that folder, into a hg repository.
.. L6
@@ -73,7 +83,8 @@ $ ls -a
.. R6
-We have three chapters in the folder. We convert this folder into a mercurial repository using the hg init command
+We have three chapters in the folder. We convert this folder into a mercurial
+repository using the hg init command
.. L7
@@ -83,7 +94,10 @@ $ ls -a
.. R7
-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. The directory, book is called our working directory.
+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. The directory, book is called our working
+directory.
.. L8
@@ -91,7 +105,9 @@ The .hg directory indicates that our book directory is now a hg repository. Merc
.. R8
-We now have a fresh repository, but all our files are not being tracked or watched by mercurial, yet. We need to explicitly ask it to watch the files, that we want it to.
+We now have a fresh repository, but all our files are not being tracked or
+watched by mercurial, yet. We need to explicitly ask it to watch the files,
+that we want it to.
.. L9
@@ -107,7 +123,8 @@ $hg help 'status'
.. R10
-You can use 'hg help commandname' which gives the details about the command. For example.
+You can use 'hg help commandname' which gives the details about the command.
+For example.
.. L11
@@ -119,7 +136,9 @@ $hg help status
.. R11
-Let's now to try to discern what each of the status code 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'.
+Let's now to try to discern what each of the status code 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'.
.. L13
@@ -127,7 +146,9 @@ $hg add
.. R12
-This simply adds all the files in the (working) directory, to the repository. As expected, the status command shows an A before he file names. We could also specify files individually, for example
+This simply adds all the files in the (working) directory, to the repository.
+As expected, the status command shows an A before he file names. We could also
+specify files individually, for example
.. L14
@@ -135,7 +156,9 @@ $ hg add chapter1.txt
.. R13
-If you have deleted files, hg status will show you the status code !. You can, then, tell hg to stop tracking these files, using the hg remove command. Look at hg help remove for more details.
+If you have deleted files, hg status will show you the status code !. You can,
+then, tell hg to stop tracking these files, using the hg remove command. Look
+at hg help remove for more details.
.. L15
@@ -143,7 +166,9 @@ If you have deleted files, hg status will show you the status code !. You can, t
.. R14
-We have added a set of new files to the repository, but we haven't told mercurial to remember these changes, i.e., to take a snapshot at this point in time. We do this by using the commit command.
+We have added a set of new files to the repository, but we haven't told
+mercurial to remember these changes, i.e., to take a snapshot at this point in
+time. We do this by using the commit command.
.. L16
@@ -151,9 +176,14 @@ $ hg commit -u "Primal Pappachan <primal@fossee.in>" -m "Initial Commit."
.. R15
-The -u parameter allows us to specify the user details. It is a general good practice to use full name followed by the email id. The -m parameter allows us to give the commit message --- a message describing the changes that are being committed.
+The -u parameter allows us to specify the user details. It is a general good
+practice to use full name followed by the email id. The -m parameter allows us
+to give the commit message --- a message describing the changes that are being
+committed.
-Mercurial has now taken a snapshot of our repository and has attached our description along with it. To see the status of the files in the repository, use the hg status command.
+Mercurial has now taken a snapshot of our repository and has attached our
+description along with it. To see the status of the files in the repository,
+use the hg status command.
.. L17
@@ -161,7 +191,9 @@ $ hg st
.. R16
-The command does not return anything, when there are no uncommitted changes. Also, notice that I have started getting lazy and used only a short name st for the status command.
+The command does not return anything, when there are no uncommitted changes.
+Also, notice that I have started getting lazy and used only a short name st for
+the status command.
.. L18
@@ -169,7 +201,8 @@ The command does not return anything, when there are no uncommitted changes. Als
.. R17
-To see the history of the changes to our repository, we use hg log. We can view the change that we just made to our repository.
+To see the history of the changes to our repository, we use hg log. We can view
+the change that we just made to our repository.
.. L19
@@ -177,7 +210,10 @@ $ hg log
.. R18
-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. Please have a look of the various aspects of the changeset.
+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. Please have a look of the
+various aspects of the changeset.
.. L20
@@ -185,14 +221,21 @@ hg log gives the log of the changes made in the form of changesets. A changeset
.. R19
-There are two aspects which can be improved upon. Firstly, it is unnecessary to keep typing the user information each and every time we make a commit. Secondly, it is not very convenient to enter a multi-line commit message from the terminal. To solve these problems, we set our user details and editor preferences in the .hgrc file in our home folder. ($HOME/.hgrc on Unix like systems and %USERPROFILE%\.hgrc on Windows systems) This is a global setting for all the projects that we are working on.
+There are two aspects which can be improved upon. Firstly, it is unnecessary to
+keep typing the user information each and every time we make a commit.
+Secondly, it is not very convenient to enter a multi-line commit message from
+the terminal. To solve these problems, we set our user details and editor
+preferences in the .hgrc file in our home folder. ($HOME/.hgrc on Unix like
+systems and %USERPROFILE%\.hgrc on Windows systems) This is a global setting
+for all the projects that we are working on.
-.. R20
-For linux systems, we open the configuration file in our favorite editor and add the username details and our editor preferences... L23
+For linux systems, we open the configuration file in our favorite editor and
+add the username details and our editor preferences.
.. L21
+
vim ~/.hgrc
[ui]
username = Primal Pappachan <primal@fossee.in>
@@ -229,7 +272,8 @@ Some Recommended Practices for commit messages
This brings us to the end of the tutorial. In this tutorial, we have
seen,
1. how to initialize a new repository using hg init,
- #. get the status of a repository using hg status and meaning of it's status codes
+ #. get the status of a repository using hg status and meaning of it's status
+ codes
#. make commits of changes to files, using hg commit
#. view the history of the repository using the hg log command,
#. set our user information in the global hgrc file.
@@ -249,9 +293,12 @@ Here are some self assessment questions for you to solve
user: Primal Pappachan <primal@fossee.in>
date: Sat Jan 26 22:16:53 2012 +0530
summary: Added Readme
- Try to identify each component of this changeset and it's meaning. In the changeset, what is the significance of the number as well as hexadecimal string?
+ Try to identify each component of this changeset and it's meaning. In the
+ changeset, what is the significance of the number as well as hexadecimal
+ string?
- #. What happens when 'hg commit' command is run first time without specifying username as parameter or creating the hg configuration file?
+ #. What happens when 'hg commit' command is run first time without specifying
+ username as parameter or creating the hg configuration file?
.. L25
@@ -261,9 +308,19 @@ Here are some self assessment questions for you to solve
And the answers,
- 1. If you have deleted files, hg status will show you the status code !. You can, then, tell hg to stop tracking these files, using the hg remove command.
- #. The revision number is a handy notation that is only valid in that repository. The hexadecimal string is the permanent, unchanging identifier that will always identify that exact changeset in every copy of the repository
- #. If you have set the EMAIL environment variable, this will be used. Next, Mercurial will query your system to find out your local user name and host name, and construct a username from these components. Since this often results in a username that is not very useful, it will print a warning if it has to do this. If all of these mechanisms fail, Mercurial will fail, printing an error message. In this case, it will not let you commit until you set up a username.
+ 1. If you have deleted files, hg status will show you the status code !. You
+ can, then, tell hg to stop tracking these files, using the hg remove command.
+ #. The revision number is a handy notation that is only valid in that
+ repository. The hexadecimal string is the permanent, unchanging identifier
+ that will always identify that exact changeset in every copy of the repository
+
+ #. If you have set the EMAIL environment variable, this will be used. Next,
+ Mercurial will query your system to find out your local user name and host
+ name, and construct a username from these components. Since this often results
+ in a username that is not very useful, it will print a warning if it has to do
+ this. If all of these mechanisms fail, Mercurial will fail, printing an error
+ message. In this case, it will not let you commit until you set up a
+ username.
.. L26
@@ -271,7 +328,10 @@ And the answers,
.. R26
-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 third tutorial on 'Version Control using Hg'
+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 third tutorial on 'Version
+Control using Hg'
Thank you