Differences between revisions 10 and 11
Revision 10 as of 2008-01-04 14:25:14
Size: 1848
Editor: abuehl
Comment: +cat
Revision 11 as of 2008-01-05 15:49:49
Size: 1714
Editor: abuehl
Comment:
Deletions are marked like this. Additions are marked like this.
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. 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.
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. 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.
Line 29: Line 29:
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. This file is a PatchFile in UnifiedDiff format, with some extra information that tells Mercurial how to ["Import"] it.
Line 31: Line 31:
When the recipient receives our email, they will save the attachment and use the {{{import}}} command to ["Import"] the ChangeSet into their ["Repository"].  (As of version 0.7, ["Mercurial"] ignores some of this information, making imports that involve merges problematic.) When the recipient receives our email, they will save the attachment and use the {{{import}}} command to import the changeset into their repository.
Line 34: Line 34:

Tutorial - sharing a change with another person

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.

After we have ["Commit"]ted a change, we can ["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"], 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.

$ hg export tip
# HG changeset patch
# User mpm@selenic.com
# Node ID a58809af174d89a3afbbbb48008d34deb30d8574
# Parent  82e55d328c8ca4ee16520036c0aaace03a5beb65
Express great joy at existence of Mercurial

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
@@ -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. This file is a PatchFile in UnifiedDiff format, with some extra information that tells Mercurial how to ["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.

Let's put ourselves in the position of such a recipient, and learn how to ["Merge"] a change in TutorialMerge.


CategoryTutorial

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