summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrimal Pappachan2012-06-29 15:44:24 +0530
committerPrimal Pappachan2012-06-29 15:44:24 +0530
commit5915d64f54244466eec666ec2483ecd4031284fc (patch)
treed3f8f7580195191667cabf7073514f56d7bc608f
parented20e38641e991e5763cd80f73eb39853c9a5a7b (diff)
downloadsdes-stscripts-5915d64f54244466eec666ec2483ecd4031284fc.tar.gz
sdes-stscripts-5915d64f54244466eec666ec2483ecd4031284fc.tar.bz2
sdes-stscripts-5915d64f54244466eec666ec2483ecd4031284fc.zip
Edited according to the checklist
-rw-r--r--Version_Control/vcs2/vcs2.rst111
-rw-r--r--Version_Control/vcs2/vcs2twocol.rst195
-rw-r--r--Version_Control/vcs2/vcslide2.tex49
3 files changed, 295 insertions, 60 deletions
diff --git a/Version_Control/vcs2/vcs2.rst b/Version_Control/vcs2/vcs2.rst
index 57d40bf..9be4fa3 100644
--- a/Version_Control/vcs2/vcs2.rst
+++ b/Version_Control/vcs2/vcs2.rst
@@ -22,8 +22,8 @@ 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 tutorial on 'Version Control
+using Mercurial: Let there a Repo!'
.. L2
@@ -40,14 +40,14 @@ continue on this tutorial:
.. R3
-At the end of this tutorial you will be able to
+At the end of this tutorial you will be able to do the following to a repository
- 1. initialize a new repository,
+ 1. initialize it,
#. obtain the status of a repository,
- #. add new files to a repository,
- #. take snapshots of a repository,
- #. view the history of a repository,
- #. and set your user information for hg
+ #. add new files to it,
+ #. take snapshots,
+ #. view the history,
+ #. and also set your user information for hg
.. L4
@@ -69,15 +69,21 @@ to the files.
.. 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 fresh repository can either be started using an init command or an existing
+repository could be cloned. It adds a .hg directory to our working directory.
+
+Let us look at creating our own repository, now. We can look at obtaining
+already existing repositories, at a later stage.
+
+Switch to your terminal
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
+*{{{Switch to terminal}}}
+
``$ cd book/``
``$ ls -a``
@@ -100,6 +106,7 @@ repository using the hg init command
.. 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.
@@ -112,54 +119,70 @@ directory.
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.
+that we want it to. Let's first see the status of our repo using the command.
.. L9
+*{{{Switch to Terminal}}}
+
``$hg status``
+*{{{Show the slides 'Status Report'}}}
+
.. R9
-Gives the status of our repo. As a beginner, use it often.
+It gives the status of our repo. As a beginner, use it often. You can use
+'hg help commandname' which gives the details about the command. For example,
.. L10
+*{{{Switch to terminal}}}*
+
``$hg help 'status'``
.. R10
-You can use 'hg help commandname' which gives the details about the command.
-For example.
+You can see the status codes listed in the help for status command.
.. L11
-``$hg help status``
*{{{Show the slides for 'Status Codes'}}}*
.. 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 understand what each of the status code associated with the
+files in our repository mean.
.. L12
*{{{Show the slides for 'Adding files'}}}*
+.. R12
+
+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
+
+*{{{Switch to terminal}}}*
+
``$hg add``
-.. R12
+
+.. R13
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
+As expected, the status command shows an A before the file names. We could also
specify files individually, for example
-.. L13
+.. L14
``$ hg add chapter1.txt``
-.. R13
+*{{{Show the slides for 'Adding files'}}}*
+
+.. R14
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
@@ -177,6 +200,8 @@ time. We do this by using the commit command.
.. L15
+*{{{Switch to Terminal}}}*
+
``$ hg commit -u "Primal Pappachan <primal@fossee.in>" -m "Initial Commit."``
.. R15
@@ -218,7 +243,7 @@ the change that we just made to our repository.
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.
+various aspects of the changeset mentioned in the slide.
.. L19
@@ -240,6 +265,7 @@ add the username details and our editor preferences.
.. L20
+*{{{Switch to terminal}}}*
``vim ~/.hgrc``
@@ -265,7 +291,7 @@ Some Recommended Practices for commit messages
#. Single line summary, 60 to 65 characters long
#. Followed by paragraphs of detailed description
- * Why the change?
+ * Why the change?
* What does it effect?
* Known bugs/issues?
* etc.
@@ -280,7 +306,7 @@ 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 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.
@@ -294,16 +320,17 @@ seen,
Here are some self assessment questions for you to solve
1. How can you tell hg to stop tracking deleted files?
- 2. What happens when 'hg commit' command is run first time without specifying u
+ 2. What happens when 'hg commit' command is run first time without specifying
+ -u paramter?
3. Here's a part of the output that is printed in 'hg log':
changeset: 1:2278160e78d4
tag: tip
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 in the first line?
.. L24
@@ -313,12 +340,20 @@ 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 !
- 2. 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.
- 3. 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 use hg remove command to tell mercurial to stop tracking files.
+
+ 2. 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.
+
+ 3. 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.
+
.. L25
*{{{Show the thank you slide}}}*
@@ -326,9 +361,7 @@ And the answers,
.. R25
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'
+around with Mercurial and read the documentation given by hg help command.
Thank you
diff --git a/Version_Control/vcs2/vcs2twocol.rst b/Version_Control/vcs2/vcs2twocol.rst
new file mode 100644
index 0000000..d542d2d
--- /dev/null
+++ b/Version_Control/vcs2/vcs2twocol.rst
@@ -0,0 +1,195 @@
+---------------------------------
+Version Control using Hg Part 2
+---------------------------------
+
+.. Prerequisites
+.. -------------
+
+.. Version Control using Hg Part 1
+
+.. Author : Primal Pappachan
+ Internal Reviewer : Kiran Isukapatla
+ Date: Jan 27, 2012
+
+----------------------
+Spoken Tutorial Script
+----------------------
+
+
+
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{ Show the first slide containing title, name of the production team along | Hello friends and welcome to the tutorial on 'Version Control |
+| with the logo of MHRD}}}* | using Mercurial: Let there a Repo!' |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slide 'Prerequisite'}}}* | Please make sure that you have gone through the following tutorials before you |
+| | continue on this tutorial: |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slide 'Objectives'}}}* | At the end of this tutorial you will be able to do the following to a repository |
+| | |
+| | 1. initialize it, |
+| | #. obtain the status of a repository, |
+| | #. add new files to it, |
+| | #. take snapshots, |
+| | #. view the history, |
+| | #. and also set your user information for hg |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slide for 'We need a repo!'}}}* | 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slide 'Initializing a Repo'}}}* | A fresh repository can either be started using an init command or an existing |
+| | repository could be cloned. It adds a .hg directory to our working directory. |
+| | |
+| | Let us look at creating our own repository, now. We can look at obtaining |
+| | already existing repositories, at a later stage. |
+| | |
+| | Switch to your terminal |
+| | |
+| | 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Switch to terminal}}} | We have three chapters in the folder. We convert this folder into a mercurial |
+| | repository using the hg init command |
+| ``$ cd book/`` | |
+| | |
+| ``$ ls -a`` | |
+| | |
+| ``. .. chapter1.txt chapter2.txt chapter3.txt`` | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| ``$ hg init`` | The .hg directory indicates that our book directory is now a hg repository. |
+| | |
+| ``$ ls -a`` | 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 |
+| ``. .. .hg chapter1.txt chapter2.txt chapter3.txt`` | directory. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slides 'Status Report'}}}* | 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. Let's first see the status of our repo using the command. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Switch to Terminal}}} | It gives the status of our repo. As a beginner, use it often. You can use |
+| | 'hg help commandname' which gives the details about the command. For example, |
+| ``$hg status`` | |
+| | |
+| *{{{Show the slides 'Status Report'}}} | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Switch to terminal}}}* | You can see the status codes listed in the help for status command. |
+| | |
+| ``$hg help 'status'`` | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slides for 'Status Codes'}}}* | Let's now to try to understand what each of the status code associated with the |
+| | files in our repository mean. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slides for 'Adding files'}}}* | 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'. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Switch to terminal}}}* | This simply adds all the files in the (working) directory, to the repository. |
+| | As expected, the status command shows an A before the file names. We could also |
+| ``$hg add`` | specify files individually, for example |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slides 'Taking Snapshots'}}}* | 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Switch to Terminal}}}* | 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 |
+| ``$ hg commit -u "Primal Pappachan <primal@fossee.in>" -m "Initial Commit."`` | 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| ``$ hg st`` | 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| ``{{{Show the slide 'Thumbnail views'}}}`` | 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| ``$ hg log`` | 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 mentioned in the slide. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slide 'User Information'}}}* | 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. |
+| | |
+| | |
+| | For linux systems, we open the configuration file in our favorite editor and |
+| | add the username details and our editor preferences. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Switch to terminal}}}* | We have now set the user-name details for mercurial to use. |
+| | |
+| ``vim ~/.hgrc`` | |
+| | |
+| ``[ui]`` | |
+| | |
+| ``username = Primal Pappachan <primal@fossee.in>`` | |
+| | |
+| ``editor = vim`` | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the slide 'Advice: commits, messages'}}}* | Some Recommended Practices for commit messages |
+| | |
+| | 1. Atomic changes; one change with one commit |
+| | #. Single line summary, 60 to 65 characters long |
+| | #. Followed by paragraphs of detailed description |
+| | |
+| | * Why the change? |
+| | * What does it effect? |
+| | * Known bugs/issues? |
+| | * etc. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the 'Summary' slide}}}* | 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 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{Show self assessment questions slide}}} | Here are some self assessment questions for you to solve |
+| | |
+| | 1. How can you tell hg to stop tracking deleted files? |
+| | 2. What happens when 'hg commit' command is run first time without specifying |
+| | -u paramter? |
+| | 3. Here's a part of the output that is printed in 'hg log': |
+| | changeset: 1:2278160e78d4 |
+| | tag: tip |
+| | 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 in the first line? |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the solutions slide to self assessment questions }}}* | And the answers, |
+| | |
+| | 1. If you have deleted files, hg status will show you the status code !. You |
+| | can use hg remove command to tell mercurial to stop tracking files. |
+| | |
+| | 2. 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. |
+| | |
+| | 3. 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. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| *{{{Show the thank you slide}}}* | 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. |
+| | |
+| | Thank you |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
diff --git a/Version_Control/vcs2/vcslide2.tex b/Version_Control/vcs2/vcslide2.tex
index 4ab4ecf..c17c7fc 100644
--- a/Version_Control/vcs2/vcslide2.tex
+++ b/Version_Control/vcs2/vcslide2.tex
@@ -43,45 +43,49 @@
\setbeamercolor{emphbar}{bg=blue!20, fg=black}
\newcommand{\emphbar}[1]
+\author[Primal Pappachan] {}
+\institute[FOSSEE group] {}
+
+\date[IIT Bombay] {}
+
\begin{document}
\begin{frame}
\begin{center}
-\vspace{12pt}
-\textcolor{blue}{\huge Version Control Using Hg - Part 2}
+\vspace{15pt}
+\textcolor{blue}{\large Version Control Using Mercurial} \\
+\textcolor{blue}{\huge Let there be a Repo!}
\end{center}
-\vspace{18pt}
+\vspace{15pt}
\begin{center}
-\vspace{10pt}
\includegraphics[scale=0.95]{../images/fossee-logo.png}\\
\vspace{5pt}
\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\
\scriptsize Funded by National Mission on Education through ICT\\
-\scriptsize MHRD,Govt. of India\\
+\scriptsize MHRD, Govt. of India\\
\includegraphics[scale=0.15]{../images/iitb-logo.jpg}\\
\end{center}
\end{frame}
\begin{frame}
\frametitle{Prerequisite}
- \textbf{Version Control Using Hg}
\begin{itemize}
- \item Part I
+ \item \textbf{Version Control Using Mercurial}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Objectives}
- At the end of this tutorial, you will be able to:
+ At the end of this tutorial, you will be able to do the following to a repository:
\begin{itemize}
- \item Initialize a new repository,
- \item Obtain the status of a repository,
- \item Add new files to a repository,
- \item Take snapshots of a repository,
- \item View the history of a repository,
- \item Set your user information for hg
+ \item Initialize it
+ \item Obtain the status,
+ \item Add new files to it,
+ \item Take snapshots,
+ \item View the history,
+ \item \textcolor{blue}{And also} Set your user information for hg
\end{itemize}
\end{frame}
@@ -92,10 +96,8 @@
\frametitle{We need a repo!}
\begin{itemize}
\item A Repository (repo) is where all the action is!
- \item Project files along with a special directory that stores all the
- changes
- \item We take snapshots of the whole repository; not individual
- files.
+ \item Project files along with a special directory that stores all the changes
+ \item We take snapshots of the whole repository; not individual files.
\end{itemize}
\end{frame}
@@ -231,8 +233,13 @@
\frametitle{Solutions}
\begin{enumerate}
\item \small{hg remove}
-\item \small{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}
-\item \small{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.}
+\item \small{Initially it looks for the EMAIL environment variable, if it does not exist
+it tries to use a combination of local user name and host name. If both
+mechanisms fails, an error message will be printed and user will not be
+allowed to commit.}
+\item \small{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}
\end{enumerate}
\end{frame}
\begin{frame}
@@ -250,4 +257,4 @@
\end{block}
\end{frame}
-\end{document} \ No newline at end of file
+\end{document}