comparison templates/quickstart/index.html @ 397:29d4b5e45423

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