Differences between revisions 5 and 9 (spanning 4 versions)
Revision 5 as of 2005-08-26 01:37:09
Size: 2116
Editor: waste
Comment:
Revision 9 as of 2008-01-04 14:31:48
Size: 2162
Editor: abuehl
Comment: +cat
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Following good ["Mercurial"] style, we will first ["Clone"] our original ["Repository"]. Following good ["Mercurial"] style, let's first ["Clone"] our original ["Repository"].
Line 8: Line 8:
 $ cd ..
 $ hg clone my-hello my-hello-share
$ cd ..
$ hg clone my-hello my-hello-share
Line 11: Line 11:
We can use the {{{tip}}} command to find out what the ["Tip"] (remember, the most recent ChangeSet) in each ["Repository"] is. We pass in the {{{-q}}} option to keep ["Mercurial"] from printing a complete description of the ["Tip"].
We can use the {{{tip}}} command to find out what the ["Tip"] in each ["Repository"] is. (Remember, the ["Tip"] is the most recent ChangeSet.) We pass in the {{{-q}}} ("be quiet") option to keep ["Mercurial"] from printing a complete description of the ["Tip"].
Line 14: Line 15:
 $ cd my-hello-share
 $ hg -q tip
 2:bd2fb7137c85cd5e6b04db4c72a45699e0d90ea9
 $ cd ../my-hello-new-output
 $ hg -q tip
 3:da99cce05957f7a62b74d345fd55365dc33109f0
$ cd my-hello-share
$ hg -q tip
1:82e55d328c8c
$ cd ../my-hello-new-output
$ hg -q tip
2:a58809af174d
Line 21: Line 22:
Line 24: Line 26:
 $ cd ../my-hello-share
 $ hg pull ../my-hello-new-output
 pulling from ../my-hello-new-output
 searching for changes
 adding changesets
 adding manifests
 adding file revisions
 modifi
ed 1 files, added 1 changesets and 1 new revisions
 
(run 'hg update' to get a working copy)
$ cd ../my-hello-share
$ hg pull ../my-hello-new-output
pulling from ../my-hello-new-output
searching for changes
adding changesets
adding manifests
adding file changes
add
ed 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
Line 34: Line 36:
Unlike other ["Mercurial"] commands, {{{pull}}} is chatty. In this case, the ["Pull"] has succeeded.
Line 36: Line 37:
The last line of output is significant. By default, ["Mercurial"] does not update the WorkingDirectory after a ["Pull"]. This means that although the ["Repository"] now contains the ChangeSet, the file {{{hello.c}}} in the WorkingDirectory still has its old pre-["Pull"] contents. Unlike other common ["Mercurial"] commands, {{{pull}}} is chatty. In this case, the ["Pull"] has succeeded.
Line 38: Line 39:
We can ["Update"] this file (and any others that were updated during the ["Pull"]) by following ["Mercurial"]'s reminder: The last line of output is important. By default, ["Mercurial"] does not update the WorkingDirectory after a ["Pull"]. This means that although the ["Repository"] now contains the ChangeSet, the file {{{hello.c}}} in the WorkingDirectory still has its old pre-["Pull"] contents.

We can ["Update"] this file (and any others that were changed during the ["Pull"]) by following ["Mercurial"]'s reminder:
Line 41: Line 44:
 $ hg update $ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Line 43: Line 47:
Line 46: Line 51:
----
CategoryTutorial

Tutorial - sharing a change with another repository

In TutorialFirstChange, we created a ChangeSet in the my-hello-new-output ["Repository"]. Now we want to propagate that change somewhere else.

Following good ["Mercurial"] style, let's first ["Clone"] our original ["Repository"].

$ cd ..
$ hg clone my-hello my-hello-share

We can use the tip command to find out what the ["Tip"] in each ["Repository"] is. (Remember, the ["Tip"] is the most recent ChangeSet.) We pass in the -q ("be quiet") option to keep ["Mercurial"] from printing a complete description of the ["Tip"].

$ cd my-hello-share
$ hg -q tip
1:82e55d328c8c
$ cd ../my-hello-new-output
$ hg -q tip
2:a58809af174d

As we can see, the ["Tip"] is different in each. Let's go back to my-hello-share and propagate our new ChangeSet in there. To do this, we use the pull command, which ["Pull"]s all ["ChangeSet"]s that are in the other repository, but not yet in this one, into this one.

$ cd ../my-hello-share
$ hg pull ../my-hello-new-output
pulling from ../my-hello-new-output
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)

Unlike other common ["Mercurial"] commands, pull is chatty. In this case, the ["Pull"] has succeeded.

The last line of output is important. By default, ["Mercurial"] does not update the WorkingDirectory after a ["Pull"]. This means that although the ["Repository"] now contains the ChangeSet, the file hello.c in the WorkingDirectory still has its old pre-["Pull"] contents.

We can ["Update"] this file (and any others that were changed during the ["Pull"]) by following ["Mercurial"]'s reminder:

$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

At this point, we can check and see that my-hello-share and my-hello-new-output have identical contents and revision histories.

To share a change with another person, we continue to TutorialExport.


CategoryTutorial

TutorialShareChange (last edited 2012-11-11 19:48:16 by abuehl)