annotate hgscm/templates/workflow_guide.html @ 196:f56228c27391

workflow guide: changed 'we' to 'you' in one more place.
author Arne Babenhauserheide <bab@draketo.de>
date Wed, 10 Jun 2009 20:07:48 +0200
parents c3b7cf9896aa
children b17731a54e2a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
1 {% extends "base.html" %}
97
991719e0dbf5 Begun a workflow text.
Arne Babenhauserheide <bab@draketo.de>
parents:
diff changeset
2
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
3 {% load extras %}
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
4 {% block content %}
97
991719e0dbf5 Begun a workflow text.
Arne Babenhauserheide <bab@draketo.de>
parents:
diff changeset
5
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
6 <div class="row">
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
7 <div class="col big">
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
8
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
9
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
10 <h1>Learning Mercurial in Workflows</h1>
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
11
171
2e205989c44d fix typos.
Arne Babenhauserheide <bab@draketo.de>
parents: 168
diff changeset
12 <p>With Mercurial you can use a multitude of different workflows. This page shows some of them, including their use cases. It is intended to make it easy for beginners of version tracking to get going instantly and learn completely incrementally. It doesn't explain the concepts used, because there are already many other great resources doing that, for example <a title="Understanding Mercurial" href="http://www.selenic.com/mercurial/wiki/UnderstandingMercurial">the wiki</a> and <a title="Behind the Scenes" href="http://hgbook.red-bean.com/read/behind-the-scenes.html">the hgbook</a>.</p>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
13
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
14 <p>If you want a more exhaustive tutorial with the basics, please have a look at the <a title="Mercurial Tutorial" href="http://www.selenic.com/mercurial/wiki/Tutorial">Tutorial in the Mercurial Wiki</a>. For a really detailed and very nice to read description of Mercurial, please have a look at <a title="Mercurial: The definitive Guide" href="http://hgbook.red-bean.com/">Mercurial: The definitive Guide</a>.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
15
158
60678b7a5eb0 polishing
Arne Babenhauserheide <bab@draketo.de>
parents: 157
diff changeset
16 <p>Note: This guide doesn't require any prior knowledge of version control systems (though subversion users will likely feel at home quite quickly). Basic commandline abilities are helpful, because we'll use the commandline client. <!--If you already know other systems, please check our transition guides: svn, cvs, git, bzr --></p>
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
17 <h1 id="basic_workflow">Basic workflows</h1>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
18
185
c3b7cf9896aa workflow guide: 'later workflows build on previous ones.'
Arne Babenhauserheide <bab@draketo.de>
parents: 181
diff changeset
19 <p><em>We go from simple to more complex workflows. Those further down build on previous workflows.</em></p>
c3b7cf9896aa workflow guide: 'later workflows build on previous ones.'
Arne Babenhauserheide <bab@draketo.de>
parents: 181
diff changeset
20
181
9fbcdb15513b workflow_guide: Added log_keeping workflow to index.
Arne Babenhauserheide <bab@draketo.de>
parents: 176
diff changeset
21 <h2 id="log_keeping">Log keeping</h2>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
22
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
23 <h3>Use Case</h3>
101
7bcdd8b947fe workflows: small fixes.
Arne Babenhauserheide <bab@draketo.de>
parents: 100
diff changeset
24
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
25 <p>The first workflow is also the easiest one: You want to use Mercurial to be able to look back when you did which changes.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
26
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
27 <p>This workflow only requires an installed Mercurial and write access to some file storage (you almost definitely have that :) ). It shows the basic techniques for more complex workflows.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
28
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
29 <h3>Workflow</h3>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
30
163
9d7df1cd39d3 fix typo
Arne Babenhauserheide <bab@draketo.de>
parents: 160
diff changeset
31 <h5>Prepare Mercurial</h5>
129
177b4120c26b learning in workflows: Added info how to set the username.
Arne Babenhauserheide <bab@draketo.de>
parents: 128
diff changeset
32
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
33 <p>As first step, you should teach Mercurial your name. For that you open the file ~/.hgrc with a text-editor and add the ui section (user interaction) with your username:</p>
129
177b4120c26b learning in workflows: Added info how to set the username.
Arne Babenhauserheide <bab@draketo.de>
parents: 128
diff changeset
34
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
35 <pre>[ui]
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
36 username = Mr. Johnson <johnson@smith.com>
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
37
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
38 </pre>
129
177b4120c26b learning in workflows: Added info how to set the username.
Arne Babenhauserheide <bab@draketo.de>
parents: 128
diff changeset
39
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
40 <h5>Initialize the project</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
41
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
42 <pre>$ hg init project
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
43
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
44 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
45
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
46 <h5>Add files and track them</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
47
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
48 <pre>$ cd project
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
49 $ (add files)
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
50 $ hg add
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
51
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
52 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
53
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
54 <p>Note: You can also go into an existing directory with files and init the repository there. </p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
55
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
56 <pre>$ cd project
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
57 $ hg init
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
58
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
59 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
60
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
61 <p>Alternatively you can add only specific files instead of all files in the directory. Mercurial will then track only these files and won't know about the others. The following tells mercurial to track all files whose names begin with "file0" as well as file10, file11 and file12.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
62
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
63 <pre>$ hg add file0* file10 file11 file12
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
64
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
65 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
66
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
67 <h5>Save changes</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
68
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
69 <pre>$ (do some changes)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
70
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
71 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
72
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
73 <p>see which files changed, which have been added or removed, and which aren't tracked yet</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
74
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
75 <pre>$ hg status
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
76
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
77 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
78
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
79 <p>see the exact changes</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
80
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
81 <pre>$ hg diff
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
82
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
83 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
84
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
85 <p><hg>commit</hg> the changes.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
86
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
87 <pre>$ hg commit
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
88
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
89 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
90
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
91 <p>now an editor pops up and asks you for a commit message. Upon saving and closing the editor, your changes have been stored by Mercurial.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
92
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
93 <p>Note: You can also supply the commit message directly via <hg>hg commit -m 'MESSAGE'</hg>.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
94
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
95 <h5>Move and copy files</h5>
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
96
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
97 <p>When you copy or move files, you should tell Mercurial to do the copy or move for you, so it can track the relationship between the files.</p>
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
98
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
99 <p>Remember to <hg>commit</hg> after moving or copying. From the basic commands only <hg>commit</hg> creates a new revision</p>
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
100
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
101 <pre>$ hg cp original copy
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
102 $ hg commit
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
103 (enter the commit message)
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
104 $ hg mv original target
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
105 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
106 (enter the commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
107
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
108 </pre>
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
109
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
110 <p>Now you have two files, "copy" and "target", and Mercurial knows how they are related.</p>
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
111
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
112 <p>Note: Should you forget to do the explicit copy or move, you can still tell Mercurial to detect the changes via <hg>hg addremove --similarity 100</hg>. Just use <hg>hg help addremove</hg> for details.</p>
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
113
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
114 <h5>Check your history</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
115
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
116 <pre>$ hg log
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
117
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
118 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
119
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
120 <p>This prints a list of changesets along with their date, the user who committed them (you) and their commit message. </p>
130
77b10482cc47 learning in workflows: How to see a specific patch.
Arne Babenhauserheide <bab@draketo.de>
parents: 129
diff changeset
121
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
122 <p>To see a certain revision, you can use the <hg>-r</hg> switch (--revision). To also see the diff of the displayed revisions, there's the <hg>-p</hg> switch (--patch)</p>
130
77b10482cc47 learning in workflows: How to see a specific patch.
Arne Babenhauserheide <bab@draketo.de>
parents: 129
diff changeset
123
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
124 <pre>$ hg log -p -r 3
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
125
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
126 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
127
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
128 <h2 id="lone_developer">Lone developer with nonlinear history</h2>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
129
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
130 <h3>Use case</h3>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
131
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
132 <p>The second workflow is still very easy: You're a lone developer and you want to use Mercurial to keep track of your own changes.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
133
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
134 <p>It works just like the log keeping workflow, with the difference that you go back to earlied changes at times.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
135
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
136 <p>To start a new project, you initialize a repository, add your files and commit whenever you finished a part of your work.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
137
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
138 <p>Also you check your history from time to time, so see how you progressed.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
139
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
140 <h3>Workflow</h3>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
141
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
142 <h5>Basics from log keeping</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
143
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
144 <p>Init your project, add files, see changes and commit them.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
145
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
146 <pre>$ hg init project
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
147 $ cd project
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
148 $ (add files)
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
149 $ hg add # tell Mercurial to track all files
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
150 $ (do some changes)
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
151 $ hg diff # see changes
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
152 $ hg commit # save changes
152
1a01a60eeaf5 learning in workflows: Added mv and cp to the repeated basics in the Lone Dev workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 151
diff changeset
153 $ hg cp # copy files or folders
1a01a60eeaf5 learning in workflows: Added mv and cp to the repeated basics in the Lone Dev workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 151
diff changeset
154 $ hg mv # move files or folders
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
155 $ hg log # see history
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
156
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
157 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
158
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
159 <h5>Seeing an earlier revision</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
160
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
161 <p>Different from the log keeping workflow, you'll want to go back in history at times and do some changes directly there, for example because an earlier change introduced a bug and you want to fix it where it occurred.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
162
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
163 <p>To look at a previous version of your code, you can use update. Let's assume that you want to see revision 3.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
164
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
165 <pre>$ hg update 3
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
167 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
168
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
169 <p>Now your code is back at revision 3, the fourth commit (Mercurial starts counting at 0).
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
170 To check if you're really at that revision, you can use <hg>identify -n</hg>.</p>
136
0364cfc00295 learning in workflows: Added identify and update to 'null'
Arne Babenhauserheide <bab@draketo.de>
parents: 135
diff changeset
171
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
172 <pre>$ hg identify -n
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
173
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
174 </pre>
136
0364cfc00295 learning in workflows: Added identify and update to 'null'
Arne Babenhauserheide <bab@draketo.de>
parents: 135
diff changeset
175
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
176 <p>Note: <hg>identify</hg> without options gives you the short form of a unique revision ID. That ID is what Mercurial uses internally. If you tell someone about the version you updated to, you should use that ID, since the numbers can be different for other people. If you want to know the reasons behind that, please read up Mercurials [basic concepts](). When you're at the most recent revision, <hg>hg identify -n</hg> will return "-1".</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
177
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
178 <p>To update to the most recent revision, you can use "tip" as revision name.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
179
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
180 <pre>$ hg update tip
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
181
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
182 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
183
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
184 <p>Note: If at any place any command complains, your best bet is to read what it tells you and follow that advice.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
185
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
186 <p>Note: Instead of <hg>hg update</hg> you can also use the shorthand <hg>hg up</hg>. Similarly you can abbreviate <hg>hg commit</hg> to <hg>hg ci</hg>.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
187
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
188 <p>Note: To get a revision devoid of files, just <hg>update</hg> to "null" via <hg>hg update null</hg>. That's the revision before any files were added.</p>
136
0364cfc00295 learning in workflows: Added identify and update to 'null'
Arne Babenhauserheide <bab@draketo.de>
parents: 135
diff changeset
189
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
190 <h5>Fixing errors in earlier revisions</h5>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
191
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
192 <p>When you find a bug in some earlier revision you have two options: either you can fix it in the current code, or you can go back in history and fix the code exactly where you did it, which creates a cleaner history.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
193
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
194 <p>To do it the cleaner way, you first update to the old revision, fix the bug and commit it. Afterwards you merge this revision and commit the merge. Don't worry, though: Merging in mercurial is fast and painless, as you'll see in an instant.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
195
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
196 <p>Let's assume the bug was introduced in revision 3.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
197
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
198 <pre>$ hg update 3
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
199 $ (fix the bug)
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
200 $ hg commit
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
201
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
202 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
203
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
204 <p>Now the fix is already stored in history. We just need to merge it with the current version of your code.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
205
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
206 <pre>$ hg merge
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
207
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
208 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
209
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
210 <p>If there are conflicts use <hg>hg resolve</hg> - that's also what merge tells you to do in case of conflicts.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
211
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
212 <p>First list the files with conflicts</p>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
213
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
214 <pre>$ hg resolve --list
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
215
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
216 </pre>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
217
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
218 <p>Then resolve them one by one. <hg>resolve</hg> attempts the merge again</p>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
219
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
220 <pre>$ hg resolve conflicting_file
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
221 (fix it by hand, if necessary)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
222
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
223 </pre>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
224
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
225 <p>Mark the fixed file as resolved</p>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
226
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
227 <pre>$ hg resolve --mark conflicting_file
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
228
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
229 </pre>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
230
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
231 <p>Commit the merge, as soon as you resolved all conflicts. This step is also necessary when there were no conflicts!</p>
133
5e1cff189630 learning in workflows: Fix: Moved the resolve explanation to the first mention of resolve.
Arne Babenhauserheide <bab@draketo.de>
parents: 132
diff changeset
232
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
233 <pre>$ hg commit
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
234
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
235 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
236
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
237 <p>At this point, your fix is merged with all your other work, and you can just go on coding. Additionally the history shows clearly where you fixed the bug, so you'll always be able to check where the bug was.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
238
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
239 <p>Note: Most merges will just work. You only need <hg>resolve</hg>, when <hg>merge</hg> complains.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
240
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
241 <p>So now you can initialize repositories, save changes, update to previous changes and develop in a nonlinear history by committing in earlier changesets and merging the changes into the current code.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
242
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
243 <p>Note: If you fix a bug in an earlier revision, and some later revision copied or moved that file, the fix will be propagated to the target file(s) when you merge. This is the main reason why you should always use <hg>hg cp</hg> and <hg>hg mv</hg>.</p>
150
6d5a62a9821e learning in workflows: Added section on explicit file copy and move.
Arne Babenhauserheide <bab@draketo.de>
parents: 149
diff changeset
244
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
245 <h2 id="separate_features">Separate features</h2>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
246
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
247 <h3>Use Case</h3>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
248
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
249 <p>At times you'll be working on several features in parallel. If you want to avoid mixing incomplete code versions, you can create clones of your local repository and work on each feature in its own code directory.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
250
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
251 <p>After finishing your feature you then <hg>pull</hg> it back into your main directory and <hg>merge</hg> the changes.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
252
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
253 <h3>Workflow</h3>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
254
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
255 <h5>Work in different clones</h5>
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
256
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
257 <p>First create the feature clone and do some changes</p>
132
a7fb926c69f6 learning in workflows: fixed soem typos and did some clarifications.
Arne Babenhauserheide <bab@draketo.de>
parents: 131
diff changeset
258
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
259 <pre>$ hg clone project feature1
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
260 $ cd feature1
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
261 $ (do some changes and commits)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
262
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
263 </pre>
131
59b5985db58a learning in workflows: added 'incoming'
Arne Babenhauserheide <bab@draketo.de>
parents: 130
diff changeset
264
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
265 <p>Now check what will come in when you <hg>pull</hg> from feature1, just like you can use <hg>diff</hg> before committing. The respective command for pulling is <hg>incoming</hg></p>
131
59b5985db58a learning in workflows: added 'incoming'
Arne Babenhauserheide <bab@draketo.de>
parents: 130
diff changeset
266
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
267 <pre>$ cd ../project
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
268 $ hg incoming ../feature1
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
269
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
270 </pre>
131
59b5985db58a learning in workflows: added 'incoming'
Arne Babenhauserheide <bab@draketo.de>
parents: 130
diff changeset
271
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
272 <p>Note: If you want to see the diffs, you can use <hg>hg incoming --patch</hg> just as you can do with <hg>hg log --patch</hg> for the changes in the repository.</p>
131
59b5985db58a learning in workflows: added 'incoming'
Arne Babenhauserheide <bab@draketo.de>
parents: 130
diff changeset
273
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
274 <p>If you like the changes, you pull them into the project</p>
131
59b5985db58a learning in workflows: added 'incoming'
Arne Babenhauserheide <bab@draketo.de>
parents: 130
diff changeset
275
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
276 <pre>$ hg pull ../feature1
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
277
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
278 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
279
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
280 <p>Now you have the history of feature1 inside your project, but the changes aren't yet visible. Instead they are only stored inside a ".hg" directory of the project (<a title="Behind the Scenes" href="http://hgbook.red-bean.com/read/behind-the-scenes.html">more information on the store</a>).</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
281
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
282 <p>Note: From now on we'll use the name "repository" for a directory which has a .hg directory with Mercurial history.</p>
101
7bcdd8b947fe workflows: small fixes.
Arne Babenhauserheide <bab@draketo.de>
parents: 100
diff changeset
283
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
284 <p>If you didn't do any changes in the project, while you were working on feature1, you can just update to tip (<hg>hg update tip</hg>), but it is more likely that you'll have done some other changes in between changes. In that case, it's time for merging.</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
285
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
286 <p>Merge feature1 into the project code</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
287
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
288 <pre>$ hg merge
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
289
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
290 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
291
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
292 <p>If there are conflicts use <hg>hg resolve</hg> - that's also what merge tells you to do in case of conflicts. After you <hg>merge</hg>, you have to <hg>commit</hg> explicitely to make your <hg>merge</hg> final</p>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
293
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
294 <pre>$ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
295 (enter commit message, for example "merged feature1")
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
296
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
297 </pre>
99
71ff3b94b20d Added workflows sysadmin, lone developer and seperate features.
Arne Babenhauserheide <bab@draketo.de>
parents: 97
diff changeset
298
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
299 <p>You can create an arbitrary number of clones and also carry them around on USB sticks. Also you can use them to synchronize your files at home and at work, or between your desktop and your laptop.</p>
132
a7fb926c69f6 learning in workflows: fixed soem typos and did some clarifications.
Arne Babenhauserheide <bab@draketo.de>
parents: 131
diff changeset
300
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
301 <p>Note: You also have to commit after a merge when there are no conflicts, because merging creates new history and you might want to attach a specific message to the merge (like "merge feature1").</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
302
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
303 <h5>Rollback mistakes</h5>
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
304
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
305 <p>Now you can work on different features in parallel, but from time to time a bad commit might sneak in. Naturally you could then just go back one revision and merge the stray error, keeping all mistakes out of the merged revision. However, there's an easier way, if you realize your error before you do another <hg>commit</hg> or <hg>pull</hg>: <hg>rollback</hg>.</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
306
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
307 <p>Rolling back means undoing the last operation which added something to your history.</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
308
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
309 <p>Imagine you just realized that you did a bad commit - for example you didn't see a spelling error in a label. To fix it you would use</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
310
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
311 <pre>hg rollback
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
312
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
313 </pre>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
314
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
315 <p>And then redo the commit</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
316
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
317 <pre>hg commit -m "message"
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
318
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
319 </pre>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
320
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
321 <p>If you can use the command history of your shell and you added the previous message via <hg>commit -m "message"</hg>, that following commit just means two clicks on the arrow-key "up" and one click on "enter".</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
322
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
323 <p>Though it changes your history, rolling back doesn't change your files. It only undoes the last addition to your history.</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
324
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
325 <p>But beware, that a rollback itself can't be undone. If you <hg>rollback</hg> and then forget to commit, you can't just say "give me my old commit back". You have to create a new commit.</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
326
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
327 <p>Note: Rollback is possible, because Mercurial uses transactions when recording changes, and you can use the transaction record to undo the last transaction. This means that you can also use <hg>rollback</hg> to undo your last <hg>pull</hg>, if you didn't yet commit aything new.</p>
160
bb60a4d6a1e3 learning in workflows: Added rollback to the feature clone workflow.
Arne Babenhauserheide <bab@draketo.de>
parents: 159
diff changeset
328
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
329 <h2 id="sharing_changes">Sharing changes</h2>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
330
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
331 <h3>Use Case</h3>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
332
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
333 <p>Now we go one step further: You are no longer alone, and you want to share your changes with others and include their changes.</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
334
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
335 <p>The basic requirement for that is that you have to be able to see the changes of others.</p>
104
03591004ed44 workflows: Added plan for sharing via email and via shared repo (bitbucket).
Arne Babenhauserheide <bab@draketo.de>
parents: 103
diff changeset
336
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
337 <p>Mercurial allows you to do that very easily by including a simple webserver from which you can <hg>pull</hg> changes just as you can pull changes from local clones.</p>
104
03591004ed44 workflows: Added plan for sharing via email and via shared repo (bitbucket).
Arne Babenhauserheide <bab@draketo.de>
parents: 103
diff changeset
338
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
339 <p>Note: There are a few other ways to share changes, though. Instead of using the builtin webserver, you can also send the changes by email or setup a shared repository, to where you <hg>push</hg> changes instead of pulling them. We'll cover one of those later.</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
340
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
341 <h3>Workflow</h3>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
342
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
343 <h5>Using the builtin webserver</h5>
104
03591004ed44 workflows: Added plan for sharing via email and via shared repo (bitbucket).
Arne Babenhauserheide <bab@draketo.de>
parents: 103
diff changeset
344
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
345 <p>This is the easiest way to quickly share changes.</p>
104
03591004ed44 workflows: Added plan for sharing via email and via shared repo (bitbucket).
Arne Babenhauserheide <bab@draketo.de>
parents: 103
diff changeset
346
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
347 <p>First the one who wants to share his changes creates the webserver</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
348
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
349 <pre>$ hg serve
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
350
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
351 </pre>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
352
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
353 <p>Now all others can point their browsers to his IP address (for example 192.168.178.100) at port 8000. They will then see all his history there and can sdecide if they want to pull his changes.</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
354
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
355 <pre>$ firefox http://192.168.178.100:8000
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
356
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
357 </pre>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
358
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
359 <p>If they decide to include the changes, they just pull from the same URL</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
360
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
361 <pre>$ hg pull http://192.168.178.100:8000
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
362
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
363 </pre>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
364
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
365 <p>At this point you all can work as if you had pulled from a local repository. All the data is now in your individual repositories and you can merge the changes and work with them without needing any connection to the served repository.</p>
100
6e29cdea7b3a Workflows: Added basic sharing of changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 99
diff changeset
366
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
367 <h5>Sending changes by email</h5>
104
03591004ed44 workflows: Added plan for sharing via email and via shared repo (bitbucket).
Arne Babenhauserheide <bab@draketo.de>
parents: 103
diff changeset
368
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
369 <p>Often you won't have direct access to the repository of someone else, be it because he's behind a restrictive firewall, or because you live in different timezones. You might also want to keep your changes confidential and prefer internal email (if you want additional protection, you can also encrypt the emails, for example with <a href="http://gnupg.org" title="GnuPG">GnuPG</a>).</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
370
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
371 <p>In that case, you can easily export your changes as patches and send them by email.</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
372
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
373 <p>Another reason to send them by email can be that your policy requires manual review of the changes when the other developers are used to reading diffs in emails. I'm sure you can think of more reasons.</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
374
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
375 <p>Sending the changes via email is pretty straightforward with Mercurial. You just <hg>export</hg> your changes and attach (or copy paste) it in your email. Your collegues can then just <hg>import</hg> them.</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
376
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
377 <p>First check which changes you want to export</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
378
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
379 <pre>$ cd project
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
380 $ hg log
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
381
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
382 </pre>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
383
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
384 <p>We assume that you want to export changeset 3 and 4</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
385
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
386 <pre>$ hg export 3 > change3.diff
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
387 $ hg export 4 > change4.diff
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
388
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
389 </pre>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
390
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
391 <p>Now attach them to an email and your collegues can just run <hg>import</hg> on both diffs to get your full changes, including your user information.</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
392
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
393 <p>To be careful, they first <hg>clone</hg> their repository to have an integration directory as sandbox</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
394
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
395 <pre>$ hg clone project integration
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
396 $ cd integration
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
397 $ hg import change3.diff
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
398 $ hg import change4.diff
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
399
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
400 </pre>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
401
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
402 <p>That's it. They can now test your changes in feature clones. If they accept them, they <hg>pull</hg> the changes into the main repository</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
403
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
404 <pre>$ cd ../project
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
405 $ hg pull ../integration
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
406
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
407 </pre>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
408
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
409 <p>Note: The <em>patchbomb</em> extension automates the email-sending, but you don't need it for this workflow.</p>
108
ed683ad3947f learning in workflows: Send changes by email.
Arne Babenhauserheide <bab@draketo.de>
parents: 107
diff changeset
410
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
411 <p>Note 2: You can also send around bundles, which are snippets of your actual history. Just create them via </p>
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
412
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
413 <pre>$ hg bundle --base FIRST_REVISION_TO_BUNDLE changes.bundle
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
414
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
415 </pre>
167
af506d1a935d workflow_guide: added some missing <p> tags.
Arne Babenhauserheide <bab@draketo.de>
parents: 166
diff changeset
416
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
417 <p>Others can then get your changes by simply pulling them, as if your bundle were an actual repository</p>
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
418 <pre>$ hg pull path/to/changes.bundle
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
419
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
420 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
421
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
422 <h5>Using a shared repository</h5>
104
03591004ed44 workflows: Added plan for sharing via email and via shared repo (bitbucket).
Arne Babenhauserheide <bab@draketo.de>
parents: 103
diff changeset
423
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
424 <p>Sending changes by email might be the easiest way to reach people when you aren't yet part of the regular development team, but it creates additional workload: You have to <hg>bundle</hg> the changes, send mails and then <hg>import</hg> the bundles manually. Luckily there's an easier way which works quite well: The shared push repository.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
425
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
426 <p>Till now we transferred all changes either via email or via <hg>pull</hg>. Now we use another otion: pushing. As the name suggests it's just the opposite of pulling: You <hg>push</hg> your changes into another repository.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
427
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
428 <p>But to make use of it, we first need something we can push to.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
429
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
430 <p>By default <hg>hg serve</hg> doesn't allow pushing, since that would be a major security hole. You can allow pushing in the server, but that's no solution when you live in different timezones, so we'll go with another approach here: Using a shared repository, either on an existing shared server or on a service like <a title="BitBucket" href="http://bitbucket.org">BitBucket</a>. Doing so has a bit higher starting cost and takes a bit longer to explain, but it's well worth the effort spent.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
431
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
432 <p>If you want to use an existing shared server, you can use <hg>serve</hg> there and <a title="How to allow pushing for hg serve" href="http://www.selenic.com/mercurial/wiki/HgWebDirStepByStep#head-746ca383e3a62df34279ec2fca888113497da022">allow pushing</a>. Also there are some other nice ways to <a title="Multiple Committers" href="http://www.selenic.com/mercurial/wiki/MultipleCommitters">allow pushing to a Mercurial repository</a>, including simple <a title="Setting up a shared Mercurial repository using SSH" href="http://www.selenic.com/mercurial/wiki/SharedSSH">access via SSH</a>.</p>
135
8d069bba8cce learning in workflows: shared server now contains a bit more information for people with existing servers.
Arne Babenhauserheide <bab@draketo.de>
parents: 134
diff changeset
433
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
434 <p>Otherwise you first need to setup a BitBucket Account. Just signup at <a title="BitBucket" href="http://bitbucket.org">BitBucket</a>. After signing up (and login) hover your mouse over "Repositories". There click the item at the bottom of the opening dialog which say "Create new".</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
435
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
436 <p>Give it a name and a description. If you want to keep it hidden from the public, select "private"</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
437
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
438 <pre>$ firefox http://bitbucket.org
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
439
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
440 </pre>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
441
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
442 <p>Now your repository is created and you see instructions for <hg>push</hg>ing to it. for that you'll use a command similar to the following (just with a different URL)</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
443
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
444 <pre>$ hg push https://bitbucket.org/ArneBab/hello/
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
445
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
446 </pre>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
447
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
448 <p>(Replace the URL with the URL of your created repository. If your username is "Foo" and your repository is named "bar", the URL will be https://bitbucket.org/Foo/bar/)</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
449
174
8bb9f5869602 Bitbucket asks for name + password, not only the password.
Arne Babenhauserheide <bab@draketo.de>
parents: 171
diff changeset
450 <p>Mercurial will ask for your BitBucket name and password, then <hg>push</hg> your code.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
451
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
452 <p>Voilà, your code is online.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
453
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
454 <p>Note: You can also <a title="use SSH for pushing to BitBucket" href="http://bitbucket.org/help/UsingSSH">use SSH for pushing to BitBucket</a>.</p>
135
8d069bba8cce learning in workflows: shared server now contains a bit more information for people with existing servers.
Arne Babenhauserheide <bab@draketo.de>
parents: 134
diff changeset
455
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
456 <p>Now it's time to tell all your collegues to sign up at BitBucket, too.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
457
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
458 <p>After that you can click the "Admin" tab of your created repository and add the usernames of your collegues on the right side under "Permission: Writers". Now they are allowed to <hg>push</hg> code to the repository.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
459
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
460 <p>(If you chose to make the repository private, you'll need to add them to "Permission: Readers", too)</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
461
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
462 <p>If one of you now wants to publish changes, he'll simply <hg>push</hg> them to the repository, and all others get them by <hg>pull</hg>ing.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
463
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
464 <p>Publish your changes</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
465
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
466 <pre>$ hg push https://bitbucket.org/ArneBab/hello/
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
467
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
468 </pre>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
469
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
470 <p>Pull others changes into your local repository</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
471
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
472 <pre>$ hg pull https://bitbucket.org/ArneBab/hello/
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
473
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
474 </pre>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
475
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
476 <p>People who join you in development can also just <hg>clone</hg> this repository, as if one of you were using <hg>hg serve</hg></p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
477
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
478 <pre>$ hg clone https://bitbucket.org/ArneBab/hello/ hello
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
479
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
480 </pre>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
481
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
482 <p>That local repository will automatically be configured to pull/push from/to the online repository, so new contributors can just use <hg>hg push</hg> and <hg>hg pull</hg> without an URL.</p>
110
8c8c8aaaaad7 learning in workflows: added sharing changes.
Arne Babenhauserheide <bab@draketo.de>
parents: 108
diff changeset
483
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
484 <p>Note: To make this workflow more scaleable, each one of you can have his own BitBucket repository and you can simply <hg>pull</hg> from the others repositories. That way you can easily establish workflows in which certain people act as integrators and finally <hg>push</hg> checked code to a shared pull repository from which all others pull.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
485
159
83970c19b495 switched ssh repo url to user@example.com/path/ro/repo
Arne Babenhauserheide <bab@draketo.de>
parents: 158
diff changeset
486 <p>Note: You can also use this workflow with a shared server instead of BitBucket, either via SSH or via a shared directory. An example for an SSH URL with Mercurial is be ssh://user@example.com/path/to/repo. When using a shared directory you just push as if the repository in the shared directory were on your local drive.</p>
141
cf102ae37ad9 Added a note about using shared servers instead of bitbucket.org
Arne Babenhauserheide <bab@draketo.de>
parents: 140
diff changeset
487
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
488 <h2 id="basic_summary">Summary</h2>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
489
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
490 <p>Now let's take a step back and look where we are.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
491
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
492 <p>With the commands you already know, a bit reading of <hg>hg help &lt;command&gt;</hg> and some evil script-fu you can already do almost everything you'll ever need to do when working with source code history. So from now on almost everything is convenience, and that's a good thing.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
493
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
494 <p>First this is good, because it means, that you can now use most of the concepts which are utilized in more complex workflows.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
495
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
496 <p>Second it aids you, because convenience lets you focus on your task instead of focussing on your tool. It helps you concentrate on the coding itself. Still you can always go back to the basics, if you want to.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
497
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
498 <p>A short summary of what you can do which can also act as a short check, if you still remember the meaning of the commands.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
499
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
500 <h3>create a project</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
501
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
502 <pre>$ hg init project
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
503 $ cd project
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
504 $ (add some files)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
505 $ hg add
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
506 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
507 (enter the commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
508
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
509 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
510
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
511 <h3>do nonlinear development</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
512
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
513 <pre>$ (do some changes)
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
514 $ hg commit
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
515 (enter the commit message)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
516 $ hg update 0
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
517 $ (do some changes)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
518 $ hg commit
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
519 (enter the commit message)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
520 $ hg merge
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
521 $ (optionally hg resolve)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
522 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
523 (enter the commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
524
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
525 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
526
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
527 <h3>use feature clones</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
528
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
529 <pre>$ cd ..
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
530 $ hg clone project feature1
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
531 $ cd feature1
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
532 $ (do some changes)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
533 $ hg commit
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
534 (enter the commit message)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
535 $ cd ../project
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
536 $ hg pull ../feature1
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
537
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
538 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
539
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
540 <h3>share your repository via the integrated webserver</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
541
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
542 <pre>$ hg serve &amp;
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
543 $ cd ..
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
544 $ hg clone http://127.0.0.1:8000 project-clone
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
545
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
546 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
547
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
548 <h3>export changes to files</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
549
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
550 <pre>$ cd project-clone
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
551 $ (do some changes)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
552 $ hg commit
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
553 (enter the commit message)
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
554 $ hg export tip > ../changes.diff
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
555
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
556 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
557
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
558 <h3>import changes from files</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
559
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
560 <pre>$ cd ../project
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
561 $ hg import ../changes.diff
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
562
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
563 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
564
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
565 <h3>pull changes from a served repository (hg serve still runs on project)</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
566
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
567 <pre>$ cd ../feature1
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
568 $ hg pull http://127.0.0.1:8000
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
569
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
570 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
571
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
572 <h3>Use shared repositories on BitBucket</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
573
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
574 <pre>$ (setup bitbucket repo)
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
575 $ hg push https://bitbucket.org/USER/REPO
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
576 (enter name and password in the prompt)
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
577 $ hg pull https://bitbucket.org/USER/REPO
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
578
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
579 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
580
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
581
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
582 <p>Let's move on towards useful features and a bit more advanced workflows.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
583
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
584 <h1 id="advanced_workflows">Advanced workflows</h1>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
585
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
586 <h2 id="backing_out">Backing out bad revisions</h2>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
587
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
588 <h3>Use Case</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
589
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
590 <p>When you routinely pull code from others, it can happen that you overlook some bad change. As soon as others pull that change from you, you have little chance to get completely rid of it.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
591
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
592 <p>To resolve that problem, Mercurial offers you the <hg>backout</hg> command. Backing out a change means, that you tell Mercurial to create a commit which reverses the bad change. That way you don't get rid of the bad code in history, but you can remove it from new revisions.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
593
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
594 <p>Note: The basic commands don't directly rewrite history. If you want to do that, you need to activate some of the extensions which are shipped with mercurial. We'll come to that later on.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
595
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
596 <h3>Workflow</h3>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
597
196
f56228c27391 workflow guide: changed 'we' to 'you' in one more place.
Arne Babenhauserheide <bab@draketo.de>
parents: 185
diff changeset
598 <p>Let's assume the bad change was revision 3, and you already have one more revision in your
f56228c27391 workflow guide: changed 'we' to 'you' in one more place.
Arne Babenhauserheide <bab@draketo.de>
parents: 185
diff changeset
599 repository. To remove the bad code, you can just <hg>backout</hg> of it. This creates a new
f56228c27391 workflow guide: changed 'we' to 'you' in one more place.
Arne Babenhauserheide <bab@draketo.de>
parents: 185
diff changeset
600 change which reverses the bad change. After backing out, you can then merge that new change
f56228c27391 workflow guide: changed 'we' to 'you' in one more place.
Arne Babenhauserheide <bab@draketo.de>
parents: 185
diff changeset
601 into the current code.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
602
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
603 <pre>$ hg backout 3
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
604 $ hg merge
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
605 (potentially resolve conflicts)
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
606 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
607 (enter commit message. For example: "merged backout")
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
608
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
609 </pre>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
610
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
611 <p>That's it. You reversed the bad change. It's still recorded that it was once there (following the principle "don't rewrite history, if it's not really necessary"), but it doesn't affect future code anymore.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
612
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
613 <h2 id="collaborative_development">Collaborative feature development</h2>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
614
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
615 <p>Now that you can share changes and reverse them if necessary, you can go one step further: Using Mercurial to help in coordinating the coding.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
616
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
617 <p>The first part is an easy way to develop features together, without requiring every developer to keep track of several feature clones.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
618
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
619 <h3>Use Case</h3>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
620
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
621 <p>When you want to split your development into several features, you need to keep track of who works on which feature and where to get which changes.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
622
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
623 <p>Mercurial makes this easy for you by providing named branches. They are a part of the main repository, so they are available to everyone involved. At the same time, changes committed on a certain branch don't get mixed with the changes in the default branch, so features are kept separate, until they get merged into the default branch.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
624
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
625 <p>Note: Cloning a repository always puts you onto the default branch at first.</p>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
626
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
627 <h3>Workflow</h3>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
628
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
629 <p>When someone in your group wants to start coding on a feature without disturbing the others, he can create a named branch and commit there. When someone else wants to join in, he just updates to the branch and commits away. As soon as the feature is finished, someone merges the named branch into the default branch.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
630
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
631 <h5>Working in a named branch</h5>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
632
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
633 <p>Create the branch</p>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
634
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
635 <pre>$ hg branch feature1
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
636 (do some changes)
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
637 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
638 (write commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
639
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
640 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
641
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
642 <p>Update into the branch and work in it</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
643
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
644 <pre>$ hg update feature1
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
645 (do some changes)
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
646 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
647 (write commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
648
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
649 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
650
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
651 <p>Now you can <hg>commit</hg>, <hg>pull</hg>, <hg>push</hg> and <hg>merge</hg> (and anything else) as if you were working in a separate repository. If the history of the named branch is linear and you call "hg merge", Mercurial asks you to specify an explicit revision, since the branch in which you work doesn't have anything to merge.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
652
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
653 <h5>Merge the named branch</h5>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
654
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
655 <p>When you finished the feature, you <hg>merge</hg> the branch back into the default branch.</p>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
656
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
657 <pre>$ hg update default
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
658 $ hg merge feature1
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
659 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
660 (write commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
661
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
662 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
663
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
664 <p>And that's it. Now you can easily keep features separate without unnecessary bookkeeping.</p>
132
a7fb926c69f6 learning in workflows: fixed soem typos and did some clarifications.
Arne Babenhauserheide <bab@draketo.de>
parents: 131
diff changeset
665
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
666 <p>Note: Named branches stay in history as permanent record after you finished your work. If you don't like having that record in your history, please have a look at some of the advanced <a title="Mercurial Workflows" href="http://www.selenic.com/mercurial/wiki/Workflows">workflows</a>.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
667
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
668 <h2 id="tagging">Tagging revisions</h2>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
669
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
670 <h3>Use Case</h3>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
671
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
672 <p>Since you can now code separate features more easily, you might want to mark certain revisions as fit for consumption (or similar). For example you might want to mark releases, or just mark off revisions as reviewed.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
673
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
674 <p>For this Mercurial offers tags. Tags add a name to a revision and are part of the history. You can tag a change years after it was committed. The tag includes the information when it was added, and tags can be pulled, pushed and merged just like any other committed change.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
675
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
676 <p>Note: A tag must not contain the char ":", since that char is used for specifying multiple reivions - see "hg help revisions".</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
677
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
678 <p>Note: To securely mark a revision, you can use the <a title="Using GnuPG to securely sign revisions in Mercurial" href="http://www.selenic.com/mercurial/wiki/GpgExtension">gpg extension</a> to sign the tag.</p>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
679
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
680 <h3>Workflow</h3>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
681
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
682 <p>Let's assume you want to give revision 3 the name "v0.1".</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
683
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
684 <p>Add the tag</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
685
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
686 <pre>$ hg tag -r 3 v0.1
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
687
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
688 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
689
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
690 <p>See all tags</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
691
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
692 <pre>$ hg tags
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
693
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
694 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
695
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
696 <p>When you look at the log you'll now see a line in changeset 3 which marks the Tag. If someone wants to <hg>update</hg> to the tagged revision, he can just use the name of your tag</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
697
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
698 <pre>$ hg update v0.1
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
699
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
700 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
701
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
702 <p>Now he'll be at the tagged revision and can work from there.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
703
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
704
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
705 <h2 id="removing_history">Removing history</h2>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
706
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
707 <h3>Use Case</h3>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
708
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
709 <p>At times you will have changes in your repository, which you really don't want in it.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
710
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
711 <p>There are many advanced options for removing these, and most of them use great extensions (<a title="Mercurial Queues Extension" href="http://www.selenic.com/mercurial/wiki/MqExtension">Mercurial Queues</a> is the most often used one), but in this basic guide, we'll solve the problem with just the commands we already learned. But we'll use an option to clone which we didn't yet use.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
712
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
713 <p>This workflow becomes inconvenient when you need to remove changes, which are buried below many new changes. If you spot the bad changes early enough, you can get rid of them without too much effort, though.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
714
164
99bfbce775b0 workflow guide: use <h1>, <h2>, h3> and <h5> in the guide (<h4> doesn't really show)
Arne Babenhauserheide <bab@draketo.de>
parents: 163
diff changeset
715 <h3>Workflow</h3>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
716
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
717 <p>Let's assume you want to get rid of revision 2 and the highest revision is 3.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
718
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
719 <p>The first step is to use the "--rev" option to <hg>clone</hg>: Create a clone which only contains the changes up to the specified revision. Since you want to keep revision 1, you only clone up to that</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
720
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
721 <pre>$ hg clone -r 1 project stripped
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
722
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
723 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
724
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
725 <p>Now you can <hg>export</hg> the change 3 from the original repository (project) and <hg>import</hg> it into the stripped one</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
726
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
727 <pre>$ cd project
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
728 $ hg export 3 > ../changes.diff
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
729 $ cd ../stripped
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
730 $ hg import ../changes.diff
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
731
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
732 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
733
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
734 <p>If a part of the changes couldn't be applied, you'll see that part in *.rej files. If you have *.rej files, you'll have to include or discard changes by hand</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
735
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
736 <pre>$ cat *.rej
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
737 (apply changes by hand)
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
738 $ hg commit
166
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
739 (write commit message)
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
740
6358437dccf2 worgflow_guide: add an empty line after each code part.
Arne Babenhauserheide <bab@draketo.de>
parents: 165
diff changeset
741 </pre>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
742
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
743 <p>That's it. <hg>hg export</hg> also includes the commit message, date, committer and similar metadata, so you are already done.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
744
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
745 <p>Note: removing history will change the revision IDs of revisions after the removed one, and if you pull from someone else who still has the revision you removed, you will pull the removed parts again. That's why rewriting history should most times only be done for changes which you didn't yet publicise.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
746
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
747 <h2 id="advanced_summary">Summary</h2>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
748
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
749 <p>So now you can work with Mercurial in private, and also share your changes in a multitude of ways.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
750
168
b1b6c75efced polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 167
diff changeset
751 <p>Additionally you can remove bad changes, either by creating a change in the repository which reverses the original change, or by really rewriting history, so it looks like the change never occured.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
752
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
753 <p>And you can separate the work on features in a single repository by using named branches and add tags to revisions which are visible markers for others and can be used to update to the tagged revisions.</p>
124
0bee8982f334 learning in workflows mostly finished - I hope :) .
Arne Babenhauserheide <bab@draketo.de>
parents: 115
diff changeset
754
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
755 <p>With this we can conclude our practical guide.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
756
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
757 <h1 id="complex_workflows">More Complex Workflows</h1>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
758
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
759 <p>If you now want to check some more complex workflows, please have a look at the general <a title="Mercurial Workflows" href="http://selenic.com/mercurial/wiki/Workflows">workflows wikipage</a>.</p>
139
2fcd14a3b9f9 learning in workflows: Added a link to the (not yet written) basic concept overview for understanding.
Arne Babenhauserheide <bab@draketo.de>
parents: 138
diff changeset
760
155
5451a67b896f learning in workflows: Manually added linebreaks (<p> tags) and took the chance to do some more polishing.
Arne Babenhauserheide <bab@draketo.de>
parents: 154
diff changeset
761 <p>To deepen your understanding, you should also check the <a title="Overview of the basic concepts of Mercurial" href="quick_start_concepts">basic concept overview</a>.</p>
111
8b51ceb2d36b learning in workflows: Added backout.
Arne Babenhauserheide <bab@draketo.de>
parents: 110
diff changeset
762
156
bc05b688ac06 minor fix: no italics fo final 'Have fun'.
Arne Babenhauserheide <bab@draketo.de>
parents: 155
diff changeset
763 <p>Have fun with Mercurial!</p>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
764
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
765
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
766
165
4b997b34c671 FIX: workflow_guide had the download button at the bottom.
Arne Babenhauserheide <bab@draketo.de>
parents: 164
diff changeset
767 </div>
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
768 <div class="col">
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
769 <h2>Index</h2>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
770 <ul>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
771 <li><a href="#basic_workflow">Basic workflows</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
772 <ul>
181
9fbcdb15513b workflow_guide: Added log_keeping workflow to index.
Arne Babenhauserheide <bab@draketo.de>
parents: 176
diff changeset
773 <li><a href="#log_keeping">Log keeping</a></li>
176
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
774 <li><a href="#lone_developer">Lone developer with nonlinear history</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
775 <li><a href="#separate_features">Separate features</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
776 <li><a href="#sharing_changes">Sharing changes</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
777 <li><a href="#basic_summary">Summary</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
778 </ul>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
779 <li><a href="#advanced_workflows">Advanced workflows</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
780 <ul>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
781 <li><a href="#backing_out">Backing out bad revisions</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
782 <li><a href="#collaborative_development">Collaborative feature development</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
783 <li><a href="#tagging">Tagging revisions</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
784 <li><a href="#removing_history">Removing history</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
785 <li><a href="#advanced_summary">Summary</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
786 </ul>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
787 <li><a href="#complex_workflows">More complex workflows</a></li>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
788 </ul>
f73d4e6949bf Add index
David Soria Parra <dsp@php.net>
parents: 174
diff changeset
789
143
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
790 </div>
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
791 </div>
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
792
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
793 </div>
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
794
fc5a9f3e5479 Converted the workflow guide into html, added links and polished it.
Arne Babenhauserheide <bab@draketo.de>
parents: 141
diff changeset
795 {% endblock %}