Size: 1894
Comment:
|
Size: 1872
Comment:
|
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 9: | Line 9: |
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"]. By default, ["Export"] just displays the patch, so we redirect the output to a file. | 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"]. By default, ["Export"] just displays the patch, so we redirect the output to a file. |
Line 20: | Line 20: |
}}} | |
Line 22: | Line 21: |
{{{ | |
Line 24: | Line 22: |
}}} | |
Line 26: | Line 23: |
{{{ | |
Line 38: | Line 34: |
Line 41: | Line 36: |
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.6c, ["Mercurial"] ignores some of this information on import 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"]. (As of version 0.6c, ["Mercurial"] ignores some of this information on import making imports that involve merges problematic.) |
Tutorial - sharing a change with another person
In TutorialShareChange, we learned how to propagate a ChangeSet from one repository to another.
["Mercurial"] provides several ways of sharing changes between people, but 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"]. By default, ["Export"] just displays the patch, so we redirect the output to a file.
At this point, we should still be in the my-hello-share directory.
$ hg export tip > /tmp/my-patch $ cat /tmp/my-patch # HG changeset patch # User bos@camp4.serpentine.com # Node ID da99cce05957f7a62b74d345fd55365dc33109f0 # Parent bd2fb7137c85cd5e6b04db4c72a45699e0d90ea9 Express great joy at existence of Mercurial diff -r bd2fb7137c85 -r da99cce05957 hello.c --- a/hello.c Wed Jun 29 19:04:20 2005 +++ b/hello.c Wed Jun 29 19:58:37 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; }
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"]. (As of version 0.6c, ["Mercurial"] ignores some of this information on import making imports that involve merges problematic.)
Let's put ourselves in the position of that recipient, and learn how to ["Merge"] a change, in TutorialMerge.