summaryrefslogtreecommitdiff
path: root/Version_Control
diff options
context:
space:
mode:
authorPrimal Pappachan2012-01-31 16:28:14 +0530
committerPrimal Pappachan2012-01-31 16:28:14 +0530
commit1275643bdd714665c2f59ded9503a0d90193c732 (patch)
treeff9e92492c626c2f1046d563372e8b614f97087c /Version_Control
parent6d52dcf2189ca692490e488250226a1284ec0162 (diff)
downloadsdes-stscripts-1275643bdd714665c2f59ded9503a0d90193c732.tar.gz
sdes-stscripts-1275643bdd714665c2f59ded9503a0d90193c732.tar.bz2
sdes-stscripts-1275643bdd714665c2f59ded9503a0d90193c732.zip
Formatted
Diffstat (limited to 'Version_Control')
-rw-r--r--Version_Control/vcs4/vcs4.rst186
1 files changed, 113 insertions, 73 deletions
diff --git a/Version_Control/vcs4/vcs4.rst b/Version_Control/vcs4/vcs4.rst
index 08f5f1e..34018c1 100644
--- a/Version_Control/vcs4/vcs4.rst
+++ b/Version_Control/vcs4/vcs4.rst
@@ -42,44 +42,56 @@ continue on this tutorial
.. R3
At the end of this tutorial you will be able to
- 1. Clone existing repositories
+ #. Clone existing repositories
#. Share your repositories with peers
#. use version control for collaborating with your peers
.. L4
-{{{Show the slide 'Cloning Repositories'}}}
+*{{{Show the slide 'Cloning Repositories'}}}*
.. R4
-When motivating the use of version control systems, we spoke a lot about collaboration and sharing our changes with our peers. Let us now see how we can share our project with our peers and collaborate with them.
+When motivating the use of version control systems, we spoke a lot about
+collaboration and sharing our changes with our peers. Let us now see how we can
+share our project with our peers and collaborate with them.
-For this purpose let us create a central repository, a copy of our repository, which is different from the one in which we are working. The clone command is used to clone or replicate an existing repository.
+For this purpose let us create a central repository, a copy of our repository,
+which is different from the one in which we are working. The clone command is
+used to clone or replicate an existing repository.
.. L15
-$hg clone SOURCE [DEST]
-$ hg clone book book-repo
+``$hg clone SOURCE [DEST]
+$ hg clone book book-repo``
.. R15
-The syntax of the clone command is -- hg clone SOURCE [DEST], where the optional argument DEST is being represented in brackets. The clone command can be used to replicate already existing repositories, either on your own machine or on some remote machine somewhere on the network. Since, hg maintains a copy of the full repository with every copy of the repository, the two copies that we have are exactly equivalent.
+The syntax of the clone command is -- hg clone SOURCE [DEST], where the
+optional argument DEST is being represented in brackets. The clone command can
+be used to replicate already existing repositories, either on your own machine
+or on some remote machine somewhere on the network. Since, hg maintains a copy
+of the full repository with every copy of the repository, the two copies that
+we have are exactly equivalent.
In this example book-repo shall be our central repository we are sharing with
peers.
.. L16
-{{{Show the slide 'Sharing Repositories'}}}
+*{{{Show the slide 'Sharing Repositories'}}}*
.. R16
-A mercurial repository can be shared in multiple ways. We shall use the http protocol to share the repository. Mercurial comes inbuilt with a tiny server that can be used to share your repository over the network. To start sharing the repository, we say
+A mercurial repository can be shared in multiple ways. We shall use the http
+protocol to share the repository. Mercurial comes inbuilt with a tiny server
+that can be used to share your repository over the network. To start sharing
+the repository, we say
.. L17
-$cd ../book-repo
-$hg serve
+``$cd ../book-repo
+$hg serve``
.. R17
@@ -95,7 +107,7 @@ Now if your friend Primal wishes to clone the repository, use
.. L19
-$ hg clone http://my-ip-address:8000 book-primal
+``$ hg clone http://my-ip-address:8000 book-primal``
.. R19
@@ -110,9 +122,9 @@ in .hg/hgrc
.. L20
-[web]
+``[web]
push_ssl=False
-allow_push=*
+allow_push=*``
.. R20
@@ -122,7 +134,7 @@ his changes will appear in the central repository.
.. L21
-{{{Show the slide 'Sharing Changes'}}}
+*{{{Show the slide 'Sharing Changes'}}}*
.. R21
@@ -131,23 +143,26 @@ changes made by Primal will appear in the central repository.
.. L22
-$ hg push
+``$ hg push``
.. R22
-Let us now pull these changes into our original repository that we have been working with.
+Let us now pull these changes into our original repository that we have been
+working with.
.. L23
-{{{Show the slide 'Pulling Changes'}}}
+*{{{Show the slide 'Pulling Changes'}}}*
.. R23
-Before pulling the changes, we can use the command hg incoming to see the changes that have been made to the repository after our last pull and the changesets that will be coming into our repository after we do a pull.
+Before pulling the changes, we can use the command hg incoming to see the
+changes that have been made to the repository after our last pull and the
+changesets that will be coming into our repository after we do a pull.
.. L24
-$ hg incoming
+``$ hg incoming``
.. R24
@@ -155,23 +170,25 @@ To now pull these changes, we use the pull command.
.. L25
-$ hg pull
+``$ hg pull``
.. R25
-These changes do not affect our working directory. To see this, we could use the hg parent command.
+These changes do not affect our working directory. To see this, we could use
+the hg parent command.
.. L26
-$ hg parent
+``$ hg parent``
.. R26
-As you can see, the parent is still our last commit, and the changes are still not in your working directory.
+As you can see, the parent is still our last commit, and the changes are still
+not in your working directory.
.. L27
-{{{Show the slide 'Pulling Changes'}}}
+*{{{Show the slide 'Pulling Changes'}}}*
.. R27
@@ -179,12 +196,13 @@ To get these changes we do the update as suggested by hg.
.. L28
-$ hg update
+``$ hg update``
.. R28
-As expected the update command updates the parent to the latest changes that we just pulled from the remote repository.
- 1. Updates to the tip if no revision is specified
+As expected the update command updates the parent to the latest changes that we
+just pulled from the remote repository.
+ #. Updates to the tip if no revision is specified
#. tip is the most recently added changeset
#. Can specify revision number to update to
@@ -192,7 +210,7 @@ For example
.. L29
-$ hg up -r1
+``$ hg up -r1``
.. R29
@@ -200,74 +218,81 @@ hg tip shows the tip of the repository
.. L30
-$ hg tip
+``$ hg tip``
.. R31
-What happens when two users have made simultaneous changes to the same file, by editing different parts at the same time.
+What happens when two users have made simultaneous changes to the same file, by
+editing different parts at the same time.
.. L31
-{{{Show the slide 'Simultaneous Changes'}}}
+*{{{Show the slide 'Simultaneous Changes'}}}*
.. R31
With simultaneous changes, following things happen
- 1. The logs of both repositories will be different
+ #. The logs of both repositories will be different
#. The repositories have diverged
#. hg push fails, in such a scenario
.. L32
-$ hg push
+``$ hg push
pushing to http://192.168.1.101:8000
searching for changes
abort: push creates new remote heads!
-(did you forget to merge? use push -f to force)
+(did you forget to merge? use push -f to force)``
.. R32
-Don't take the advice given by mercurial. Using the -f would be disastrous. We will leave out a discussion of that, for this course.
+Don't take the advice given by mercurial. Using the -f would be disastrous. We
+will leave out a discussion of that, for this course.
.. L33
-{{{Show the slide 'Merging'}}}
+*{{{Show the slide 'Merging'}}}*
.. R33
-We will now need to pull the new changes that have been pushed to the repository after the last pull and merge them with the changes.
+We will now need to pull the new changes that have been pushed to the
+repository after the last pull and merge them with the changes.
.. L34
-$ hg pull
+``$ hg pull
-$ hg merge
+$ hg merge``
.. R34
-We have now pull the changes from the central repository and merged them with the changes in our repository. But, hg is warning us not to forget to commit.
+We have now pull the changes from the central repository and merged them with
+the changes in our repository. But, hg is warning us not to forget to commit.
.. L35
-$ hg commit
+``$ hg commit``
.. R35
-We can now push this changes to the central repository. We could also check the changes that will be pushed, before pushing them, using the hg outgoing command.
+We can now push this changes to the central repository. We could also check the
+changes that will be pushed, before pushing them, using the hg outgoing
+command.
.. L36
-{{{Show the slide 'Outgoing Changes'}}}
+*{{{Show the slide 'Outgoing Changes'}}}*
.. L36
-$ hg outgoing
+``$ hg outgoing``
-$ hg push
+``$ hg push``
.. R36
-The changes have now been successfully pushed! Let us look at the web interface of the repo, to see that the changes have actually taken place.
+The changes have now been successfully pushed! Let us look at the web interface
+of the repo, to see that the changes have actually taken place.
.. L37
@@ -275,38 +300,47 @@ Show the Change graph in browser.
.. R37
-What will happen if we edited the same portion of the file, at the same time? How would merges work? This will be the last thing that we are going to see in this part of the spoken tutorial.
+What will happen if we edited the same portion of the file, at the same time?
+How would merges work? This will be the last thing that we are going to see in
+this part of the spoken tutorial.
.. L38
-{{{Show the slide 'Simultaneous Conflicting Changes'}}}
+*{{{Show the slide 'Simultaneous Conflicting Changes'}}}*
.. R38
Let's say both of us edit the same part of the same file.
- 1. hg push fails
+ #. hg push fails
#. So we first do hg pull
#. followed by hg merge
.. L39
-$ hg commit
+``$ hg commit
$ hg push
$ hg pull
-$ hg merge
+$ hg merge``
.. R39
-What happens now actually depends on how Mercurial is configured and the programs available in your machine. You will either get a diff view with 3 panes or merge will insert markers in your file at the points where the conflicts occur.
+What happens now actually depends on how Mercurial is configured and the
+programs available in your machine. You will either get a diff view with 3
+panes or merge will insert markers in your file at the points where the
+conflicts occur.
-If you get a 3 pane view, the first pane is the actual file, where you make changes, to resolve the conflicts. The second pane shows the changes that you made, to the file. The last pane shows the changes that you pulled from the original repo. Once you are satisfied with the changes, save and quit.
+If you get a 3 pane view, the first pane is the actual file, where you make
+changes, to resolve the conflicts. The second pane shows the changes that you
+made, to the file. The last pane shows the changes that you pulled from the
+original repo. Once you are satisfied with the changes, save and quit.
-Once you are done, you need to tell mercurial that you have resolved the conflicts manually.
+Once you are done, you need to tell mercurial that you have resolved the
+conflicts manually.
.. L40
-$ hg resolve -m filename
+``$ hg resolve -m filename``
.. R40
@@ -314,12 +348,13 @@ You will now need to commit your changes, just like the simple merge that we per
.. L41
-$ hg commit -m "Merge heads."
-$ hg push
+``$ hg commit -m "Merge heads."
+$ hg push``
.. R41
-We could look at the graph of the changes, in our web interface, which makes clear how the merging has occurred.
+We could look at the graph of the changes, in our web interface, which makes
+clear how the merging has occurred.
.. L42
@@ -331,22 +366,25 @@ Here's an advice on the Work-flow to be followed.
.. L43
-{{{Show the slide 'Advice: Work-flow}}}
+*{{{Show the slide 'Advice: Work-flow}}}*
.. R43
-That brings us to the end of this tutorial on Mercurial. What we have covered is nothing close to all the features of Mercurial. We've only scratched the surface, but let's hope that this will get you started and you will be able to organize your work and projects, better.
+That brings us to the end of this tutorial on Mercurial. What we have covered
+is nothing close to all the features of Mercurial. We've only scratched the
+surface, but let's hope that this will get you started and you will be able to
+organize your work and projects, better.
.. L44
-{{{Show the 'summary' slide'}}}
+*{{{Show the 'summary' slide'}}}*
.. R45
In this tutorial, we have learnt to,
-1. Clone repositories, using hg clone,
+#. Clone repositories, using hg clone,
#. Serve our repositories via http using hg serve,
#. push changes to a repository using hg push,
#. check the changesets in a repository after last pull, using hg incoming,
@@ -357,33 +395,34 @@ In this tutorial, we have learnt to,
.. L46
-{{{Show the slide 'Evaluation'}}}
+*{{{Show the slide 'Evaluation'}}}*
.. R46
Here are some self assessment questions for you to solve
- 1. Mention the easiest way to get started on sharing your repository by providing a web interface
+ #. Mention the easiest way to get started on sharing your repository by providing a web interface
#.. Suppose Joey and Melissa have made simultaneous changes to the same file in their own systems. Would the output of hg parents before and after if one of them pulls in the changes and merges with it?
#. What are the commands involved in the process of merging changes?
.. L47
-{{{ Show Solution of self assessment questions on slide }}}
+*{{{ Show Solution of self assessment questions on slide }}}*
.. R47
And the answers,
- 1. hg serve
+ #. hg serve
#. No, whenever we've done a merge, hg parents will display two parents until we hg commit the results of the merge.
#. hg pull, hg merge, hg commit -m "Merged Remote changes"
.. L48
-{{{Show the slide 'Additional Reading'}}}
+*{{{Show the slide 'Additional Reading'}}}*
.. R48
-It is strongly recommended that you to go through the following topics, once you are comfortable with using Mercurial on a day-to-day basis.
- 1. .hgignore
+It is strongly recommended that you to go through the following topics, once
+you are comfortable with using Mercurial on a day-to-day basis.
+ #. .hgignore
#. hg rollback
#. hg bisect
#. hg backout
@@ -395,9 +434,10 @@ It is strongly recommended that you to go through the following topics, once you
.. R49
-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!