annotate en/ch05-collab.xml @ 812:6b7818eb3d8e

Fix bogons
author Bryan O'Sullivan <bos@serpentine.com>
date Fri, 24 Apr 2009 00:31:21 -0700
parents 06458701453c
children 477d6a3e5023
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1 <!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : -->
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
2
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
3 <chapter id="cha:collab">
671
13513d2a128d Add sensible names to chapters.
Bryan O'Sullivan <bos@serpentine.com>
parents: 666
diff changeset
4 <?dbhtml filename="collaborating-with-other-people.html"?>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
5 <title>Collaborating with other people</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
6
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
7 <para id="x_44a">As a completely decentralised tool, Mercurial doesn't impose
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
8 any policy on how people ought to work with each other. However,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
9 if you're new to distributed revision control, it helps to have
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
10 some tools and examples in mind when you're thinking about
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
11 possible workflow models.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
12
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
13 <sect1>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
14 <title>Mercurial's web interface</title>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
15
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
16 <para id="x_44b">Mercurial has a powerful web interface that provides several
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
17 useful capabilities.</para>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
18
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
19 <para id="x_44c">For interactive use, the web interface lets you browse a
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
20 single repository or a collection of repositories. You can view
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
21 the history of a repository, examine each change (comments and
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
22 diffs), and view the contents of each directory and file. You
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
23 can even get a view of history that gives a graphical view of
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
24 the relationships between individual changes and merges.</para>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
25
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
26 <para id="x_44d">Also for human consumption, the web interface provides
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
27 Atom and RSS feeds of the changes in a repository. This lets you
773
3b640272a966 Progres on resolve
Bryan O'Sullivan <bos@serpentine.com>
parents: 771
diff changeset
28 <quote>subscribe</quote> to a repository using your favorite
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
29 feed reader, and be automatically notified of activity in that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
30 repository as soon as it happens. I find this capability much
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
31 more convenient than the model of subscribing to a mailing list
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
32 to which notifications are sent, as it requires no additional
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
33 configuration on the part of whoever is serving the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
34 repository.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
35
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
36 <para id="x_44e">The web interface also lets remote users clone a repository,
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
37 pull changes from it, and (when the server is configured to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
38 permit it) push changes back to it. Mercurial's HTTP tunneling
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
39 protocol aggressively compresses data, so that it works
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
40 efficiently even over low-bandwidth network connections.</para>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
41
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
42 <para id="x_44f">The easiest way to get started with the web interface is to
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
43 use your web browser to visit an existing repository, such as
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
44 the master Mercurial repository at <ulink
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
45 url="http://www.selenic.com/repo/hg">http://www.selenic.com/repo/hg</ulink>.</para>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
46
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
47 <para id="x_450">If you're interested in providing a web interface
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
48 to your own repositories, there are several good ways to do
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
49 this.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
50
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
51 <para id="x_69d">The easiest and fastest way to get started in an informal
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
52 environment is to use the <command role="hg-cmd">hg
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
53 serve</command> command, which is best suited to short-term
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
54 <quote>lightweight</quote> serving. See <xref
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
55 linkend="sec:collab:serve"/> below for details of how to use
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
56 this command.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
57
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
58 <para id="x_69e">For longer-lived repositories that you'd like to have
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
59 permanently available, there are several public hosting services
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
60 available.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
61
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
62 <itemizedlist>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
63 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
64 <para id="x_69f">Bitbucket, at <ulink
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
65 url="http://bitbucket.org/">http://bitbucket.org/</ulink>,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
66 provides free hosting for open source projects, and paid
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
67 hosting for commercial projects.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
68 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
69 </itemizedlist>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
70
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
71 <para id="x_6a0">If you would prefer to host your own repositories, Mercurial
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
72 has built-in support for several popular hosting technologies,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
73 most notably CGI (Common Gateway Interface), and WSGI (Web
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
74 Services Gateway Interface). See <xref
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
75 linkend="sec:collab:cgi"/> for details of CGI and WSGI
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
76 configuration.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
77 </sect1>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
78
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
79 <sect1>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
80 <title>Collaboration models</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
81
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
82 <para id="x_451">With a suitably flexible tool, making decisions about
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
83 workflow is much more of a social engineering challenge than a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
84 technical one. Mercurial imposes few limitations on how you can
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
85 structure the flow of work in a project, so it's up to you and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
86 your group to set up and live with a model that matches your own
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
87 particular needs.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
88
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
89 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
90 <title>Factors to keep in mind</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
91
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
92 <para id="x_452">The most important aspect of any model that you must keep
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
93 in mind is how well it matches the needs and capabilities of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
94 the people who will be using it. This might seem
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
95 self-evident; even so, you still can't afford to forget it for
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
96 a moment.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
97
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
98 <para id="x_453">I once put together a workflow model that seemed to make
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
99 perfect sense to me, but that caused a considerable amount of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
100 consternation and strife within my development team. In spite
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
101 of my attempts to explain why we needed a complex set of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
102 branches, and how changes ought to flow between them, a few
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
103 team members revolted. Even though they were smart people,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
104 they didn't want to pay attention to the constraints we were
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
105 operating under, or face the consequences of those constraints
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
106 in the details of the model that I was advocating.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
107
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
108 <para id="x_454">Don't sweep foreseeable social or technical problems under
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
109 the rug. Whatever scheme you put into effect, you should plan
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
110 for mistakes and problem scenarios. Consider adding automated
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
111 machinery to prevent, or quickly recover from, trouble that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
112 you can anticipate. As an example, if you intend to have a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
113 branch with not-for-release changes in it, you'd do well to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
114 think early about the possibility that someone might
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
115 accidentally merge those changes into a release branch. You
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
116 could avoid this particular problem by writing a hook that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
117 prevents changes from being merged from an inappropriate
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
118 branch.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
119 </sect2>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
120
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
121 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
122 <title>Informal anarchy</title>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
123
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
124 <para id="x_455">I wouldn't suggest an <quote>anything goes</quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
125 approach as something sustainable, but it's a model that's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
126 easy to grasp, and it works perfectly well in a few unusual
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
127 situations.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
128
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
129 <para id="x_456">As one example, many projects have a loose-knit group of
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
130 collaborators who rarely physically meet each other. Some
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
131 groups like to overcome the isolation of working at a distance
773
3b640272a966 Progres on resolve
Bryan O'Sullivan <bos@serpentine.com>
parents: 771
diff changeset
132 by organizing occasional <quote>sprints</quote>. In a sprint,
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
133 a number of people get together in a single location (a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
134 company's conference room, a hotel meeting room, that kind of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
135 place) and spend several days more or less locked in there,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
136 hacking intensely on a handful of projects.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
137
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
138 <para id="x_457">A sprint or a hacking session in a coffee shop are the perfect places to use the
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
139 <command role="hg-cmd">hg serve</command> command, since
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
140 <command role="hg-cmd">hg serve</command> does not require any
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
141 fancy server infrastructure. You can get started with
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
142 <command role="hg-cmd">hg serve</command> in moments, by
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
143 reading <xref linkend="sec:collab:serve"/> below. Then simply
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
144 tell the person next to you that you're running a server, send
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
145 the URL to them in an instant message, and you immediately
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
146 have a quick-turnaround way to work together. They can type
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
147 your URL into their web browser and quickly review your
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
148 changes; or they can pull a bugfix from you and verify it; or
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
149 they can clone a branch containing a new feature and try it
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
150 out.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
151
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
152 <para id="x_458">The charm, and the problem, with doing things
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
153 in an ad hoc fashion like this is that only people who know
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
154 about your changes, and where they are, can see them. Such an
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
155 informal approach simply doesn't scale beyond a handful
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
156 people, because each individual needs to know about
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
157 <emphasis>n</emphasis> different repositories to pull
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
158 from.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
159 </sect2>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
160
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
161 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
162 <title>A single central repository</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
163
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
164 <para id="x_459">For smaller projects migrating from a centralised revision
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
165 control tool, perhaps the easiest way to get started is to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
166 have changes flow through a single shared central repository.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
167 This is also the most common <quote>building block</quote> for
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
168 more ambitious workflow schemes.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
169
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
170 <para id="x_45a">Contributors start by cloning a copy of this repository.
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
171 They can pull changes from it whenever they need to, and some
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
172 (perhaps all) developers have permission to push a change back
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
173 when they're ready for other people to see it.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
174
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
175 <para id="x_45b">Under this model, it can still often make sense for people
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
176 to pull changes directly from each other, without going
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
177 through the central repository. Consider a case in which I
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
178 have a tentative bug fix, but I am worried that if I were to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
179 publish it to the central repository, it might subsequently
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
180 break everyone else's trees as they pull it. To reduce the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
181 potential for damage, I can ask you to clone my repository
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
182 into a temporary repository of your own and test it. This
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
183 lets us put off publishing the potentially unsafe change until
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
184 it has had a little testing.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
185
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
186 <para id="x_45c">If a team is hosting its own repository in this
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
187 kind of scenario, people will usually use the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
188 <command>ssh</command> protocol to securely push changes to
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
189 the central repository, as documented in <xref
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
190 linkend="sec:collab:ssh"/>. It's also usual to publish a
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
191 read-only copy of the repository over HTTP, as in
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
192 <xref linkend="sec:collab:cgi"/>. Publishing over HTTP
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
193 satisfies the needs of people who don't have push access, and
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
194 those who want to use web browsers to browse the repository's
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
195 history.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
196 </sect2>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
197
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
198 <sect2>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
199 <title>A hosted central repository</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
200
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
201 <para id="x_6a1">A wonderful thing about public hosting services like
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
202 <ulink url="http://bitbucket.org/">Bitbucket</ulink> is that
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
203 not only do they handle the fiddly server configuration
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
204 details, such as user accounts, authentication, and secure
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
205 wire protocols, they provide additional infrastructure to make
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
206 this model work well.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
207
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
208 <para id="x_6a2">For instance, a well-engineered hosting service will let
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
209 people clone their own copies of a repository with a single
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
210 click. This lets people work in separate spaces and share
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
211 their changes when they're ready.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
212
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
213 <para id="x_6a3">In addition, a good hosting service will let people
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
214 communicate with each other, for instance to say <quote>there
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
215 are changes ready for you to review in this
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
216 tree</quote>.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
217 </sect2>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
218
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
219 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
220 <title>Working with multiple branches</title>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
221
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
222 <para id="x_45d">Projects of any significant size naturally tend to make
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
223 progress on several fronts simultaneously. In the case of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
224 software, it's common for a project to go through periodic
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
225 official releases. A release might then go into
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
226 <quote>maintenance mode</quote> for a while after its first
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
227 publication; maintenance releases tend to contain only bug
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
228 fixes, not new features. In parallel with these maintenance
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
229 releases, one or more future releases may be under
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
230 development. People normally use the word
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
231 <quote>branch</quote> to refer to one of these many slightly
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
232 different directions in which development is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
233 proceeding.</para>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
234
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
235 <para id="x_45e">Mercurial is particularly well suited to managing a number
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
236 of simultaneous, but not identical, branches. Each
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
237 <quote>development direction</quote> can live in its own
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
238 central repository, and you can merge changes from one to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
239 another as the need arises. Because repositories are
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
240 independent of each other, unstable changes in a development
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
241 branch will never affect a stable branch unless someone
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
242 explicitly merges those changes into the stable branch.</para>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
243
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
244 <para id="x_45f">Here's an example of how this can work in practice. Let's
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
245 say you have one <quote>main branch</quote> on a central
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
246 server.</para>
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
247
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
248 &interaction.branching.init;
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
249
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
250 <para id="x_460">People clone it, make changes locally, test them, and push
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
251 them back.</para>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
252
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
253 <para id="x_461">Once the main branch reaches a release milestone, you can
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
254 use the <command role="hg-cmd">hg tag</command> command to
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
255 give a permanent name to the milestone revision.</para>
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
256
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
257 &interaction.branching.tag;
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
258
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
259 <para id="x_462">Let's say some ongoing
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
260 development occurs on the main branch.</para>
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
261
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
262 &interaction.branching.main;
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
263
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
264 <para id="x_463">Using the tag that was recorded at the milestone, people
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
265 who clone that repository at any time in the future can use
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
266 <command role="hg-cmd">hg update</command> to get a copy of
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
267 the working directory exactly as it was when that tagged
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
268 revision was committed.</para>
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
269
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
270 &interaction.branching.update;
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
271
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
272 <para id="x_464">In addition, immediately after the main branch is tagged,
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
273 we can then clone the main branch on the server to a new
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
274 <quote>stable</quote> branch, also on the server.</para>
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
275
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
276 &interaction.branching.clone;
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
277
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
278 <para id="x_465">If we need to make a change to the stable
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
279 branch, we can then clone <emphasis>that</emphasis>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
280 repository, make our changes, commit, and push our changes
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
281 back there.</para>
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
282
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
283 &interaction.branching.stable;
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
284
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
285 <para id="x_466">Because Mercurial repositories are independent, and
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
286 Mercurial doesn't move changes around automatically, the
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
287 stable and main branches are <emphasis>isolated</emphasis>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
288 from each other. The changes that we made on the main branch
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
289 don't <quote>leak</quote> to the stable branch, and vice
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
290 versa.</para>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
291
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
292 <para id="x_467">We'll often want all of our bugfixes on the stable
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
293 branch to show up on the main branch, too. Rather than
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
294 rewrite a bugfix on the main branch, we can simply pull and
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
295 merge changes from the stable to the main branch, and
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
296 Mercurial will bring those bugfixes in for us.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
297
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
298 &interaction.branching.merge;
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
299
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
300 <para id="x_468">The main branch will still contain changes that
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
301 are not on the stable branch, but it will also contain all of
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
302 the bugfixes from the stable branch. The stable branch
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
303 remains unaffected by these changes, since changes are only
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
304 flowing from the stable to the main branch, and not the other
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
305 way.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
306 </sect2>
666
8fcd44708f41 Uncomment all the mangled interaction examples.
Bryan O'Sullivan <bos@serpentine.com>
parents: 660
diff changeset
307
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
308 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
309 <title>Feature branches</title>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
310
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
311 <para id="x_469">For larger projects, an effective way to manage change is
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
312 to break up a team into smaller groups. Each group has a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
313 shared branch of its own, cloned from a single
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
314 <quote>master</quote> branch used by the entire project.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
315 People working on an individual branch are typically quite
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
316 isolated from developments on other branches.</para>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
317
690
b788b405e141 Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents: 683
diff changeset
318 <figure id="fig:collab:feature-branches">
b788b405e141 Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents: 683
diff changeset
319 <title>Feature branches</title>
b788b405e141 Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents: 683
diff changeset
320 <mediaobject>
754
65e9a18d2c7e Shrink large images to fit page
Dongsheng Song <dongsheng.song@gmail.com>
parents: 753
diff changeset
321 <imageobject><imagedata width="100%" fileref="figs/feature-branches.png"/></imageobject>
690
b788b405e141 Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents: 683
diff changeset
322 <textobject><phrase>XXX add text</phrase></textobject>
b788b405e141 Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents: 683
diff changeset
323 </mediaobject>
b788b405e141 Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents: 683
diff changeset
324 </figure>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
325
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
326 <para id="x_46b">When a particular feature is deemed to be in suitable
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
327 shape, someone on that feature team pulls and merges from the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
328 master branch into the feature branch, then pushes back up to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
329 the master branch.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
330 </sect2>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
331
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
332 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
333 <title>The release train</title>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
334
773
3b640272a966 Progres on resolve
Bryan O'Sullivan <bos@serpentine.com>
parents: 771
diff changeset
335 <para id="x_46c">Some projects are organized on a <quote>train</quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
336 basis: a release is scheduled to happen every few months, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
337 whatever features are ready when the <quote>train</quote> is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
338 ready to leave are allowed in.</para>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
339
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
340 <para id="x_46d">This model resembles working with feature branches. The
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
341 difference is that when a feature branch misses a train,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
342 someone on the feature team pulls and merges the changes that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
343 went out on that train release into the feature branch, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
344 the team continues its work on top of that release so that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
345 their feature can make the next release.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
346 </sect2>
179
5fc4a45c069f Continue documentation of collaboration models.
Bryan O'Sullivan <bos@serpentine.com>
parents: 159
diff changeset
347
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
348 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
349 <title>The Linux kernel model</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
350
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
351 <para id="x_46e">The development of the Linux kernel has a shallow
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
352 hierarchical structure, surrounded by a cloud of apparent
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
353 chaos. Because most Linux developers use
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
354 <command>git</command>, a distributed revision control tool
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
355 with capabilities similar to Mercurial, it's useful to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
356 describe the way work flows in that environment; if you like
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
357 the ideas, the approach translates well across tools.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
358
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
359 <para id="x_46f">At the center of the community sits Linus Torvalds, the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
360 creator of Linux. He publishes a single source repository
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
361 that is considered the <quote>authoritative</quote> current
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
362 tree by the entire developer community. Anyone can clone
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
363 Linus's tree, but he is very choosy about whose trees he pulls
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
364 from.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
365
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
366 <para id="x_470">Linus has a number of <quote>trusted lieutenants</quote>.
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
367 As a general rule, he pulls whatever changes they publish, in
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
368 most cases without even reviewing those changes. Some of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
369 those lieutenants are generally agreed to be
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
370 <quote>maintainers</quote>, responsible for specific
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
371 subsystems within the kernel. If a random kernel hacker wants
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
372 to make a change to a subsystem that they want to end up in
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
373 Linus's tree, they must find out who the subsystem's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
374 maintainer is, and ask that maintainer to take their change.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
375 If the maintainer reviews their changes and agrees to take
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
376 them, they'll pass them along to Linus in due course.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
377
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
378 <para id="x_471">Individual lieutenants have their own approaches to
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
379 reviewing, accepting, and publishing changes; and for deciding
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
380 when to feed them to Linus. In addition, there are several
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
381 well known branches that people use for different purposes.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
382 For example, a few people maintain <quote>stable</quote>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
383 repositories of older versions of the kernel, to which they
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
384 apply critical fixes as needed. Some maintainers publish
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
385 multiple trees: one for experimental changes; one for changes
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
386 that they are about to feed upstream; and so on. Others just
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
387 publish a single tree.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
388
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
389 <para id="x_472">This model has two notable features. The first is that
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
390 it's <quote>pull only</quote>. You have to ask, convince, or
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
391 beg another developer to take a change from you, because there
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
392 are almost no trees to which more than one person can push,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
393 and there's no way to push changes into a tree that someone
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
394 else controls.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
395
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
396 <para id="x_473">The second is that it's based on reputation and acclaim.
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
397 If you're an unknown, Linus will probably ignore changes from
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
398 you without even responding. But a subsystem maintainer will
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
399 probably review them, and will likely take them if they pass
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
400 their criteria for suitability. The more <quote>good</quote>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
401 changes you contribute to a maintainer, the more likely they
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
402 are to trust your judgment and accept your changes. If you're
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
403 well-known and maintain a long-lived branch for something
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
404 Linus hasn't yet accepted, people with similar interests may
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
405 pull your changes regularly to keep up with your work.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
406
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
407 <para id="x_474">Reputation and acclaim don't necessarily cross subsystem
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
408 or <quote>people</quote> boundaries. If you're a respected
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
409 but specialised storage hacker, and you try to fix a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
410 networking bug, that change will receive a level of scrutiny
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
411 from a network maintainer comparable to a change from a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
412 complete stranger.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
413
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
414 <para id="x_475">To people who come from more orderly project backgrounds,
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
415 the comparatively chaotic Linux kernel development process
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
416 often seems completely insane. It's subject to the whims of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
417 individuals; people make sweeping changes whenever they deem
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
418 it appropriate; and the pace of development is astounding.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
419 And yet Linux is a highly successful, well-regarded piece of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
420 software.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
421 </sect2>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
422
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
423 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
424 <title>Pull-only versus shared-push collaboration</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
425
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
426 <para id="x_476">A perpetual source of heat in the open source community is
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
427 whether a development model in which people only ever pull
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
428 changes from others is <quote>better than</quote> one in which
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
429 multiple people can push changes to a shared
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
430 repository.</para>
187
b60e2de6dbc3 Add chapter on branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents: 184
diff changeset
431
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
432 <para id="x_477">Typically, the backers of the shared-push model use tools
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
433 that actively enforce this approach. If you're using a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
434 centralised revision control tool such as Subversion, there's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
435 no way to make a choice over which model you'll use: the tool
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
436 gives you shared-push, and if you want to do anything else,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
437 you'll have to roll your own approach on top (such as applying
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
438 a patch by hand).</para>
187
b60e2de6dbc3 Add chapter on branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents: 184
diff changeset
439
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
440 <para id="x_478">A good distributed revision control tool will
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
441 support both models. You and your collaborators can then
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
442 structure how you work together based on your own needs and
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
443 preferences, not on what contortions your tools force you
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
444 into.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
445 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
446 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
447 <title>Where collaboration meets branch management</title>
187
b60e2de6dbc3 Add chapter on branch management.
Bryan O'Sullivan <bos@serpentine.com>
parents: 184
diff changeset
448
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
449 <para id="x_479">Once you and your team set up some shared
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
450 repositories and start propagating changes back and forth
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
451 between local and shared repos, you begin to face a related,
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
452 but slightly different challenge: that of managing the
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
453 multiple directions in which your team may be moving at once.
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
454 Even though this subject is intimately related to how your
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
455 team collaborates, it's dense enough to merit treatment of its
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
456 own, in <xref linkend="chap:branch"/>.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
457 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
458 </sect1>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
459
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
460 <sect1>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
461 <title>The technical side of sharing</title>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
462
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
463 <para id="x_47a">The remainder of this chapter is devoted to the question of
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
464 sharing changes with your collaborators.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
465 </sect1>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
466
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
467 <sect1 id="sec:collab:serve">
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
468 <title>Informal sharing with <command role="hg-cmd">hg
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
469 serve</command></title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
470
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
471 <para id="x_47b">Mercurial's <command role="hg-cmd">hg serve</command>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
472 command is wonderfully suited to small, tight-knit, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
473 fast-paced group environments. It also provides a great way to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
474 get a feel for using Mercurial commands over a network.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
475
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
476 <para id="x_47c">Run <command role="hg-cmd">hg serve</command> inside a
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
477 repository, and in under a second it will bring up a specialised
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
478 HTTP server; this will accept connections from any client, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
479 serve up data for that repository until you terminate it.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
480 Anyone who knows the URL of the server you just started, and can
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
481 talk to your computer over the network, can then use a web
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
482 browser or Mercurial to read data from that repository. A URL
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
483 for a <command role="hg-cmd">hg serve</command> instance running
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
484 on a laptop is likely to look something like
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
485 <literal>http://my-laptop.local:8000/</literal>.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
486
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
487 <para id="x_47d">The <command role="hg-cmd">hg serve</command> command is
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
488 <emphasis>not</emphasis> a general-purpose web server. It can do
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
489 only two things:</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
490 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
491 <listitem><para id="x_47e">Allow people to browse the history of the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
492 repository it's serving, from their normal web
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
493 browsers.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
494 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
495 <listitem><para id="x_47f">Speak Mercurial's wire protocol, so that people
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
496 can <command role="hg-cmd">hg clone</command> or <command
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
497 role="hg-cmd">hg pull</command> changes from that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
498 repository.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
499 </listitem></itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
500 <para id="x_480">In particular, <command role="hg-cmd">hg serve</command>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
501 won't allow remote users to <emphasis>modify</emphasis> your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
502 repository. It's intended for read-only use.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
503
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
504 <para id="x_481">If you're getting started with Mercurial, there's nothing to
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
505 prevent you from using <command role="hg-cmd">hg serve</command>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
506 to serve up a repository on your own computer, then use commands
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
507 like <command role="hg-cmd">hg clone</command>, <command
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
508 role="hg-cmd">hg incoming</command>, and so on to talk to that
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
509 server as if the repository was hosted remotely. This can help
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
510 you to quickly get acquainted with using commands on
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
511 network-hosted repositories.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
512
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
513 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
514 <title>A few things to keep in mind</title>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
515
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
516 <para id="x_482">Because it provides unauthenticated read access to all
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
517 clients, you should only use <command role="hg-cmd">hg
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
518 serve</command> in an environment where you either don't
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
519 care, or have complete control over, who can access your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
520 network and pull data from your repository.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
521
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
522 <para id="x_483">The <command role="hg-cmd">hg serve</command> command
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
523 knows nothing about any firewall software you might have
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
524 installed on your system or network. It cannot detect or
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
525 control your firewall software. If other people are unable to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
526 talk to a running <command role="hg-cmd">hg serve</command>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
527 instance, the second thing you should do
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
528 (<emphasis>after</emphasis> you make sure that they're using
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
529 the correct URL) is check your firewall configuration.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
530
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
531 <para id="x_484">By default, <command role="hg-cmd">hg serve</command>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
532 listens for incoming connections on port 8000. If another
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
533 process is already listening on the port you want to use, you
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
534 can specify a different port to listen on using the <option
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
535 role="hg-opt-serve">-p</option> option.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
536
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
537 <para id="x_485">Normally, when <command role="hg-cmd">hg serve</command>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
538 starts, it prints no output, which can be a bit unnerving. If
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
539 you'd like to confirm that it is indeed running correctly, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
540 find out what URL you should send to your collaborators, start
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
541 it with the <option role="hg-opt-global">-v</option>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
542 option.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
543 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
544 </sect1>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
545
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
546 <sect1 id="sec:collab:ssh">
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
547 <title>Using the Secure Shell (ssh) protocol</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
548
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
549 <para id="x_486">You can pull and push changes securely over a network
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
550 connection using the Secure Shell (<literal>ssh</literal>)
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
551 protocol. To use this successfully, you may have to do a little
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
552 bit of configuration on the client or server sides.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
553
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
554 <para id="x_487">If you're not familiar with ssh, it's the name of
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
555 both a command and a network protocol that let you securely
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
556 communicate with another computer. To use it with Mercurial,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
557 you'll be setting up one or more user accounts on a server so
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
558 that remote users can log in and execute commands.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
559
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
560 <para id="x_488">(If you <emphasis>are</emphasis> familiar with ssh, you'll
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
561 probably find some of the material that follows to be elementary
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
562 in nature.)</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
563
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
564 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
565 <title>How to read and write ssh URLs</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
566
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
567 <para id="x_489">An ssh URL tends to look like this:</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
568 <programlisting>ssh://bos@hg.serpentine.com:22/hg/hgbook</programlisting>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
569 <orderedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
570 <listitem><para id="x_48a">The <quote><literal>ssh://</literal></quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
571 part tells Mercurial to use the ssh protocol.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
572 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
573 <listitem><para id="x_48b">The <quote><literal>bos@</literal></quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
574 component indicates what username to log into the server
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
575 as. You can leave this out if the remote username is the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
576 same as your local username.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
577 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
578 <listitem><para id="x_48c">The
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
579 <quote><literal>hg.serpentine.com</literal></quote> gives
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
580 the hostname of the server to log into.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
581 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
582 <listitem><para id="x_48d">The <quote>:22</quote> identifies the port
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
583 number to connect to the server on. The default port is
679
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
584 22, so you only need to specify a colon and port number if
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
585 you're <emphasis>not</emphasis> using port 22.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
586 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
587 <listitem><para id="x_48e">The remainder of the URL is the local path to
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
588 the repository on the server.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
589 </listitem></orderedlist>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
590
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
591 <para id="x_48f">There's plenty of scope for confusion with the path
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
592 component of ssh URLs, as there is no standard way for tools
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
593 to interpret it. Some programs behave differently than others
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
594 when dealing with these paths. This isn't an ideal situation,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
595 but it's unlikely to change. Please read the following
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
596 paragraphs carefully.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
597
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
598 <para id="x_490">Mercurial treats the path to a repository on the server as
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
599 relative to the remote user's home directory. For example, if
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
600 user <literal>foo</literal> on the server has a home directory
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
601 of <filename class="directory">/home/foo</filename>, then an
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
602 ssh URL that contains a path component of <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
603 class="directory">bar</filename> <emphasis>really</emphasis>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
604 refers to the directory <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
605 class="directory">/home/foo/bar</filename>.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
606
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
607 <para id="x_491">If you want to specify a path relative to another user's
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
608 home directory, you can use a path that starts with a tilde
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
609 character followed by the user's name (let's call them
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
610 <literal>otheruser</literal>), like this.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
611 <programlisting>ssh://server/~otheruser/hg/repo</programlisting>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
612
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
613 <para id="x_492">And if you really want to specify an
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
614 <emphasis>absolute</emphasis> path on the server, begin the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
615 path component with two slashes, as in this example.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
616 <programlisting>ssh://server//absolute/path</programlisting>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
617 </sect2>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
618
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
619 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
620 <title>Finding an ssh client for your system</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
621
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
622 <para id="x_493">Almost every Unix-like system comes with OpenSSH
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
623 preinstalled. If you're using such a system, run
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
624 <literal>which ssh</literal> to find out if the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
625 <command>ssh</command> command is installed (it's usually in
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
626 <filename class="directory">/usr/bin</filename>). In the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
627 unlikely event that it isn't present, take a look at your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
628 system documentation to figure out how to install it.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
629
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
630 <para id="x_494">On Windows, the TortoiseHg package is bundled
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
631 with a version of Simon Tatham's excellent
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
632 <command>plink</command> command, and you should not need to
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
633 do any further configuration.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
634 </sect2>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
635
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
636 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
637 <title>Generating a key pair</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
638
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
639 <para id="x_499">To avoid the need to repetitively type a
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
640 password every time you need to use your ssh client, I
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
641 recommend generating a key pair.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
642
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
643 <tip>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
644 <title>Key pairs are not mandatory</title>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
645
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
646 <para id="x_6a4">Mercurial knows nothing about ssh authentication or key
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
647 pairs. You can, if you like, safely ignore this section and
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
648 the one that follows until you grow tired of repeatedly
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
649 typing ssh passwords.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
650 </tip>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
651
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
652 <itemizedlist>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
653 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
654 <para id="x_6a5">On a Unix-like system, the
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
655 <command>ssh-keygen</command> command will do the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
656 trick.</para>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
657 <para id="x_6a6">On Windows, if you're using TortoiseHg, you may need
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
658 to download a command named <command>puttygen</command>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
659 from <ulink
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
660 url="http://www.chiark.greenend.org.uk/~sgtatham/putty">the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
661 PuTTY web site</ulink> to generate a key pair. See
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
662 <ulink
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
663 url="http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-puttygen">the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
664 <command>puttygen</command> documentation</ulink> for
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
665 details of how use the command.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
666 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
667 </itemizedlist>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
668
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
669 <para id="x_49a">When you generate a key pair, it's usually
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
670 <emphasis>highly</emphasis> advisable to protect it with a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
671 passphrase. (The only time that you might not want to do this
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
672 is when you're using the ssh protocol for automated tasks on a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
673 secure network.)</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
674
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
675 <para id="x_49b">Simply generating a key pair isn't enough, however.
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
676 You'll need to add the public key to the set of authorised
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
677 keys for whatever user you're logging in remotely as. For
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
678 servers using OpenSSH (the vast majority), this will mean
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
679 adding the public key to a list in a file called <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
680 role="special">authorized_keys</filename> in their <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
681 role="special" class="directory">.ssh</filename>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
682 directory.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
683
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
684 <para id="x_49c">On a Unix-like system, your public key will have a
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
685 <filename>.pub</filename> extension. If you're using
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
686 <command>puttygen</command> on Windows, you can save the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
687 public key to a file of your choosing, or paste it from the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
688 window it's displayed in straight into the <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
689 role="special">authorized_keys</filename> file.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
690 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
691 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
692 <title>Using an authentication agent</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
693
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
694 <para id="x_49d">An authentication agent is a daemon that stores
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
695 passphrases in memory (so it will forget passphrases if you
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
696 log out and log back in again). An ssh client will notice if
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
697 it's running, and query it for a passphrase. If there's no
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
698 authentication agent running, or the agent doesn't store the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
699 necessary passphrase, you'll have to type your passphrase
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
700 every time Mercurial tries to communicate with a server on
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
701 your behalf (e.g. whenever you pull or push changes).</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
702
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
703 <para id="x_49e">The downside of storing passphrases in an agent is that
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
704 it's possible for a well-prepared attacker to recover the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
705 plain text of your passphrases, in some cases even if your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
706 system has been power-cycled. You should make your own
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
707 judgment as to whether this is an acceptable risk. It
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
708 certainly saves a lot of repeated typing.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
709
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
710 <itemizedlist>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
711 <listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
712 <para id="x_49f">On Unix-like systems, the agent is called
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
713 <command>ssh-agent</command>, and it's often run
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
714 automatically for you when you log in. You'll need to use
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
715 the <command>ssh-add</command> command to add passphrases
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
716 to the agent's store.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
717 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
718 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
719 <para id="x_6a7">On Windows, if you're using TortoiseHg, the
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
720 <command>pageant</command> command acts as the agent. As
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
721 with <command>puttygen</command>, you'll need to <ulink
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
722 url="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html">download
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
723 <command>pageant</command></ulink> from the PuTTY web
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
724 site and read <ulink
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
725 url="http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter9.html#pageant">its
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
726 documentation</ulink>. The <command>pageant</command>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
727 command adds an icon to your system tray that will let you
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
728 manage stored passphrases.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
729 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
730 </itemizedlist>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
731 </sect2>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
732
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
733 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
734 <title>Configuring the server side properly</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
735
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
736 <para id="x_4a0">Because ssh can be fiddly to set up if you're new to it,
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
737 a variety of things can go wrong. Add Mercurial
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
738 on top, and there's plenty more scope for head-scratching.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
739 Most of these potential problems occur on the server side, not
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
740 the client side. The good news is that once you've gotten a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
741 configuration working, it will usually continue to work
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
742 indefinitely.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
743
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
744 <para id="x_4a1">Before you try using Mercurial to talk to an ssh server,
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
745 it's best to make sure that you can use the normal
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
746 <command>ssh</command> or <command>putty</command> command to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
747 talk to the server first. If you run into problems with using
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
748 these commands directly, Mercurial surely won't work. Worse,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
749 it will obscure the underlying problem. Any time you want to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
750 debug ssh-related Mercurial problems, you should drop back to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
751 making sure that plain ssh client commands work first,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
752 <emphasis>before</emphasis> you worry about whether there's a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
753 problem with Mercurial.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
754
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
755 <para id="x_4a2">The first thing to be sure of on the server side is that
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
756 you can actually log in from another machine at all. If you
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
757 can't use <command>ssh</command> or <command>putty</command>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
758 to log in, the error message you get may give you a few hints
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
759 as to what's wrong. The most common problems are as
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
760 follows.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
761 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
762 <listitem><para id="x_4a3">If you get a <quote>connection refused</quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
763 error, either there isn't an SSH daemon running on the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
764 server at all, or it's inaccessible due to firewall
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
765 configuration.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
766 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
767 <listitem><para id="x_4a4">If you get a <quote>no route to host</quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
768 error, you either have an incorrect address for the server
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
769 or a seriously locked down firewall that won't admit its
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
770 existence at all.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
771 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
772 <listitem><para id="x_4a5">If you get a <quote>permission denied</quote>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
773 error, you may have mistyped the username on the server,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
774 or you could have mistyped your key's passphrase or the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
775 remote user's password.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
776 </listitem></itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
777 <para id="x_4a6">In summary, if you're having trouble talking to the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
778 server's ssh daemon, first make sure that one is running at
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
779 all. On many systems it will be installed, but disabled, by
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
780 default. Once you're done with this step, you should then
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
781 check that the server's firewall is configured to allow
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
782 incoming connections on the port the ssh daemon is listening
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
783 on (usually 22). Don't worry about more exotic possibilities
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
784 for misconfiguration until you've checked these two
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
785 first.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
786
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
787 <para id="x_4a7">If you're using an authentication agent on the client side
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
788 to store passphrases for your keys, you ought to be able to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
789 log into the server without being prompted for a passphrase or
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
790 a password. If you're prompted for a passphrase, there are a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
791 few possible culprits.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
792 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
793 <listitem><para id="x_4a8">You might have forgotten to use
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
794 <command>ssh-add</command> or <command>pageant</command>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
795 to store the passphrase.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
796 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
797 <listitem><para id="x_4a9">You might have stored the passphrase for the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
798 wrong key.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
799 </listitem></itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
800 <para id="x_4aa">If you're being prompted for the remote user's password,
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
801 there are another few possible problems to check.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
802 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
803 <listitem><para id="x_4ab">Either the user's home directory or their
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
804 <filename role="special" class="directory">.ssh</filename>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
805 directory might have excessively liberal permissions. As
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
806 a result, the ssh daemon will not trust or read their
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
807 <filename role="special">authorized_keys</filename> file.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
808 For example, a group-writable home or <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
809 role="special" class="directory">.ssh</filename>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
810 directory will often cause this symptom.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
811 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
812 <listitem><para id="x_4ac">The user's <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
813 role="special">authorized_keys</filename> file may have
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
814 a problem. If anyone other than the user owns or can write
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
815 to that file, the ssh daemon will not trust or read
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
816 it.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
817 </listitem></itemizedlist>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
818
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
819 <para id="x_4ad">In the ideal world, you should be able to run the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
820 following command successfully, and it should print exactly
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
821 one line of output, the current date and time.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
822 <programlisting>ssh myserver date</programlisting>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
823
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
824 <para id="x_4ae">If, on your server, you have login scripts that print
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
825 banners or other junk even when running non-interactive
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
826 commands like this, you should fix them before you continue,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
827 so that they only print output if they're run interactively.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
828 Otherwise these banners will at least clutter up Mercurial's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
829 output. Worse, they could potentially cause problems with
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
830 running Mercurial commands remotely. Mercurial makes tries to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
831 detect and ignore banners in non-interactive
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
832 <command>ssh</command> sessions, but it is not foolproof. (If
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
833 you're editing your login scripts on your server, the usual
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
834 way to see if a login script is running in an interactive
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
835 shell is to check the return code from the command
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
836 <literal>tty -s</literal>.)</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
837
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
838 <para id="x_4af">Once you've verified that plain old ssh is working with
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
839 your server, the next step is to ensure that Mercurial runs on
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
840 the server. The following command should run
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
841 successfully:</para>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
842
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
843 <programlisting>ssh myserver hg version</programlisting>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
844
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
845 <para id="x_4b0">If you see an error message instead of normal <command
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
846 role="hg-cmd">hg version</command> output, this is usually
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
847 because you haven't installed Mercurial to <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
848 class="directory">/usr/bin</filename>. Don't worry if this
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
849 is the case; you don't need to do that. But you should check
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
850 for a few possible problems.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
851 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
852 <listitem><para id="x_4b1">Is Mercurial really installed on the server at
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
853 all? I know this sounds trivial, but it's worth
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
854 checking!</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
855 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
856 <listitem><para id="x_4b2">Maybe your shell's search path (usually set
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
857 via the <envar>PATH</envar> environment variable) is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
858 simply misconfigured.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
859 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
860 <listitem><para id="x_4b3">Perhaps your <envar>PATH</envar> environment
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
861 variable is only being set to point to the location of the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
862 <command>hg</command> executable if the login session is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
863 interactive. This can happen if you're setting the path
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
864 in the wrong shell login script. See your shell's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
865 documentation for details.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
866 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
867 <listitem><para id="x_4b4">The <envar>PYTHONPATH</envar> environment
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
868 variable may need to contain the path to the Mercurial
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
869 Python modules. It might not be set at all; it could be
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
870 incorrect; or it may be set only if the login is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
871 interactive.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
872 </listitem></itemizedlist>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
873
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
874 <para id="x_4b5">If you can run <command role="hg-cmd">hg version</command>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
875 over an ssh connection, well done! You've got the server and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
876 client sorted out. You should now be able to use Mercurial to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
877 access repositories hosted by that username on that server.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
878 If you run into problems with Mercurial and ssh at this point,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
879 try using the <option role="hg-opt-global">--debug</option>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
880 option to get a clearer picture of what's going on.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
881 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
882 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
883 <title>Using compression with ssh</title>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
884
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
885 <para id="x_4b6">Mercurial does not compress data when it uses the ssh
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
886 protocol, because the ssh protocol can transparently compress
771
b338f5490029 Americanize spellings :-(
Bryan O'Sullivan <bos@serpentine.com>
parents: 754
diff changeset
887 data. However, the default behavior of ssh clients is
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
888 <emphasis>not</emphasis> to request compression.</para>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
889
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
890 <para id="x_4b7">Over any network other than a fast LAN (even a wireless
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
891 network), using compression is likely to significantly speed
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
892 up Mercurial's network operations. For example, over a WAN,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
893 someone measured compression as reducing the amount of time
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
894 required to clone a particularly large repository from 51
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
895 minutes to 17 minutes.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
896
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
897 <para id="x_4b8">Both <command>ssh</command> and <command>plink</command>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
898 accept a <option role="cmd-opt-ssh">-C</option> option which
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
899 turns on compression. You can easily edit your <filename
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
900 role="special">~/.hgrc</filename> to enable compression for
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
901 all of Mercurial's uses of the ssh protocol. Here is how to
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
902 do so for regular <command>ssh</command> on Unix-like systems,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
903 for example.</para>
679
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
904 <programlisting>[ui]
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
905 ssh = ssh -C</programlisting>
184
7b812c428074 Document the ssh protocol, URL syntax, and configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 179
diff changeset
906
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
907 <para id="x_4b9">If you use <command>ssh</command> on a
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
908 Unix-like system, you can configure it to always use
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
909 compression when talking to your server. To do this, edit
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
910 your <filename role="special">.ssh/config</filename> file
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
911 (which may not yet exist), as follows.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
912
679
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
913 <programlisting>Host hg
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
914 Compression yes
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
915 HostName hg.example.com</programlisting>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
916
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
917 <para id="x_4ba">This defines a hostname alias,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
918 <literal>hg</literal>. When you use that hostname on the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
919 <command>ssh</command> command line or in a Mercurial
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
920 <literal>ssh</literal>-protocol URL, it will cause
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
921 <command>ssh</command> to connect to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
922 <literal>hg.example.com</literal> and use compression. This
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
923 gives you both a shorter name to type and compression, each of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
924 which is a good thing in its own right.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
925 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
926 </sect1>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
927
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
928 <sect1 id="sec:collab:cgi">
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
929 <title>Serving over HTTP using CGI</title>
209
8b599dcca584 Mention what the web interface does.
Bryan O'Sullivan <bos@serpentine.com>
parents: 187
diff changeset
930
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
931 <para id="x_6a8">The simplest way to host one or more repositories in a
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
932 permanent way is to use a web server and Mercurial's CGI
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
933 support.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
934
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
935 <para id="x_4bb">Depending on how ambitious you are, configuring Mercurial's
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
936 CGI interface can take anything from a few moments to several
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
937 hours.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
938
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
939 <para id="x_4bc">We'll begin with the simplest of examples, and work our way
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
940 towards a more complex configuration. Even for the most basic
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
941 case, you're almost certainly going to need to read and modify
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
942 your web server's configuration.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
943
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
944 <note>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
945 <title>High pain tolerance required</title>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
946
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
947 <para id="x_4bd">Configuring a web server is a complex, fiddly,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
948 and highly system-dependent activity. I can't possibly give
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
949 you instructions that will cover anything like all of the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
950 cases you will encounter. Please use your discretion and
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
951 judgment in following the sections below. Be prepared to make
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
952 plenty of mistakes, and to spend a lot of time reading your
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
953 server's error logs.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
954
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
955 <para id="x_6a9">If you don't have a strong stomach for tweaking
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
956 configurations over and over, or a compelling need to host
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
957 your own services, you might want to try one of the public
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
958 hosting services that I mentioned earlier.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
959 </note>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
960
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
961 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
962 <title>Web server configuration checklist</title>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
963
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
964 <para id="x_4be">Before you continue, do take a few moments to check a few
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
965 aspects of your system's setup.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
966
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
967 <orderedlist>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
968 <listitem><para id="x_4bf">Do you have a web server installed
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
969 at all? Mac OS X and some Linux distributions ship with
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
970 Apache, but many other systems may not have a web server
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
971 installed.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
972 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
973 <listitem><para id="x_4c0">If you have a web server installed, is it
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
974 actually running? On most systems, even if one is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
975 present, it will be disabled by default.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
976 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
977 <listitem><para id="x_4c1">Is your server configured to allow you to run
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
978 CGI programs in the directory where you plan to do so?
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
979 Most servers default to explicitly disabling the ability
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
980 to run CGI programs.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
981 </listitem></orderedlist>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
982
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
983 <para id="x_4c2">If you don't have a web server installed, and don't have
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
984 substantial experience configuring Apache, you should consider
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
985 using the <literal>lighttpd</literal> web server instead of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
986 Apache. Apache has a well-deserved reputation for baroque and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
987 confusing configuration. While <literal>lighttpd</literal> is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
988 less capable in some ways than Apache, most of these
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
989 capabilities are not relevant to serving Mercurial
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
990 repositories. And <literal>lighttpd</literal> is undeniably
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
991 <emphasis>much</emphasis> easier to get started with than
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
992 Apache.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
993 </sect2>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
994
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
995 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
996 <title>Basic CGI configuration</title>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
997
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
998 <para id="x_4c3">On Unix-like systems, it's common for users to have a
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
999 subdirectory named something like <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1000 class="directory">public_html</filename> in their home
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1001 directory, from which they can serve up web pages. A file
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1002 named <filename>foo</filename> in this directory will be
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1003 accessible at a URL of the form
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1004 <literal>http://www.example.com/username/foo</literal>.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1005
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1006 <para id="x_4c4">To get started, find the <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1007 role="special">hgweb.cgi</filename> script that should be
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1008 present in your Mercurial installation. If you can't quickly
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1009 find a local copy on your system, simply download one from the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1010 master Mercurial repository at <ulink
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1011 url="http://www.selenic.com/repo/hg/raw-file/tip/hgweb.cgi">http://www.selenic.com/repo/hg/raw-file/tip/hgweb.cgi</ulink>.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1012
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1013 <para id="x_4c5">You'll need to copy this script into your <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1014 class="directory">public_html</filename> directory, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1015 ensure that it's executable.</para>
679
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1016 <programlisting>cp .../hgweb.cgi ~/public_html
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1017 chmod 755 ~/public_html/hgweb.cgi</programlisting>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1018 <para id="x_4c6">The <literal>755</literal> argument to
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1019 <command>chmod</command> is a little more general than just
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1020 making the script executable: it ensures that the script is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1021 executable by anyone, and that <quote>group</quote> and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1022 <quote>other</quote> write permissions are
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1023 <emphasis>not</emphasis> set. If you were to leave those
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1024 write permissions enabled, Apache's <literal>suexec</literal>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1025 subsystem would likely refuse to execute the script. In fact,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1026 <literal>suexec</literal> also insists that the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1027 <emphasis>directory</emphasis> in which the script resides
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1028 must not be writable by others.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1029 <programlisting>chmod 755 ~/public_html</programlisting>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1030
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1031 <sect3 id="sec:collab:wtf">
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1032 <title>What could <emphasis>possibly</emphasis> go
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1033 wrong?</title>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1034
804
83540574ee49 removed whitespace from URLs
Raphael Borun Das Gupta <hg@raphael.dasgupta.ch>
parents: 773
diff changeset
1035 <para id="x_4c7">Once you've copied the CGI script into place,
806
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1036 go into a web browser, and try to open the URL
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1037 <literal>http://myhostname/~myuser/hgweb.cgi</literal>,
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1038 <emphasis>but</emphasis> brace yourself for instant failure.
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1039 There's a high probability that trying to visit this URL
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1040 will fail, and there are many possible reasons for this. In
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1041 fact, you're likely to stumble over almost every one of the
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1042 possible errors below, so please read carefully. The
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1043 following are all of the problems I ran into on a system
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1044 running Fedora 7, with a fresh installation of Apache, and a
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1045 user account that I created specially to perform this
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1046 exercise.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1047
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1048 <para id="x_4c8">Your web server may have per-user directories disabled.
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1049 If you're using Apache, search your config file for a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1050 <literal>UserDir</literal> directive. If there's none
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1051 present, per-user directories will be disabled. If one
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1052 exists, but its value is <literal>disabled</literal>, then
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1053 per-user directories will be disabled. Otherwise, the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1054 string after <literal>UserDir</literal> gives the name of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1055 the subdirectory that Apache will look in under your home
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1056 directory, for example <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1057 class="directory">public_html</filename>.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1058
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1059 <para id="x_4c9">Your file access permissions may be too restrictive.
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1060 The web server must be able to traverse your home directory
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1061 and directories under your <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1062 class="directory">public_html</filename> directory, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1063 read files under the latter too. Here's a quick recipe to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1064 help you to make your permissions more appropriate.</para>
679
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1065 <programlisting>chmod 755 ~
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1066 find ~/public_html -type d -print0 | xargs -0r chmod 755
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1067 find ~/public_html -type f -print0 | xargs -0r chmod 644</programlisting>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1068
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1069 <para id="x_4ca">The other possibility with permissions is that you might
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1070 get a completely empty window when you try to load the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1071 script. In this case, it's likely that your access
660
21c62e09b99f Typo and spelling corrections. Removed tex tags.
Ori Avtalion <ori@avtalion.name>
parents: 659
diff changeset
1072 permissions are <emphasis>too permissive</emphasis>. Apache's
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1073 <literal>suexec</literal> subsystem won't execute a script
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1074 that's group- or world-writable, for example.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1075
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1076 <para id="x_4cb">Your web server may be configured to disallow execution
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1077 of CGI programs in your per-user web directory. Here's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1078 Apache's default per-user configuration from my Fedora
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1079 system.</para>
679
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1080
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1081 &ch06-apache-config.lst;
80928ea6e7ae Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents: 671
diff changeset
1082
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1083 <para id="x_4cc">If you find a similar-looking
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1084 <literal>Directory</literal> group in your Apache
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1085 configuration, the directive to look at inside it is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1086 <literal>Options</literal>. Add <literal>ExecCGI</literal>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1087 to the end of this list if it's missing, and restart the web
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1088 server.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1089
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1090 <para id="x_4cd">If you find that Apache serves you the text of the CGI
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1091 script instead of executing it, you may need to either
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1092 uncomment (if already present) or add a directive like
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1093 this.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1094 <programlisting>AddHandler cgi-script .cgi</programlisting>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1095
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1096 <para id="x_4ce">The next possibility is that you might be served with a
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1097 colourful Python backtrace claiming that it can't import a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1098 <literal>mercurial</literal>-related module. This is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1099 actually progress! The server is now capable of executing
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1100 your CGI script. This error is only likely to occur if
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1101 you're running a private installation of Mercurial, instead
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1102 of a system-wide version. Remember that the web server runs
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1103 the CGI program without any of the environment variables
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1104 that you take for granted in an interactive session. If
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1105 this error happens to you, edit your copy of <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1106 role="special">hgweb.cgi</filename> and follow the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1107 directions inside it to correctly set your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1108 <envar>PYTHONPATH</envar> environment variable.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1109
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1110 <para id="x_4cf">Finally, you are <emphasis>certain</emphasis> to by
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1111 served with another colourful Python backtrace: this one
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1112 will complain that it can't find <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1113 class="directory">/path/to/repository</filename>. Edit
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1114 your <filename role="special">hgweb.cgi</filename> script
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1115 and replace the <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1116 class="directory">/path/to/repository</filename> string
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1117 with the complete path to the repository you want to serve
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1118 up.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1119
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1120 <para id="x_4d0">At this point, when you try to reload the page, you
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1121 should be presented with a nice HTML view of your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1122 repository's history. Whew!</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1123 </sect3>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1124
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1125 <sect3>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1126 <title>Configuring lighttpd</title>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1127
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1128 <para id="x_4d1">To be exhaustive in my experiments, I tried configuring
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1129 the increasingly popular <literal>lighttpd</literal> web
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1130 server to serve the same repository as I described with
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1131 Apache above. I had already overcome all of the problems I
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1132 outlined with Apache, many of which are not server-specific.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1133 As a result, I was fairly sure that my file and directory
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1134 permissions were good, and that my <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1135 role="special">hgweb.cgi</filename> script was properly
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1136 edited.</para>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1137
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1138 <para id="x_4d2">Once I had Apache running, getting
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1139 <literal>lighttpd</literal> to serve the repository was a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1140 snap (in other words, even if you're trying to use
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1141 <literal>lighttpd</literal>, you should read the Apache
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1142 section). I first had to edit the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1143 <literal>mod_access</literal> section of its config file to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1144 enable <literal>mod_cgi</literal> and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1145 <literal>mod_userdir</literal>, both of which were disabled
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1146 by default on my system. I then added a few lines to the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1147 end of the config file, to configure these modules.</para>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1148 <programlisting>userdir.path = "public_html"
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1149 cgi.assign = (".cgi" =&gt; "" )</programlisting>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1150 <para id="x_4d3">With this done, <literal>lighttpd</literal> ran
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1151 immediately for me. If I had configured
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1152 <literal>lighttpd</literal> before Apache, I'd almost
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1153 certainly have run into many of the same system-level
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1154 configuration problems as I did with Apache. However, I
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1155 found <literal>lighttpd</literal> to be noticeably easier to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1156 configure than Apache, even though I've used Apache for over
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1157 a decade, and this was my first exposure to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1158 <literal>lighttpd</literal>.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1159 </sect3>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1160 </sect2>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1161
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1162 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1163 <title>Sharing multiple repositories with one CGI script</title>
210
27b2c7c46af3 Start talking about basic CGI/HTTP configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 209
diff changeset
1164
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1165 <para id="x_4d4">The <filename role="special">hgweb.cgi</filename> script
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1166 only lets you publish a single repository, which is an
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1167 annoying restriction. If you want to publish more than one
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1168 without wracking yourself with multiple copies of the same
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1169 script, each with different names, a better choice is to use
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1170 the <filename role="special">hgwebdir.cgi</filename>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1171 script.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1172
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1173 <para id="x_4d5">The procedure to configure <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1174 role="special">hgwebdir.cgi</filename> is only a little more
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1175 involved than for <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1176 role="special">hgweb.cgi</filename>. First, you must obtain
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1177 a copy of the script. If you don't have one handy, you can
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1178 download a copy from the master Mercurial repository at <ulink
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1179 url="http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi">http://www.selenic.com/repo/hg/raw-file/tip/hgwebdir.cgi</ulink>.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
1180
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1181 <para id="x_4d6">You'll need to copy this script into your <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1182 class="directory">public_html</filename> directory, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1183 ensure that it's executable.</para>
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1184
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1185 <programlisting>cp .../hgwebdir.cgi ~/public_html
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1186 chmod 755 ~/public_html ~/public_html/hgwebdir.cgi</programlisting>
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1187
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1188 <para id="x_4d7">With basic configuration out of the way, try to
806
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1189 visit <literal>http://myhostname/~myuser/hgwebdir.cgi</literal>
804
83540574ee49 removed whitespace from URLs
Raphael Borun Das Gupta <hg@raphael.dasgupta.ch>
parents: 773
diff changeset
1190 in your browser. It should
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1191 display an empty list of repositories. If you get a blank
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1192 window or error message, try walking through the list of
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1193 potential problems in <xref
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1194 linkend="sec:collab:wtf"/>.</para>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1195
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1196 <para id="x_4d8">The <filename role="special">hgwebdir.cgi</filename>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1197 script relies on an external configuration file. By default,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1198 it searches for a file named <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1199 role="special">hgweb.config</filename> in the same directory
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1200 as itself. You'll need to create this file, and make it
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1201 world-readable. The format of the file is similar to a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1202 Windows <quote>ini</quote> file, as understood by Python's
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1203 <literal>ConfigParser</literal>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1204 <citation>web:configparser</citation> module.</para>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1205
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1206 <para id="x_4d9">The easiest way to configure <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1207 role="special">hgwebdir.cgi</filename> is with a section
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1208 named <literal>collections</literal>. This will automatically
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1209 publish <emphasis>every</emphasis> repository under the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1210 directories you name. The section should look like
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1211 this:</para>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1212 <programlisting>[collections]
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1213 /my/root = /my/root</programlisting>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1214 <para id="x_4da">Mercurial interprets this by looking at the directory name
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1215 on the <emphasis>right</emphasis> hand side of the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1216 <quote><literal>=</literal></quote> sign; finding repositories
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1217 in that directory hierarchy; and using the text on the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1218 <emphasis>left</emphasis> to strip off matching text from the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1219 names it will actually list in the web interface. The
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1220 remaining component of a path after this stripping has
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1221 occurred is called a <quote>virtual path</quote>.</para>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1222
806
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1223 <para id="x_4db">Given the example above, if we have a
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1224 repository whose local path is <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1225 class="directory">/my/root/this/repo</filename>, the CGI
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1226 script will strip the leading <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1227 class="directory">/my/root</filename> from the name, and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1228 publish the repository with a virtual path of <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1229 class="directory">this/repo</filename>. If the base URL for
806
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1230 our CGI script is
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1231 <literal>http://myhostname/~myuser/hgwebdir.cgi</literal>, the
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1232 complete URL for that repository will be
06458701453c Fix up some links to example URLs that aren't actually real.
Bryan O'Sullivan <bos@serpentine.com>
parents: 805
diff changeset
1233 <literal>http://myhostname/~myuser/hgwebdir.cgi/this/repo</literal>.</para>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1234
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1235 <para id="x_4dc">If we replace <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1236 class="directory">/my/root</filename> on the left hand side
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1237 of this example with <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1238 class="directory">/my</filename>, then <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1239 role="special">hgwebdir.cgi</filename> will only strip off
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1240 <filename class="directory">/my</filename> from the repository
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1241 name, and will give us a virtual path of <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1242 class="directory">root/this/repo</filename> instead of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1243 <filename class="directory">this/repo</filename>.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1244
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1245 <para id="x_4dd">The <filename role="special">hgwebdir.cgi</filename>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1246 script will recursively search each directory listed in the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1247 <literal>collections</literal> section of its configuration
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1248 file, but it will <literal>not</literal> recurse into the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1249 repositories it finds.</para>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1250
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1251 <para id="x_4de">The <literal>collections</literal> mechanism makes it easy
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1252 to publish many repositories in a <quote>fire and
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1253 forget</quote> manner. You only need to set up the CGI
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1254 script and configuration file one time. Afterwards, you can
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1255 publish or unpublish a repository at any time by simply moving
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1256 it into, or out of, the directory hierarchy in which you've
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1257 configured <filename role="special">hgwebdir.cgi</filename> to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1258 look.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1259
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1260 <sect3>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1261 <title>Explicitly specifying which repositories to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1262 publish</title>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1263
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1264 <para id="x_4df">In addition to the <literal>collections</literal>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1265 mechanism, the <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1266 role="special">hgwebdir.cgi</filename> script allows you
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1267 to publish a specific list of repositories. To do so,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1268 create a <literal>paths</literal> section, with contents of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1269 the following form.</para>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1270 <programlisting>[paths]
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1271 repo1 = /my/path/to/some/repo
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1272 repo2 = /some/path/to/another</programlisting>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1273 <para id="x_4e0">In this case, the virtual path (the component that will
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1274 appear in a URL) is on the left hand side of each
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1275 definition, while the path to the repository is on the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1276 right. Notice that there does not need to be any
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1277 relationship between the virtual path you choose and the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1278 location of a repository in your filesystem.</para>
211
b461d7ead9e1 Start to document hgwebdir.cgi.
Bryan O'Sullivan <bos@serpentine.com>
parents: 210
diff changeset
1279
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1280 <para id="x_4e1">If you wish, you can use both the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1281 <literal>collections</literal> and <literal>paths</literal>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1282 mechanisms simultaneously in a single configuration
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1283 file.</para>
159
7355af913937 First steps on collaboration chapter.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
1284
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1285 <note>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1286 <title>Beware duplicate virtual paths</title>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1287
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1288 <para id="x_4e2"> If several repositories have the same
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1289 virtual path, <filename
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1290 role="special">hgwebdir.cgi</filename> will not report
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1291 an error. Instead, it will behave unpredictably.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1292 </note>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1293 </sect3>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1294 </sect2>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1295
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1296 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1297 <title>Downloading source archives</title>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1298
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1299 <para id="x_4e3">Mercurial's web interface lets users download an archive
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1300 of any revision. This archive will contain a snapshot of the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1301 working directory as of that revision, but it will not contain
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1302 a copy of the repository data.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1303
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1304 <para id="x_4e4">By default, this feature is not enabled. To enable it,
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1305 you'll need to add an <envar
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1306 role="rc-item-web">allow_archive</envar> item to the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1307 <literal role="rc-web">web</literal> section of your <filename
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1308 role="special">~/.hgrc</filename>; see below for details.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1309 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1310 <sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1311 <title>Web configuration options</title>
212
ef8a5e393103 Mention the paths section of a hgwebdir config file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 211
diff changeset
1312
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1313 <para id="x_4e5">Mercurial's web interfaces (the <command role="hg-cmd">hg
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1314 serve</command> command, and the <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1315 role="special">hgweb.cgi</filename> and <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1316 role="special">hgwebdir.cgi</filename> scripts) have a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1317 number of configuration options that you can set. These
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1318 belong in a section named <literal
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1319 role="rc-web">web</literal>.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1320 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1321 <listitem><para id="x_4e6"><envar
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1322 role="rc-item-web">allow_archive</envar>: Determines
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1323 which (if any) archive download mechanisms Mercurial
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1324 supports. If you enable this feature, users of the web
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1325 interface will be able to download an archive of whatever
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1326 revision of a repository they are viewing. To enable the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1327 archive feature, this item must take the form of a
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1328 sequence of words drawn from the list below.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1329 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1330 <listitem><para id="x_4e7"><literal>bz2</literal>: A
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1331 <command>tar</command> archive, compressed using
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1332 <literal>bzip2</literal> compression. This has the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1333 best compression ratio, but uses the most CPU time on
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1334 the server.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1335 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1336 <listitem><para id="x_4e8"><literal>gz</literal>: A
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1337 <command>tar</command> archive, compressed using
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1338 <literal>gzip</literal> compression.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1339 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1340 <listitem><para id="x_4e9"><literal>zip</literal>: A
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1341 <command>zip</command> archive, compressed using LZW
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1342 compression. This format has the worst compression
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1343 ratio, but is widely used in the Windows world.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1344 </listitem>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1345 </itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1346 <para id="x_4ea"> If you provide an empty list, or don't have an
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1347 <envar role="rc-item-web">allow_archive</envar> entry at
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1348 all, this feature will be disabled. Here is an example of
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1349 how to enable all three supported formats.</para>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1350 <programlisting>[web]
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1351 allow_archive = bz2 gz zip</programlisting>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1352 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1353 <listitem><para id="x_4eb"><envar role="rc-item-web">allowpull</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1354 Boolean. Determines whether the web interface allows
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1355 remote users to <command role="hg-cmd">hg pull</command>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1356 and <command role="hg-cmd">hg clone</command> this
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1357 repository over HTTP. If set to <literal>no</literal> or
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1358 <literal>false</literal>, only the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1359 <quote>human-oriented</quote> portion of the web interface
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1360 is available.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1361 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1362 <listitem><para id="x_4ec"><envar role="rc-item-web">contact</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1363 String. A free-form (but preferably brief) string
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1364 identifying the person or group in charge of the
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1365 repository. This often contains the name and email
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1366 address of a person or mailing list. It often makes sense
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1367 to place this entry in a repository's own <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1368 role="special">.hg/hgrc</filename> file, but it can make
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1369 sense to use in a global <filename
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1370 role="special">~/.hgrc</filename> if every repository
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1371 has a single maintainer.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1372 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1373 <listitem><para id="x_4ed"><envar role="rc-item-web">maxchanges</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1374 Integer. The default maximum number of changesets to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1375 display in a single page of output.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1376 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1377 <listitem><para id="x_4ee"><envar role="rc-item-web">maxfiles</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1378 Integer. The default maximum number of modified files to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1379 display in a single page of output.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1380 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1381 <listitem><para id="x_4ef"><envar role="rc-item-web">stripes</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1382 Integer. If the web interface displays alternating
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1383 <quote>stripes</quote> to make it easier to visually align
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1384 rows when you are looking at a table, this number controls
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1385 the number of rows in each stripe.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1386 </listitem>
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1387 <listitem><para id="x_4f0"><envar
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1388 role="rc-item-web">style</envar>: Controls the template
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1389 Mercurial uses to display the web interface. Mercurial
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1390 ships with several web templates.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1391 <itemizedlist>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1392 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1393 <para id="x_6aa"><literal>coal</literal> is monochromatic.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1394 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1395 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1396 <para id="x_6ab"><literal>gitweb</literal> emulates the visual
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1397 style of git's web interface.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1398 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1399 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1400 <para id="x_6ac"><literal>monoblue</literal> uses solid blues and
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1401 greys.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1402 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1403 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1404 <para id="x_6ad"><literal>paper</literal> is the default.</para>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1405 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1406 <listitem>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1407 <para id="x_6ae"><literal>spartan</literal> was the default for a
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1408 long time.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1409 </listitem>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1410 </itemizedlist>
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1411 <para id="x_6af">You can
691
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1412 also specify a custom template of your own; see
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1413 <xref linkend="chap:template"/> for details. Here, you can
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1414 see how to enable the <literal>gitweb</literal>
4ce9d0754af3 Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents: 690
diff changeset
1415 style.</para>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1416 <programlisting>[web]
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1417 style = gitweb</programlisting>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1418 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1419 <listitem><para id="x_4f1"><envar role="rc-item-web">templates</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1420 Path. The directory in which to search for template
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1421 files. By default, Mercurial searches in the directory in
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1422 which it was installed.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1423 </listitem></itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1424 <para id="x_4f2">If you are using <filename
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1425 role="special">hgwebdir.cgi</filename>, you can place a few
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1426 configuration items in a <literal role="rc-web">web</literal>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1427 section of the <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1428 role="special">hgweb.config</filename> file instead of a
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1429 <filename role="special">~/.hgrc</filename> file, for
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1430 convenience. These items are <envar
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1431 role="rc-item-web">motd</envar> and <envar
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1432 role="rc-item-web">style</envar>.</para>
215
70e1f8448699 Document some hgweb config options.
Bryan O'Sullivan <bos@serpentine.com>
parents: 212
diff changeset
1433
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1434 <sect3>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1435 <title>Options specific to an individual repository</title>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1436
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1437 <para id="x_4f3">A few <literal role="rc-web">web</literal> configuration
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1438 items ought to be placed in a repository's local <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1439 role="special">.hg/hgrc</filename>, rather than a user's
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1440 or global <filename role="special">~/.hgrc</filename>.</para>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1441 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1442 <listitem><para id="x_4f4"><envar
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1443 role="rc-item-web">description</envar>: String. A
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1444 free-form (but preferably brief) string that describes
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1445 the contents or purpose of the repository.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1446 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1447 <listitem><para id="x_4f5"><envar role="rc-item-web">name</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1448 String. The name to use for the repository in the web
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1449 interface. This overrides the default name, which is
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1450 the last component of the repository's path.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1451 </listitem></itemizedlist>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1452 </sect3>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1453
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1454 <sect3>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1455 <title>Options specific to the <command role="hg-cmd">hg
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1456 serve</command> command</title>
215
70e1f8448699 Document some hgweb config options.
Bryan O'Sullivan <bos@serpentine.com>
parents: 212
diff changeset
1457
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1458 <para id="x_4f6">Some of the items in the <literal
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1459 role="rc-web">web</literal> section of a <filename
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1460 role="special">~/.hgrc</filename> file are only for use
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1461 with the <command role="hg-cmd">hg serve</command>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1462 command.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1463 <itemizedlist>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1464 <listitem><para id="x_4f7"><envar role="rc-item-web">accesslog</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1465 Path. The name of a file into which to write an access
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1466 log. By default, the <command role="hg-cmd">hg
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1467 serve</command> command writes this information to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1468 standard output, not to a file. Log entries are written
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1469 in the standard <quote>combined</quote> file format used
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1470 by almost all web servers.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1471 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1472 <listitem><para id="x_4f8"><envar role="rc-item-web">address</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1473 String. The local address on which the server should
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1474 listen for incoming connections. By default, the server
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1475 listens on all addresses.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1476 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1477 <listitem><para id="x_4f9"><envar role="rc-item-web">errorlog</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1478 Path. The name of a file into which to write an error
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1479 log. By default, the <command role="hg-cmd">hg
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1480 serve</command> command writes this information to
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1481 standard error, not to a file.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1482 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1483 <listitem><para id="x_4fa"><envar role="rc-item-web">ipv6</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1484 Boolean. Whether to use the IPv6 protocol. By default,
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1485 IPv6 is not used.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1486 </listitem>
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1487 <listitem><para id="x_4fb"><envar role="rc-item-web">port</envar>:
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1488 Integer. The TCP port number on which the server should
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1489 listen. The default port number used is 8000.</para>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1490 </listitem></itemizedlist>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1491 </sect3>
215
70e1f8448699 Document some hgweb config options.
Bryan O'Sullivan <bos@serpentine.com>
parents: 212
diff changeset
1492
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1493 <sect3>
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1494 <title>Choosing the right <filename
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1495 role="special">~/.hgrc</filename> file to add <literal
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1496 role="rc-web">web</literal> items to</title>
215
70e1f8448699 Document some hgweb config options.
Bryan O'Sullivan <bos@serpentine.com>
parents: 212
diff changeset
1497
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1498 <para id="x_4fc">It is important to remember that a web server like
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1499 Apache or <literal>lighttpd</literal> will run under a user
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1500 ID that is different to yours. CGI scripts run by your
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1501 server, such as <filename
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1502 role="special">hgweb.cgi</filename>, will usually also run
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1503 under that user ID.</para>
216
699771d085c6 More notes on web configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 215
diff changeset
1504
683
c838b3975bc6 Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 682
diff changeset
1505 <para id="x_4fd">If you add <literal role="rc-web">web</literal> items to
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1506 your own personal <filename role="special">~/.hgrc</filename> file, CGI scripts won't read that
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1507 <filename role="special">~/.hgrc</filename> file. Those
771
b338f5490029 Americanize spellings :-(
Bryan O'Sullivan <bos@serpentine.com>
parents: 754
diff changeset
1508 settings will thus only affect the behavior of the <command
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1509 role="hg-cmd">hg serve</command> command when you run it.
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1510 To cause CGI scripts to see your settings, either create a
680
8366882f67f2 Fix up more formatting goop
Bryan O'Sullivan <bos@serpentine.com>
parents: 679
diff changeset
1511 <filename role="special">~/.hgrc</filename> file in the
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1512 home directory of the user ID that runs your web server, or
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1513 add those settings to a system-wide <filename
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1514 role="special">hgrc</filename> file.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1515 </sect3>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1516 </sect2>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1517 </sect1>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1518
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1519 <sect1>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1520 <title>System-wide configuration</title>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1521
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1522 <para id="x_6b0">On Unix-like systems shared by multiple users (such as a
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1523 server to which people publish changes), it often makes sense to
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1524 set up some global default behaviors, such as what theme to use
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1525 in web interfaces.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1526
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1527 <para id="x_6b1">If a file named <filename>/etc/mercurial/hgrc</filename>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1528 exists, Mercurial will read it at startup time and apply any
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1529 configuration settings it finds in that file. It will also look
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1530 for files ending in a <literal>.rc</literal> extension in a
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1531 directory named <filename>/etc/mercurial/hgrc.d</filename>, and
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1532 apply any configuration settings it finds in each of those
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1533 files.</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1534
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1535 <sect2>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1536 <title>Making Mercurial more trusting</title>
216
699771d085c6 More notes on web configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 215
diff changeset
1537
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1538 <para id="x_6b2">One situation in which a global <filename>hgrc</filename>
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1539 can be useful is if users are pulling changes owned by other
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1540 users. By default, Mercurial will not trust most of the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1541 configuration items in a <filename>.hg/hgrc</filename> file
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1542 inside a repository that is owned by a different user. If we
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1543 clone or pull changes from such a repository, Mercurial will
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1544 print a warning stating that it does not trust their
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1545 <filename>.hg/hgrc</filename>.</para>
216
699771d085c6 More notes on web configuration.
Bryan O'Sullivan <bos@serpentine.com>
parents: 215
diff changeset
1546
775
29f0f79cf614 Update paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents: 774
diff changeset
1547 <para id="x_6b3">If everyone in a particular Unix group is on the same team
774
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1548 and <emphasis>should</emphasis> trust each other's
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1549 configuration settings, or we want to trust particular users,
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1550 we can override Mercurial's skeptical defaults by creating a
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1551 system-wide <filename>hgrc</filename> file such as the
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1552 following:</para>
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1553
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1554 <programlisting># Save this as e.g. /etc/mercurial/hgrc.d/trust.rc
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1555 [trusted]
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1556 # Trust all entries in any hgrc file owned by the "editors" or
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1557 # "www-data" groups.
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1558 groups = editors, www-data
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1559
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1560 # Trust entries in hgrc files owned by the following users.
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1561 users = apache, bobo
e6c99cbd0abd Updates to chapters 5, 6, and 7
Bryan O'Sullivan <bos@serpentine.com>
parents: 773
diff changeset
1562 </programlisting>
658
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1563 </sect2>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1564 </sect1>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1565 </chapter>
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1566
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1567 <!--
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1568 local variables:
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1569 sgml-parent-document: ("00book.xml" "book" "chapter")
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1570 end:
b90b024729f1 WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents: 650
diff changeset
1571 -->