Differences between revisions 11 and 15 (spanning 4 versions)
Revision 11 as of 2008-01-05 15:49:49
Size: 1714
Editor: abuehl
Comment:
Revision 15 as of 2008-05-07 09:50:15
Size: 1963
Editor: abuehl
Comment: adding navigation on top
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Tutorial - sharing a change with another person == == Tutorial - Sharing a change with another person ==
Line 3: Line 3:
In TutorialShareChange, we learned how to propagate a ChangeSet from one ["Repository"] to another. There are other ways of sharing changes between repositories and people, one of the most common is through email. ''(This page is part 6 of 9 of the [:Tutorial] series. Previous part is [:TutorialShareChange], next part is [:TutorialMerge])''
Line 5: Line 5:
After we have ["Commit"]ted a change, we can ["Export"] it to a file, and email the file as an attachment to someone else. In TutorialShareChange, we learned how to propagate a [:ChangeSet:changeset] from one [:Repository:repository] to another. There are other ways of sharing changes between repositories and people, one of the most common is through email.
Line 7: Line 7:
To export a change, we use the {{{export}}} command. We must provide a ["Tag"], RevisionNumber or ["ChangeSetID"] to tell Mercurial what to export. In our case, we want to export the ["Tip"]. Provided we're still in the {{{my-hello-share}}} directory, let's do just that. After we have [:Commit:committed] a change, we can [:Export:export] it to a file, and email the file as an attachment to someone else.

To export a change, we use the `export` command. We must provide a [:Tag:tag], [:RevisionNumber:revision number] or [:ChangeSetID:changeset ID] to tell Mercurial what to export. In our case, we want to export the [:Tip:tip]. Provided we're still in the `my-hello-share` directory, let's do just that.
Line 10: Line 12:
$ hg export tip
Line 13: Line 14:
# Node ID a58809af174d89a3afbbbb48008d34deb30d8574 # Date 1209943246 -7200
# Node ID 86794f718fb1ea9e633f7c052757663b8ce90e30
Line 17: Line 19:
diff -r 82e55d328c8c -r a58809af174d hello.c
--- a/hello.c Fri Aug 26 08:21:28 2005
+++ b/hello.c Fri Aug 26 08:26:28 2005
diff -r 82e55d328c8c -r 86794f718fb1 hello.c
--- a/hello.c Fri Aug 26 01:21:28 2005 -0700
+++ b/hello.c Mon May 05 01:20:46 2008 +0200
Line 29: Line 31:
By default, {{{export}}} just displays the patch, so usually we redirect the output to a file. This file is a PatchFile in UnifiedDiff format, with some extra information that tells Mercurial how to ["Import"] it. By default, `export` just displays the patch, so usually we redirect the output to a file (or use option -o). This file is a [:PatchFile:patch file] in [:UnifiedDiff:unified diff] format, with some extra information that tells Mercurial how to [:Import:import] it.
Line 31: Line 33:
When the recipient receives our email, they will save the attachment and use the {{{import}}} command to import the changeset into their repository. When the recipient receives our email, they will save the attachment and use the `import` command to import the changeset into their repository.
Line 33: Line 35:
Let's put ourselves in the position of such a recipient, and learn how to ["Merge"] a change in TutorialMerge. To learn how to [:Merge:merge] changes from diverged repositories, continue to [:TutorialMerge].

Tutorial - Sharing a change with another person

(This page is part 6 of 9 of the [:Tutorial] series. Previous part is [:TutorialShareChange], next part is [:TutorialMerge])

In TutorialShareChange, we learned how to propagate a [:ChangeSet:changeset] from one [:Repository:repository] to another. There are other ways of sharing changes between repositories and people, one of the most common is through email.

After we have [:Commit:committed] a change, we can [:Export:export] it to a file, and email the file as an attachment to someone else.

To export a change, we use the export command. We must provide a [:Tag:tag], [:RevisionNumber:revision number] or [:ChangeSetID:changeset ID] to tell Mercurial what to export. In our case, we want to export the [:Tip:tip]. Provided we're still in the my-hello-share directory, let's do just that.

# HG changeset patch
# User mpm@selenic.com
# Date 1209943246 -7200
# Node ID 86794f718fb1ea9e633f7c052757663b8ce90e30
# Parent  82e55d328c8ca4ee16520036c0aaace03a5beb65
Express great joy at existence of Mercurial

diff -r 82e55d328c8c -r 86794f718fb1 hello.c
--- a/hello.c   Fri Aug 26 01:21:28 2005 -0700
+++ b/hello.c   Mon May 05 01:20:46 2008 +0200
@@ -12,5 +12,6 @@
 int main(int argc, char **argv)
 {
        printf("hello, world!\n");
+       printf("sure am glad I'm using Mercurial!\n");
        return 0;
 }

By default, export just displays the patch, so usually we redirect the output to a file (or use option -o). This file is a [:PatchFile:patch file] in [:UnifiedDiff:unified diff] format, with some extra information that tells Mercurial how to [:Import:import] it.

When the recipient receives our email, they will save the attachment and use the import command to import the changeset into their repository.

To learn how to [:Merge:merge] changes from diverged repositories, continue to [:TutorialMerge].


CategoryTutorial

TutorialExport (last edited 2012-11-08 16:35:10 by abuehl)