annotate templates/quickstart/index.html @ 450:cdbc92f4e7d0

quickstart: technically, a directory is a file, but let's be more specific
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 28 Mar 2016 17:07:17 +0800
parents 634c8c450e9d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>Quick Start</h1>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
6 <p><em>How to get going at once.</em></p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
7 <h2>Part 0: Instant usage</h2>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
8 <p><em>(you know this from the main page)</em></p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
9 <p>Clone a project and create a patch </p>
449
634c8c450e9d templates: make current links to selenic.com use https
Anton Shestakov <av6@dwimlabs.net>
parents: 436
diff changeset
10 <pre><code>$ hg clone https://selenic.com/repo/hello
397
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
11 $ cd hello
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
12 $ (edit files)
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
13 $ hg add (new files)
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
14 $ hg commit -m 'My changes'
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
15 $ hg export tip &gt; patch.diff
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 </code></pre>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
18 <p>Create a project and commit </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
19 <pre><code>$ hg init (project-directory)
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
20 $ cd (project-directory)
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
21 $ (add some files)
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
22 $ hg add
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
23 $ hg commit -m 'Initial commit'
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
24 </code></pre>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
25 <h2>Part 1: Using Mercurial</h2>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
26 <p>Aside from the practical Quick Start above, there are only a few commands you need to start
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
27 working. </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
28 <p>Even if you stick to these basics, Mercurial is quite powerful. And they are very easy to
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
29 use, once you see the model behind them: Each repository has the whole history, and history is
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
30 not necessarily linear (part 2 explains that model in a bit more detail). All that history is
450
cdbc92f4e7d0 quickstart: technically, a directory is a file, but let's be more specific
Anton Shestakov <av6@dwimlabs.net>
parents: 449
diff changeset
31 stored in the ".hg" directory inside the top-level folder of your project.</p>
397
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
32 <p>A quick overview of the basic commands: </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
33 <ul>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
34 <li>hg init: create a new repository
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
35 </li><li>hg commit: save your changes in the current repository
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
36 </li><li>hg log: see all changes in your repository
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
37 </li><li>hg pull: get all changes from another repository into the current one
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
38 </li><li>hg push: get all changes from your repository into another one
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
39 </li><li>hg serve: create an instant-webserver. People can see the history there and pull from it
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
40 </li><li>hg merge: join different lines of history
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
41 </li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
42 </ul>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
43 <p>If you want to see a nice graph of the history, just do <hg>hg serve</hg> in your repository and then direct your browser to </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
44 <pre><code> 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
45
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
46 </code></pre>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
47 <p>This also helps getting a feeling for what the commands do. </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
48 <p>(you can also do a lot of finegrained stuff by using different command options. Just call "hg help &lt;command&gt;" to see them). </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
49 <p>One step you'll likely want to do is setting your username in your Mercurial config file. </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
50 <p>For this you can configure a proper name and email address in ~/.hgrc (or on a Windows system in %USERPROFILE%Mercurial.ini) by adding lines such as the following: </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
51 <pre><code>[ui]
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
52 username = John Doe &lt;john@example.com&gt;
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 </code></pre>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
55 <p>I you want more than this quick overview, please have a look at our longer <a href="/guide">practical guide</a>. </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
56 <h2>Part 2: Understanding Mercurial in 6 steps</h2>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
57 <p>Now we'll look at some of the basic concepts of Mercurial to get a better understanding of its internals: </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
58 <ol class="undecorated_list">
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
59 <li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
60 <p>Like in Subversion, history consists of a number of commits. They're
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
61 called changesets in Mercurial.</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
62
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
63 </li><li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
64 <p>Subversion requires a strict linear ordering of the commits and
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
65 gives nice linear revision numbers to them. So revision N has only
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
66 one child revision, N+1. This is simple, but it requires a central server to make sure that
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
67 everybody agrees on the revision numbers.</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
68
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
69 </li><li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
70 <p>Mercurial generalizes this by letting each changeset have multiple
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
71 children. If I work alone and make commits I'll make
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
72 <img src="/images/quickstart-c1.png" border="0"/><br />
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
73 by making three commits. </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
74
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
75 <p>The commit C3 with no children is a "head".
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
76 It is also the newest changeset in the repository -- called "tip". If I shared C1 with you and you started your work from that, your
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
77 commits will build a repository like this:
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
78 <img src="/images/quickstart-c2.png" border="0"/><br />
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
79 Here C3' is a head in your repository and I don't know anything
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
80 about C2' and C3' yet.</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
81
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
82 </li><li>If I pull from you, or you push to me, the two repositories are
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
83 compared. By default, all missing changesets are transferred. This
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
84 is all there is to push/pull: compare two graphs of changesets and
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
85 transfer the missing ones.
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
86 <p>After a pull from you my repository will look like this:
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
87 <img src="/images/quickstart-pull.png" border="0"/><br />
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
88 Here C1 has two child changesets, and the repository has two heads
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
89 since the development has diverged.</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
90 <p>The changeset C3' will be the new tip since it is the newest
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
91 changeset in the repository. Note that tip is always a head, but a
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
92 head need not be the tip.</p>
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 </li><li>Having two heads suggest that someone should merge them -- otherwise
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
95 the changes from one will never be combined with the changed made in
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
96 the other head.
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
97 <p>When merging with 'hg merge' the task is to figure out the canonical
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
98 way to combine the changesets. If the changes do not overlap this is
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
99 usually trivial, otherwise you have to do a three-way merge. The
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
100 merge must be committed and this creates a changeset which explains
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
101 to the world how you think the two heads should be combined:
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
102 <img src="/images/quickstart-merge.png" border="0"/><br />
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
103 Note that the merge changeset M has two parents.</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
104 <p>If you do not merge C3 and C3' and try to push, you get the 'new
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
105 remote head' message and push aborts. It aborts since it is a little
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
106 "impolite" to leave the job of merging to someone else -- he who
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
107 created the two heads by pulling in some code should also normally
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
108 do the merging.
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
109 </p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
110 </li><li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
111 <p>It helped my understanding a lot to think in terms of the changeset graph. Just remember that:</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
112 <ul><li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
113 <p>"hg commit" adds a new node. The parent changesets of the new node
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
114 is given by "hg parents"</p>
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 </li><li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
117 <p>"hg push" and "hg pull" transfer nodes in the graph between two
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
118 repositories.</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
119
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
120 </li><li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
121 <p>"hg update" updates the working copy to reflect a given node in
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
122 the history graph. This also changes the parent changeset of the
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
123 next commit, see "hg parents".</p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
124 </li>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
125 </ul>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
126 </ol>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
127
436
2b0669fed7a8 update domain to www.mercurial-scm.org
timeless@gmail.com
parents: 397
diff changeset
128 <p>And if you want to quickly look up something, you can use one of the <a href="https://www.mercurial-scm.org/wiki/QuickReferenceCardsAndCheatSheets">Mercurial cheatsheets</a>. </p>
397
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
129 <p><em>Compiled from a great email by Martin Geisler.</em></p>
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
130
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 {% endblock %}
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
133 {% block sidebar %}
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
134 {{ super() }}
29d4b5e45423 Use flask to render site and get rid of submodules
David Soria Parra <davidsp@fb.com>
parents:
diff changeset
135 {% endblock %}