Mercurial > hg-website
annotate templates/guide/index.html @ 418:005d07dfce2b
command hg log -v on its own line.
It was inconsistent before and that’s worse than losing 2 lines.
author | drak@kaverne |
---|---|
date | Thu, 18 Sep 2014 10:58:39 +0200 |
parents | 4c185817cc45 |
children | 19a6c35d52ff |
rev | line source |
---|---|
397
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1 {% extends "base.html" %} |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
2 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
3 {% block content %} |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
4 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
5 <h1>Learning Mercurial in Workflows</h1> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
6 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
7 <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. </p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
8 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
9 <p>Alternatives to this guide and further reading: </p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
10 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
11 <ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
12 <li> <a title="Mercurial Tutorial" href="http://www.selenic.com/mercurial/wiki/Tutorial">Tutorial</a> - a more exhaustive tutorial. </li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
13 <li><a title="Mercurial: The definitive Guide" href="http://hgbook.red-bean.com/">Mercurial: The Definitive Guide</a> - a very detailed description of Mercurial including <a title="Behind the Scenes" href="http://hgbook.red-bean.com/read/behind-the-scenes.html">behind the scenes</a>, an indepth article on the design of Mercurial.</li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
14 <li><a title="Understanding Mercurial" href="http://www.selenic.com/mercurial/wiki/UnderstandingMercurial">Understanding Mercurial</a> - the concepts behind Mercurial.</li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
15 </ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
16 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
17 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
18 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
19 This guide doesn't require any prior knowledge of version control systems (though subversion users will likely feel at home quite quickly). Basic command line abilities are helpful, because we'll use the command line client. <!--If you already know other systems, please check our transition guides: svn, cvs, git, bzr --> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
20 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
21 <h1 id="basic_workflow">Basic workflows</h1> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
22 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
23 <p><em>We go from simple to more complex workflows. Those further down build on previous workflows.</em></p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
24 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
25 <h2 id="log_keeping">Log keeping</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
26 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
27 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
28 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
29 <p>The first workflow is also the easiest one: You want to use Mercurial to be able to <strong>look back when you did which changes</strong>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
30 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
31 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
32 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
33 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
34 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
35 <h5>Prepare Mercurial</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
36 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
37 <p>As first step, you should teach Mercurial your name. For that you open the file ~/.hgrc (or mercurial.ini in your home directory for Windows) with a text-editor and add the ui section (user interaction) with your username:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
38 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
39 <pre>[ui] |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
40 username = Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
41 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
42 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
43 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
44 <h5>Initialize the project</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
45 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
46 <p>Now you add a new folder in which you want to work:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
47 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
48 <pre>$ hg init project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
49 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
50 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
51 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
52 <h5>Add files and track them</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
53 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
54 <p>Enter the project folder, create some files, then add and commit them.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
55 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
56 <pre>$ cd project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
57 $ echo 'print("Hello")' > hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
58 $ hg add |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
59 $ hg commit |
415
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
60 (your default editor opens, |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
61 enter the commit message, |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
62 save and close.) |
397
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
63 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
64 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
65 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
66 <div class="output">output of hg add: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
67 adding hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
68 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
69 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
70 <div class="output">display of hg commit (with your message): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
71 Initial commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
72 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
73 HG: Enter commit message. Lines beginning with 'HG:' are removed. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
74 HG: Leave message empty to abort commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
75 HG: -- |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
76 HG: user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
77 HG: branch 'default' |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
78 HG: added hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
79 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
80 |
415
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
81 <div class="note"> |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
82 <p class="note-title">Note:</p> |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
83 To avoid switching to an editor, you can also enter the commit |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
84 message on the command-line: |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
85 <pre>$ hg commit -m "[MESSAGE]" |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
86 |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
87 </pre> |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
88 </div> |
b40d4f1881cf
say that the editor opens on commit and note how to avoid that.
drak@kaverne
parents:
397
diff
changeset
|
89 |
397
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
90 <p>You can then look into your initial history with <em>hg log</em>:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
91 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
92 <pre>$ hg log |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
93 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
94 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
95 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
96 <div class="output">output of hg log: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
97 changeset: 0:a5ecbf5799c8 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
98 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
99 date: Sun Nov 20 11:00:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
100 summary: Initial commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
101 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
102 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
103 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
104 <div class="note"> |
416
38f7971e54a9
note that log only shows the first line of a commit message.
drak@kaverne
parents:
415
diff
changeset
|
105 <p class="note-title">Note:</p> By default Log only shows the first |
418 | 106 line of the commit message. To show the full message, use |
107 <pre>$ hg log-v | |
108 | |
109 </pre> | |
416
38f7971e54a9
note that log only shows the first line of a commit message.
drak@kaverne
parents:
415
diff
changeset
|
110 </div> |
38f7971e54a9
note that log only shows the first line of a commit message.
drak@kaverne
parents:
415
diff
changeset
|
111 |
38f7971e54a9
note that log only shows the first line of a commit message.
drak@kaverne
parents:
415
diff
changeset
|
112 <div class="note"> |
397
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
113 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
114 You can also go into an existing directory with files and init the repository there. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
115 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
116 <pre>$ cd project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
117 $ hg init |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
118 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
119 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
120 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
121 <p>Also 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
122 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
123 <pre>$ hg add file0* file10 file11 file12 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
124 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
125 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
126 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
127 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
128 <h5>Save changes</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
129 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
130 <p>First do some changes:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
131 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
132 <pre>$ echo 'print("Hello World") > hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
133 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
134 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
135 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
136 <p>see which files changed, which have been added or removed, and which aren't tracked yet</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
137 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
138 <pre>$ hg status |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
139 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
140 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
141 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
142 <div class="output">output of hg status: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
143 M hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
144 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
145 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
146 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
147 <p>see the exact changes</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
148 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
149 <pre>$ hg diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
150 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
151 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
152 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
153 <div class="output">output of hg diff: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
154 diff --git a/hello.py b/hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
155 --- a/hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
156 +++ b/hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
157 @@ -1,1 +1,1 @@ |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
158 -print("Hello") |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
159 +print("Hello World") |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
160 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
161 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
162 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
163 <p><em>commit</em> the changes.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
164 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
165 <pre>$ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
166 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
167 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
168 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
169 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
170 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
171 <div class="output">display of hg commit (with your message): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
172 Say Hello World, not just Hello. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
173 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
174 HG: Enter commit message. Lines beginning with 'HG:' are removed. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
175 HG: Leave message empty to abort commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
176 HG: -- |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
177 HG: user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
178 HG: branch 'default' |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
179 HG: changed hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
180 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
181 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
182 <p>Your history now looks like this:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
183 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
184 <div class="output">output of hg log: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
185 changeset: 1:487d7a20ccbc |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
186 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
187 date: Sun Nov 20 11:11:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
188 summary: Say Hello World, not just Hello. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
189 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
190 changeset: 0:a5ecbf5799c8 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
191 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
192 date: Sun Nov 20 11:00:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
193 summary: Initial commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
194 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
195 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
196 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
197 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
198 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
199 You can also supply the commit message directly via <em>hg commit -m 'MESSAGE'</em>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
200 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
201 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
202 <h5>Copy and move files</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
203 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
204 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
205 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
206 <p>Remember to <em>commit</em> after moving or copying. From the basic commands only <em>commit</em> creates a new revision</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
207 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
208 <pre>$ hg cp hello.py copy |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
209 $ hg mv hello.py target |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
210 $ hg diff # see the changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
211 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
212 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
213 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
214 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
215 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
216 <p>Now you have two files, "copy" and "target", and Mercurial knows how they are related.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
217 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
218 <div class="output">output of hg diff (before the commit): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
219 diff --git a/hello.py b/copy |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
220 rename from hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
221 rename to copy |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
222 diff --git a/hello.py b/target |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
223 copy from hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
224 copy to target |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
225 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
226 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
227 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
228 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
229 Should you forget to do the explicit copy or move, you can still tell Mercurial to detect the changes via <em>hg addremove --similarity 100</em>. Just use <em>hg help addremove</em> for details. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
230 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
231 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
232 <h5>Check your history</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
233 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
234 <pre>$ hg log |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
235 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
236 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
237 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
238 <p>This prints a list of changesets along with their date, the user who committed them (you) and their commit message. </p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
239 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
240 <div class="output">output of hg log: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
241 changeset: 2:70eb0ca9d264 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
242 tag: tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
243 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
244 date: Sun Nov 20 11:20:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
245 summary: Copy and move. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
246 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
247 changeset: 1:487d7a20ccbc |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
248 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
249 date: Sun Nov 20 11:11:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
250 summary: Say Hello World, not just Hello. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
251 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
252 changeset: 0:a5ecbf5799c8 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
253 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
254 date: Sun Nov 20 11:00:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
255 summary: Initial commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
256 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
257 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
258 <p>To see a certain revision, you can use the <em>-r</em> switch (--revision). To also see the diff of the displayed revisions, there's the <em>-p</em> switch (--patch)</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
259 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
260 <pre>$ hg log -p -r 3 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
261 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
262 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
263 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
264 <h2 id="lone_developer">Lone developer with nonlinear history</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
265 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
266 <h3>Use case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
267 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
268 <p>The second workflow is still very easy: You're a lone developer and you want to use Mercurial to <strong>keep track of your own changes</strong> and <strong>optimize your workflow</strong>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
269 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
270 <p>It works just like the log keeping workflow, with the difference that you go back to earlier changes at times and work onwards from there.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
271 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
272 <p>To start a new project, you initialize a repository, add your files and commit whenever you finished a part of your work.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
273 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
274 <p>Also you check your history from time to time, so see how you progressed.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
275 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
276 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
277 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
278 <h5>Basics from log keeping</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
279 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
280 <p>Init your project, add files, see changes and commit them.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
281 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
282 <pre>$ hg init project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
283 $ cd project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
284 $ (add files) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
285 $ hg add # tell Mercurial to track all files |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
286 $ (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
287 $ hg diff # see changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
288 $ hg commit # save changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
289 $ hg cp # copy files or folders |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
290 $ hg mv # move files or folders |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
291 $ hg log # see history |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
292 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
293 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
294 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
295 <h5>Seeing an earlier revision</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
296 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
297 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
298 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
299 <p>To look at a previous version of your code, you can use update. Let's assume that you want to see revision 1.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
300 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
301 <pre>$ hg update 1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
302 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
303 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
304 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
305 <p>Now your code is back at revision 1, the second commit (Mercurial starts counting at 0). |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
306 To check if you're really at that revision, you can use <em>identify -n</em>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
307 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
308 <pre>$ hg identify -n |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
309 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
310 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
311 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
312 <div class="output">output of hg identify -n: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
313 1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
314 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
315 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
316 <div class="output">output of ls: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
317 hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
318 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
319 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
320 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
321 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
322 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
323 <em>identify</em> 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 [<a href="http://mercurial.selenic.com/wiki/UnderstandingMercurial">basic concepts</a>]. When you're at the most recent revision, <em>hg identify -n</em> will return "-1". |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
324 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
325 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
326 <p>To update to the most recent revision, you can use "tip" as revision name.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
327 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
328 <pre>$ hg update tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
329 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
330 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
331 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
332 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
333 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
334 If at any place any command complains, your best bet is to read what it tells you and follow that advice. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
335 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
336 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
337 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
338 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
339 Instead of <em>hg update</em> you can also use the shorthand <em>hg up</em>. Similarly you can abbreviate <em>hg commit</em> to <em>hg ci</em>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
340 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
341 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
342 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
343 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
344 To get a revision devoid of files, just <em>update</em> to "null" via <em>hg update null</em>. That's the revision before any files were added. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
345 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
346 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
347 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
348 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
349 If the output of <em>hg identify</em> ends in a “+”, your repository has uncommitted changes. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
350 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
351 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
352 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
353 <h5>Fixing errors in earlier revisions</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
354 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
355 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
356 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
357 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
358 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
359 <p>Let's assume the bug was introduced in revision 1.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
360 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
361 <pre>$ hg update 1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
362 $ echo 'print("Hello Mercurial")' > hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
363 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
364 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
365 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
366 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
367 <div class="output">output of hg commit (after entering the message): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
368 created new head |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
369 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
370 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
371 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
372 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
373 “created new head” means that there is now one more revision, which does not have children. Heads are current states of your project living side by side. It is good style to merge them together before propagating them. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
374 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
375 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
376 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
377 <p>Now the fix is already stored in history. We just need to merge it with the current version of your code.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
378 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
379 <pre>$ hg merge |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
380 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
381 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
382 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
383 <div class="output">output of hg merge (here): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
384 merging hello.py and copy to copy |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
385 merging hello.py and target to target |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
386 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
387 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
388 <p>If there are conflicts use <em>hg resolve</em> - that's also what merge tells you to do in case of conflicts.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
389 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
390 <p>First list the files with conflicts</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
391 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
392 <pre>$ hg resolve --list |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
393 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
394 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
395 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
396 <p>Then resolve them one by one. <em>resolve</em> attempts the merge again</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
397 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
398 <pre>$ hg resolve conflicting_file |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
399 (fix it by hand, if necessary) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
400 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
401 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
402 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
403 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
404 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
405 For more details on resolving conflicts, see the wiki-page <a title="Tutorial - Merging conflicting Changes" href="http://mercurial.selenic.com/wiki/TutorialConflict">TutorialConflict</a>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
406 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
407 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
408 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
409 <p>Mark the fixed file as resolved</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
410 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
411 <pre>$ hg resolve --mark conflicting_file |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
412 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
413 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
414 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
415 <p>Commit the merge, as soon as you resolved all conflicts. This step is also necessary when there were no conflicts!</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
416 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
417 <pre>$ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
418 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
419 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
420 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
421 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
422 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
423 <div class="output">output of hg log (after the final commit): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
424 changeset: 4:3b06bba7c1a9 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
425 tag: tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
426 parent: 3:7ff5cd572d80 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
427 parent: 2:70eb0ca9d264 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
428 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
429 date: Sun Nov 20 20:11:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
430 summary: merge greeting and copy+move. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
431 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
432 changeset: 3:7ff5cd572d80 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
433 parent: 1:487d7a20ccbc |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
434 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
435 date: Sun Nov 20 20:00:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
436 summary: Greet Mercurial |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
437 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
438 changeset: 2:70eb0ca9d264 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
439 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
440 date: Sun Nov 20 11:20:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
441 summary: Copy and move. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
442 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
443 changeset: 1:487d7a20ccbc |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
444 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
445 date: Sun Nov 20 11:11:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
446 summary: Say Hello World, not just Hello. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
447 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
448 changeset: 0:a5ecbf5799c8 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
449 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
450 date: Sun Nov 20 11:00:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
451 summary: Initial commit. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
452 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
453 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
454 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
455 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
456 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
457 Most merges will just work. You only need <em>resolve</em>, when <em>merge</em> complains. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
458 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
459 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
460 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
461 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
462 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
463 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
464 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 <em>hg cp</em> and <em>hg mv</em>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
465 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
466 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
467 <h2 id="separate_features">Separate features</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
468 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
469 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
470 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
471 <p>At times you'll be <strong>working on several features in parallel</strong>. 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
472 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
473 <p>After finishing your feature you then <em>pull</em> it back into your main directory and <em>merge</em> the changes.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
474 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
475 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
476 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
477 <h5>Work in different clones</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
478 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
479 <p>First create the feature clone and do some changes</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
480 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
481 <pre>$ hg clone project feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
482 $ cd feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
483 $ hg update 3 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
484 $ echo 'print("Hello feature1")' > hello.py |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
485 $ hg commit -m "Greet feature1" |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
486 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
487 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
488 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
489 <p>Now check what will come in when you <em>pull</em> from feature1, just like you can use <em>diff</em> before committing. The respective command for pulling is <em>incoming</em></p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
490 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
491 <pre>$ cd ../project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
492 $ hg incoming ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
493 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
494 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
495 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
496 <div class="output">output of hg incoming ../feature1: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
497 comparing with ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
498 searching for changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
499 changeset: 5:3eb7b39fcf57 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
500 tag: tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
501 parent: 3:7ff5cd572d80 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
502 user: Arne Babenhauserheide <bab@draketo.de> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
503 date: Sun Nov 20 20:11:11 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
504 summary: Greet feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
505 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
506 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
507 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
508 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
509 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
510 If you want to see the diffs, you can use <em>hg incoming --patch</em> just as you can do with <em>hg log --patch</em> for the changes in the repository. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
511 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
512 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
513 <p>If you like the changes, you pull them into the project</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
514 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
515 <pre>$ hg pull ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
516 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
517 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
518 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
519 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
520 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
521 <div class="output">output of hg pull: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
522 pulling from ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
523 searching for changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
524 adding changesets |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
525 adding manifests |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
526 adding file changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
527 added 1 changesets with 1 changes to 1 files (+1 heads) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
528 (run 'hg heads' to see heads, 'hg merge' to merge) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
529 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
530 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
531 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
532 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
533 From now on we'll use the name "repository" for a directory which has a .hg directory with Mercurial history. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
534 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
535 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
536 <p>If you didn't do any changes in the project, while you were working on feature1, you can just update to tip (<em>hg update tip</em>), 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
537 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
538 <p>Merge feature1 into the project code</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
539 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
540 <pre>$ hg merge |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
541 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
542 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
543 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
544 <p>If there are conflicts use <em>hg resolve</em> - that's also what merge tells you to do in case of conflicts. After you <em>merge</em>, you have to <em>commit</em> explicitly to make your <em>merge</em> final</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
545 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
546 <pre>$ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
547 (enter commit message, for example "merged feature1") |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
548 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
549 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
550 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
551 <div class="output">output of hg log -r -1:-3 (the last 3 changesets): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
552 changeset: 6:e8a33691171a |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
553 tag: tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
554 parent: 4:3b06bba7c1a9 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
555 parent: 5:3eb7b39fcf57 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
556 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
557 date: Sun Nov 20 20:20:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
558 summary: merged feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
559 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
560 changeset: 5:3eb7b39fcf57 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
561 parent: 3:7ff5cd572d80 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
562 user: Arne Babenhauserheide <bab@draketo.de> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
563 date: Sun Nov 20 20:11:11 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
564 summary: Greet feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
565 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
566 changeset: 4:3b06bba7c1a9 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
567 parent: 3:7ff5cd572d80 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
568 parent: 2:70eb0ca9d264 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
569 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
570 date: Sun Nov 20 20:11:00 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
571 summary: merge greeting and copy+move. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
572 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
573 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
574 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
575 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
576 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
577 Mercurial offers powerful ways specify revisions. Too see them all, use <em>hg help revsets</em>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
578 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
579 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
580 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
581 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
582 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
583 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
584 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
585 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"). |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
586 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
587 |
417
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
588 |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
589 <div class="note"> |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
590 <p class="note-title">Note: Tracking empty folders</p> |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
591 |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
592 If you need empty folders which are available after clone, add |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
593 a <code>.keep</code> file in the folder and add that. |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
594 |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
595 <pre>$ mkdir emptyfolder |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
596 $ touch emptyfolder/.keep |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
597 $ hg add emptyfolder/.keep |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
598 $ hg commit -m "ensure that emptyfolder is available." emptyfolder/.keep |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
599 |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
600 </pre> |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
601 </div> |
4c185817cc45
Describe the canonical way to track folders: .keep files.
drak@kaverne
parents:
416
diff
changeset
|
602 |
397
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
603 <h5>Rollback mistakes</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
604 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
605 <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 <em>commit</em> or <em>pull</em>: <em>rollback</em>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
606 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
607 <p>Rolling back means undoing the last operation which added something to your history.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
608 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
609 <p>Imagine you just realized that you did a bad commit - for example you didn't see a spelling error in a commit message. To fix it you would use</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
610 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
611 <pre>$ hg rollback |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
612 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
613 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
614 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
615 <div class="output">output of hg rollback: |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
616 repository tip rolled back to revision 5 (undo commit) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
617 working directory now based on revisions 4 and 5 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
618 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
619 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
620 <p>And then redo the commit</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
621 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
622 <pre>$ hg commit -m "Merged Feature 1" |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
623 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
624 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
625 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
626 <div class="output">output of hg log -r -1:-2 (after rollback and commit): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
627 changeset: 6:3f549b33c7ef |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
628 tag: tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
629 parent: 4:3b06bba7c1a9 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
630 parent: 5:3eb7b39fcf57 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
631 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
632 date: Sun Nov 20 20:20:11 2011 +1100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
633 summary: Merged Feature 1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
634 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
635 changeset: 5:3eb7b39fcf57 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
636 parent: 3:7ff5cd572d80 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
637 user: Arne Babenhauserheide <bab@draketo.de> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
638 date: Sun Nov 20 20:11:11 2011 +0100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
639 summary: Greet feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
640 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
641 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
642 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
643 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
644 <p>If you can use the command history of your shell and you added the previous message via <em>commit -m "message"</em>, that following commit just means two clicks on the arrow-key "up" and one click on "enter".</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
645 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
646 <p>Though it changes your history, rolling back doesn't change your files. It only undoes the last addition to your history.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
647 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
648 <p>But beware, that a rollback itself can't be undone. If you <em>rollback</em> and then forget to commit, you can't just say "give me my old commit back". You have to create a new commit.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
649 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
650 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
651 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
652 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 <em>rollback</em> to undo your last <em>pull</em>, if you didn't yet commit anything new. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
653 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
654 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
655 <h2 id="sharing_changes">Sharing changes</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
656 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
657 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
658 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
659 <p>Now we go one step further: You are no longer alone, and you want to <strong>share your changes with others and include their changes</strong>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
660 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
661 <p>The basic requirement for that is that you have to be able to see the changes of others.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
662 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
663 <p>Mercurial allows you to do that very easily by including a simple webserver from which you can <em>pull</em> changes just as you can pull changes from local clones.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
664 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
665 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
666 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
667 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 <em>push</em> changes instead of pulling them. We'll cover one of those later. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
668 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
669 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
670 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
671 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
672 <h5>Using the builtin webserver</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
673 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
674 <p>This is the easiest way to quickly share changes.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
675 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
676 <p>First the one who wants to share his changes creates the webserver</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
677 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
678 <pre>$ hg serve |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
679 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
680 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
681 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
682 <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 decide if they want to pull his changes.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
683 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
684 <pre>$ firefox http://192.168.178.100:8000 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
685 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
686 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
687 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
688 <p>If they decide to include the changes, they just pull from the same URL</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
689 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
690 <pre>$ hg pull http://192.168.178.100:8000 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
691 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
692 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
693 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
694 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
695 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
696 <h5>Sending changes by email</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
697 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
698 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
699 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
700 <p>In that case, you can easily export your changes as patches and send them by email.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
701 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
702 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
703 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
704 <p>Sending the changes via email is pretty straightforward with Mercurial. You just <em>export</em> your changes and attach (or copy paste) it in your email. Your colleagues can then just <em>import</em> them.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
705 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
706 <p>First check which changes you want to export</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
707 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
708 <pre>$ cd project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
709 $ hg log |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
710 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
711 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
712 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
713 <p>We assume that you want to export changeset 3 and 4</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
714 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
715 <pre>$ hg export 3 > change3.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
716 $ hg export 4 > change4.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
717 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
718 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
719 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
720 <p>Now attach them to an email and your colleagues can just run <em>import</em> on both diffs to get your full changes, including your user information.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
721 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
722 <p>To be careful, they first <em>clone</em> their repository to have an integration directory as sandbox</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
723 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
724 <pre>$ hg clone project integration |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
725 $ cd integration |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
726 $ hg import change3.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
727 $ hg import change4.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
728 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
729 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
730 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
731 <p>That's it. They can now test your changes in feature clones. If they accept them, they <em>pull</em> the changes into the main repository</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
732 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
733 <pre>$ cd ../project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
734 $ hg pull ../integration |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
735 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
736 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
737 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
738 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
739 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
740 The <em>patchbomb</em> extension automates the email-sending, but you don't need it for this workflow. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
741 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
742 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
743 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
744 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
745 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
746 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
747 You can also send around bundles, which are snippets of your actual history. Just create them via |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
748 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
749 <pre>$ hg bundle --base FIRST_REVISION_TO_BUNDLE changes.bundle |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
750 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
751 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
752 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
753 Others can then get your changes by simply pulling them, as if your bundle were an actual repository |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
754 <pre>$ hg pull path/to/changes.bundle |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
755 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
756 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
757 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
758 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
759 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
760 <h5>Using a shared repository</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
761 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
762 <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 <em>bundle</em> the changes, send mails and then <em>import</em> the bundles manually. Luckily there's an easier way which works quite well: The shared push repository.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
763 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
764 <p>Till now we transferred all changes either via email or via <em>pull</em>. Now we use another option: pushing. As the name suggests it's just the opposite of pulling: You <em>push</em> your changes into another repository.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
765 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
766 <p>But to make use of it, we first need something we can push to.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
767 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
768 <p>By default <em>hg serve</em> 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
769 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
770 <p>If you want to use an existing shared server, you can use <em>serve</em> 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
771 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
772 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
773 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
774 <p>Give it a name and a description. If you want to keep it hidden from the public, select "private"</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
775 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
776 <pre>$ firefox http://bitbucket.org |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
777 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
778 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
779 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
780 <p>Now your repository is created and you see instructions for <em>push</em>ing to it. For that you'll use a command similar to the following (just with a different URL):</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
781 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
782 <pre>$ hg push https://bitbucket.org/ArneBab/hello/ |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
783 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
784 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
785 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
786 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
787 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
788 <p>Mercurial will ask for your BitBucket name and password, then <em>push</em> your code.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
789 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
790 <p>Voilà, your code is online.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
791 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
792 <p>To see what you would get if you would push, you can use outgoing. It works with local repositories in the same way as with shared ones, so you can test it with a local one:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
793 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
794 <pre>$ hg outgoing ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
795 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
796 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
797 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
798 <div class="output">output of hg outgoing ../feature1 (our feature seperation repo): |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
799 comparing with ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
800 searching for changes |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
801 changeset: 6:3f549b33c7ef |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
802 tag: tip |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
803 parent: 4:3b06bba7c1a9 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
804 parent: 5:3eb7b39fcf57 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
805 user: Mr. Johnson <johnson@smith.com> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
806 date: Sun Nov 20 20:20:11 2011 +1100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
807 summary: Merged Feature 1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
808 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
809 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
810 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
811 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
812 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
813 You can also <a title="use SSH for pushing to BitBucket" href="http://bitbucket.org/help/UsingSSH">use SSH for pushing to BitBucket</a>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
814 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
815 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
816 <p>Now it's time to tell all your colleagues to sign up at BitBucket, too.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
817 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
818 <p>After that you can click the "Admin" tab of your created repository and add the usernames of your colleagues on the right side under "Permission: Writers". Now they are allowed to <em>push</em> code to the repository.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
819 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
820 <p>(If you chose to make the repository private, you'll need to add them to "Permission: Readers", too)</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
821 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
822 <p>If one of you now wants to publish changes, he'll simply <em>push</em> them to the repository, and all others get them by <em>pull</em>ing.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
823 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
824 <p>Publish your changes</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
825 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
826 <pre>$ hg push https://bitbucket.org/ArneBab/hello/ |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
827 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
828 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
829 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
830 <p>Pull others changes into your local repository</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
831 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
832 <pre>$ hg pull https://bitbucket.org/ArneBab/hello/ |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
833 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
834 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
835 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
836 <p>People who join you in development can also just <em>clone</em> this repository, as if one of you were using <em>hg serve</em></p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
837 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
838 <pre>$ hg clone https://bitbucket.org/ArneBab/hello/ hello |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
839 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
840 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
841 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
842 <p>That local repository will automatically be configured to pull/push from/to the online repository, so new contributors can just use <em>hg push</em> and <em>hg pull</em> without an URL.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
843 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
844 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
845 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
846 To make this workflow more scalable, each one of you can have his own BitBucket repository and you can simply <em>pull</em> from the others repositories. That way you can easily establish workflows in which certain people act as integrators and finally <em>push</em> checked code to a shared pull repository from which all others pull. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
847 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
848 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
849 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
850 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
851 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. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
852 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
853 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
854 <h2 id="basic_summary">Summary</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
855 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
856 <p>Now let's take a step back and look where we are.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
857 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
858 <p>With the commands you already know, a bit reading of <em>hg help <command></em> 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
859 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
860 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
861 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
862 <p>Second it aids you, because convenience lets you focus on your task instead of focusing 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
863 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
864 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
865 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
866 <h3>create a project</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
867 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
868 <pre>$ hg init project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
869 $ cd project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
870 $ (add some files) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
871 $ hg add |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
872 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
873 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
874 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
875 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
876 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
877 <h3>do nonlinear development</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
878 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
879 <pre>$ (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
880 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
881 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
882 $ hg update 0 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
883 $ (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
884 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
885 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
886 $ hg merge |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
887 $ (optionally hg resolve) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
888 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
889 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
890 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
891 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
892 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
893 <h3>use feature clones</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
894 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
895 <pre>$ cd .. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
896 $ hg clone project feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
897 $ cd feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
898 $ (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
899 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
900 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
901 $ cd ../project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
902 $ hg pull ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
903 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
904 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
905 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
906 <h3>share your repository via the integrated webserver</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
907 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
908 <pre>$ hg serve & |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
909 $ cd .. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
910 $ hg clone http://127.0.0.1:8000 project-clone |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
911 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
912 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
913 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
914 <h3>export changes to files</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
915 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
916 <pre>$ cd project-clone |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
917 $ (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
918 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
919 (enter the commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
920 $ hg export tip > ../changes.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
921 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
922 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
923 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
924 <h3>import changes from files</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
925 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
926 <pre>$ cd ../project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
927 $ hg import ../changes.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
928 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
929 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
930 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
931 <h3>pull changes from a served repository (hg serve still runs on project)</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
932 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
933 <pre>$ cd ../feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
934 $ hg pull http://127.0.0.1:8000 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
935 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
936 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
937 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
938 <h3>Use shared repositories on BitBucket</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
939 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
940 <pre>$ (setup bitbucket repo) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
941 $ hg push https://bitbucket.org/USER/REPO |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
942 (enter name and password in the prompt) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
943 $ hg pull https://bitbucket.org/USER/REPO |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
944 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
945 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
946 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
947 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
948 <p>Let's move on towards useful features and a bit more advanced workflows.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
949 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
950 <h1 id="advanced_workflows">Advanced workflows</h1> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
951 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
952 <h2 id="backing_out">Backing out bad revisions</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
953 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
954 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
955 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
956 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
957 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
958 <p>To resolve that fundamental problem in any really distributed system, Mercurial offers you the <em>backout</em> command. Backing out a change means, that you tell Mercurial to <strong>create a commit which reverses the bad change</strong>. That way you don't get rid of the bad code in history, but you can remove it from new revisions.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
959 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
960 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
961 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
962 The basic commands don't 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 <a title="Removing History" href="#removing_history">later on</a>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
963 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
964 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
965 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
966 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
967 <p>Let's assume the bad change was revision 3, and you already have one more revision in your |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
968 repository. To remove the bad code, you can just <em>backout</em> of it. This creates a new |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
969 change which reverses the bad change. After backing out, you can then merge that new change |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
970 into the current code.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
971 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
972 <pre>$ hg backout 3 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
973 $ hg merge |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
974 (potentially resolve conflicts) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
975 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
976 (enter commit message. For example: "merged backout") |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
977 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
978 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
979 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
980 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
981 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
982 <h2 id="collaborative_development">Collaborative feature development</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
983 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
984 <p>Now that you can share changes and reverse them if necessary, you can go one step further: Using Mercurial to help in <strong>coordinating the coding</strong>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
985 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
986 <p>The first part is an easy way to develop features together, without requiring every developer to keep track of several feature clones.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
987 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
988 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
989 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
990 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
991 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
992 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
993 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
994 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
995 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
996 Cloning a repository always puts you onto the default branch at first. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
997 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
998 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
999 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1000 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1001 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1002 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1003 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1004 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1005 Named branch information is <strong>permanently stored in history</strong>, so you can always see for which feature some change was added. If you only want temporary branches as short-lived markers on history, you can use Bookmarks instead. Just replace <em>hg branch</em> with <em>hg bookmark</em> and add <em>-B <bookmark-name></em> to <em>hg push</em> and <em>hg pull</em>. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1006 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1007 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1008 <h5>Working in a named branch</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1009 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1010 <p>Create the branch</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1011 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1012 <pre>$ hg branch feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1013 (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1014 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1015 (write commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1016 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1017 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1018 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1019 <p>Update into the branch and work in it</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1020 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1021 <pre>$ hg update feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1022 (do some changes) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1023 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1024 (write commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1025 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1026 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1027 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1028 <p>Now you can <em>commit</em>, <em>pull</em>, <em>push</em> and <em>merge</em> (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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1029 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1030 <h5>Merge the named branch</h5> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1031 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1032 <p>When you finished the feature, you <em>merge</em> the branch back into the default branch.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1033 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1034 <pre>$ hg update default |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1035 $ hg merge feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1036 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1037 (write commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1038 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1039 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1040 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1041 <p>To see the active branches with <em>hg branches</em>. To mark a branch as inactive, for example because you finished implementing the feature, you can close it. Closed branches are hidden in <em>hg branches</em> as well as in <em>hg heads</em>.</pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1042 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1043 <pre>$ hg update feature1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1044 $ hg commit --close-branch -m "finished feature1" |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1045 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1046 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1047 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1048 <p>And that's it. Now you can easily keep features separate without unnecessary bookkeeping.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1049 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1050 <h2 id="tagging">Tagging revisions</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1051 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1052 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1053 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1054 <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 <strong>mark releases, or just mark off revisions as reviewed</strong>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1055 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1056 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1057 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1058 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1059 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1060 A tag must not contain the char ":", since that char is used for specifying multiple revisions - see "hg help revisions". |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1061 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1062 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1063 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1064 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1065 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. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1066 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1067 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1068 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1069 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1070 <p>Let's assume you want to give revision 3 the name "v0.1".</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1071 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1072 <p>Add the tag</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1073 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1074 <pre>$ hg tag -r 3 v0.1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1075 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1076 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1077 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1078 <p>See all tags</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1079 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1080 <pre>$ hg tags |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1081 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1082 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1083 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1084 <p>When you look at the log you'll now see a line in changeset 3 which marks the Tag. If someone wants to <em>update</em> to the tagged revision, he can just use the name of your tag</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1085 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1086 <pre>$ hg update v0.1 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1087 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1088 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1089 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1090 <p>Now he'll be at the tagged revision and can work from there.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1091 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1092 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1093 <h2 id="removing_history">Removing history</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1094 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1095 <h3>Use Case</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1096 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1097 <p>At times you will have changes in your repository, which you really don't want in it.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1098 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1099 <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 need.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1100 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1101 <p>This workflow becomes inconvenient when you need to remove changes, which are buried below many new changes. If you spot the them early enough, you can <strong>get rid of bad changes</strong> without too much effort, though.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1102 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1103 <h3>Workflow</h3> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1104 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1105 <p>Let's assume you want to get rid of revision 2 and the highest revision is 3.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1106 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1107 <p>The first step is to use the "--rev" option to <em>clone</em>: 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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1108 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1109 <pre>$ hg clone -r 1 project stripped |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1110 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1111 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1112 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1113 <p>Now you can <em>export</em> the change 3 from the original repository (project) and <em>import</em> it into the stripped one</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1114 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1115 <pre>$ cd project |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1116 $ hg export 3 > ../changes.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1117 $ cd ../stripped |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1118 $ hg import ../changes.diff |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1119 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1120 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1121 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1122 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1123 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1124 <pre>$ cat *.rej |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1125 (apply changes by hand) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1126 $ hg commit |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1127 (write commit message) |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1128 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1129 </pre> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1130 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1131 <p>That's it. <em>hg export</em> also includes the commit message, date, committer and similar metadata, so you are already done.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1132 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1133 <div class="note"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1134 <p class="note-title">Note:</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1135 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. |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1136 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1137 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1138 <h2 id="advanced_summary">Summary</h2> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1139 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1140 <p>So now you can work with Mercurial in private, and also share your changes in a multitude of ways.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1141 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1142 <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 occurred.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1143 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1144 <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> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1145 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1146 <p>With this we can conclude our practical guide.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1147 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1148 <h1 id="complex_workflows">More Complex Workflows</h1> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1149 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1150 <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> and the list of <a title="Mercurial extensions" href="http://mercurial.selenic.com/wiki/UsingExtensions">extensions</a>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1151 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1152 <p>To deepen your understanding, you can also check the <a title="Overview of the basic concepts of Mercurial" href="http://mercurial.selenic.com/wiki/UnderstandingMercurial">basic concept overview</a>.</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1153 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1154 <p>Have fun with Mercurial!</p> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1155 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1156 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1157 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1158 {% endblock %} |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1159 {% block sidebar %} |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1160 <h1>Index</h1> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1161 <ul class="sidebar-toc"> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1162 <li><a href="#basic_workflow">Basic workflows</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1163 <ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1164 <li><a href="#log_keeping">Log keeping</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1165 <li><a href="#lone_developer">Lone developer with nonlinear history</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1166 <li><a href="#separate_features">Separate features</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1167 <li><a href="#sharing_changes">Sharing changes</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1168 <li><a href="#basic_summary">Summary</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1169 </ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1170 <li><a href="#advanced_workflows">Advanced workflows</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1171 <ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1172 <li><a href="#backing_out">Backing out bad revisions</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1173 <li><a href="#collaborative_development">Collaborative feature development</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1174 <li><a href="#tagging">Tagging revisions</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1175 <li><a href="#removing_history">Removing history</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1176 <li><a href="#advanced_summary">Summary</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1177 </ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1178 <li><a href="#complex_workflows">More complex workflows</a></li> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1179 </ul> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1180 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1181 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1182 </div> |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1183 |
29d4b5e45423
Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff
changeset
|
1184 {% endblock %} |