Differences between revisions 10 and 11
Revision 10 as of 2008-01-05 20:50:22
Size: 2101
Editor: abuehl
Comment:
Revision 11 as of 2008-01-12 14:09:48
Size: 2163
Editor: abuehl
Comment: lowercase links
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
In TutorialFirstChange, we created a ChangeSet in the {{{my-hello-new-output}}} ["Repository"]. Now we want to propagate that change somewhere else. In TutorialFirstChange, we created a [:ChangeSet:changeset] in the {{{my-hello-new-output}}} [:Repository:repository]. Now we want to propagate that change somewhere else.
Line 5: Line 5:
Following good Mercurial style, let's first ["Clone"] our original repository. Following good Mercurial style, let's first [:Clone:clone] our original repository.
Line 12: Line 12:
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. We can use the {{{tip}}} command to find out what the [:Tip: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 23: Line 23:
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 changesets that are in the other repository, but not yet in this one, into this one. 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:pulls] all changesets that are in the other repository, but not yet in this one, into this one.
Line 39: Line 39:
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 working directory still has its old pre-pull contents. The last line of output is important. By default, Mercurial does not update the [:WorkingDirectory:working directory] after a pull. This means that although the repository now contains the changeset, the file {{{hello.c}}} in the working directory still has its old pre-pull contents.
Line 41: Line 41:
We can ["Update"] this file (and any others that were changed during the pull) by following Mercurial's reminder: We can [:Update:update] this file (and any others that were changed during the pull) by following Mercurial's reminder:

Tutorial - sharing a change with another repository

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

Following good Mercurial style, let's first [:Clone:clone] our original repository.

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

We can use the tip command to find out what the [:Tip: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:pulls] all changesets 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:working directory] after a pull. This means that although the repository now contains the changeset, the file hello.c in the working directory still has its old pre-pull contents.

We can [:Update: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)