hgbook

diff en/ch06-collab.xml @ 647:d0160b0b1a9e

Merge with http://hg.serpentine.com/mercurial/book
author Dongsheng Song <dongsheng.song@gmail.com>
date Wed Mar 18 20:32:37 2009 +0800 (2009-03-18)
parents a13813534ccd 8366882f67f2
children e0ac2341a861
line diff
     1.1 --- a/en/ch06-collab.xml	Tue Mar 17 10:43:45 2009 +0800
     1.2 +++ b/en/ch06-collab.xml	Wed Mar 18 20:32:37 2009 +0800
     1.3 @@ -539,8 +539,8 @@
     1.4  	</listitem>
     1.5  	<listitem><para>The <quote>:22</quote> identifies the port
     1.6  	    number to connect to the server on.  The default port is
     1.7 -	    22, so you only need to specify this part if you're
     1.8 -	    <emphasis>not</emphasis> using port 22.</para>
     1.9 +	    22, so you only need to specify a colon and port number if
    1.10 +	    you're <emphasis>not</emphasis> using port 22.</para>
    1.11  	</listitem>
    1.12  	<listitem><para>The remainder of the URL is the local path to
    1.13  	    the repository on the server.</para>
    1.14 @@ -595,19 +595,20 @@
    1.15  	<listitem><para>If you have a high tolerance for pain, you can
    1.16  	    use the Cygwin port of OpenSSH.</para>
    1.17  	</listitem></itemizedlist>
    1.18 -      <para>In either case, you'll need to edit your \hgini\ file to
    1.19 +      <para>In either case, you'll need to edit your <filename
    1.20 +      role="special">hg.ini</filename> file to
    1.21  	tell Mercurial where to find the actual client command.  For
    1.22  	example, if you're using PuTTY, you'll need to use the
    1.23  	<command>plink</command> command as a command-line ssh
    1.24  	client.</para>
    1.25 -      <programlisting>[ui] ssh = C:/path/to/plink.exe -ssh -i
    1.26 -	"C:/path/to/my/private/key"</programlisting>
    1.27 +      <programlisting>[ui]
    1.28 +ssh = C:/path/to/plink.exe -ssh -i "C:/path/to/my/private/key"</programlisting>
    1.29  
    1.30        <note>
    1.31  	<para>  The path to <command>plink</command> shouldn't contain
    1.32  	  any whitespace characters, or Mercurial may not be able to
    1.33  	  run it correctly (so putting it in <filename
    1.34 -	    class="directory">C:\\Program Files</filename> is probably
    1.35 +	    class="directory">C:\Program Files</filename> is probably
    1.36  	  not a good idea).</para>
    1.37        </note>
    1.38  
    1.39 @@ -784,7 +785,9 @@
    1.40  	your server, the next step is to ensure that Mercurial runs on
    1.41  	the server.  The following command should run
    1.42  	successfully:</para>
    1.43 +
    1.44        <programlisting>ssh myserver hg version</programlisting>
    1.45 +
    1.46        <para>If you see an error message instead of normal <command
    1.47  	  role="hg-cmd">hg version</command> output, this is usually
    1.48  	because you haven't installed Mercurial to <filename
    1.49 @@ -841,17 +844,19 @@
    1.50        <para>Both <command>ssh</command> and <command>plink</command>
    1.51  	accept a <option role="cmd-opt-ssh">-C</option> option which
    1.52  	turns on compression.  You can easily edit your <filename
    1.53 -	  role="special"> /.hgrc</filename>\ to enable compression for
    1.54 +	  role="special">~/.hgrc</filename> to enable compression for
    1.55  	all of Mercurial's uses of the ssh protocol.</para>
    1.56 -      <programlisting>[ui] ssh = ssh -C</programlisting>
    1.57 +      <programlisting>[ui]
    1.58 +ssh = ssh -C</programlisting>
    1.59  
    1.60        <para>If you use <command>ssh</command>, you can configure it to
    1.61  	always use compression when talking to your server.  To do
    1.62  	this, edit your <filename
    1.63  	  role="special">.ssh/config</filename> file (which may not
    1.64  	yet exist), as follows.</para>
    1.65 -      <programlisting>Host hg Compression yes HostName
    1.66 -	hg.example.com</programlisting>
    1.67 +      <programlisting>Host hg
    1.68 +  Compression yes
    1.69 +  HostName hg.example.com</programlisting>
    1.70        <para>This defines an alias, <literal>hg</literal>.  When you
    1.71  	use it on the <command>ssh</command> command line or in a
    1.72  	Mercurial <literal>ssh</literal>-protocol URL, it will cause
    1.73 @@ -926,8 +931,7 @@
    1.74  	directory, from which they can serve up web pages.  A file
    1.75  	named <filename>foo</filename> in this directory will be
    1.76  	accessible at a URL of the form
    1.77 -	<literal>http://www.example.com/\
    1.78 -	  {</literal>username/foo}.</para>
    1.79 +	<literal>http://www.example.com/username/foo</literal>.</para>
    1.80  
    1.81        <para>To get started, find the <filename
    1.82  	  role="special">hgweb.cgi</filename> script that should be
    1.83 @@ -939,8 +943,8 @@
    1.84        <para>You'll need to copy this script into your <filename
    1.85  	  class="directory">public_html</filename> directory, and
    1.86  	ensure that it's executable.</para>
    1.87 -      <programlisting>cp .../hgweb.cgi ~/public_html chmod 755
    1.88 -	~/public_html/hgweb.cgi</programlisting>
    1.89 +      <programlisting>cp .../hgweb.cgi ~/public_html
    1.90 +chmod 755 ~/public_html/hgweb.cgi</programlisting>
    1.91        <para>The <literal>755</literal> argument to
    1.92  	<command>chmod</command> is a little more general than just
    1.93  	making the script executable: it ensures that the script is
    1.94 @@ -989,9 +993,9 @@
    1.95  	    class="directory">public_html</filename> directory, and
    1.96  	  read files under the latter too.  Here's a quick recipe to
    1.97  	  help you to make your permissions more appropriate.</para>
    1.98 -	<programlisting>chmod 755 ~ find ~/public_html -type d -print0
    1.99 -	  | xargs -0r chmod 755 find ~/public_html -type f -print0 |
   1.100 -	  xargs -0r chmod 644</programlisting>
   1.101 +	<programlisting>chmod 755 ~
   1.102 +find ~/public_html -type d -print0 | xargs -0r chmod 755
   1.103 +find ~/public_html -type f -print0 | xargs -0r chmod 644</programlisting>
   1.104  
   1.105  	<para>The other possibility with permissions is that you might
   1.106  	  get a completely empty window when you try to load the
   1.107 @@ -1004,13 +1008,9 @@
   1.108  	  of CGI programs in your per-user web directory.  Here's
   1.109  	  Apache's default per-user configuration from my Fedora
   1.110  	  system.</para>
   1.111 -	<programlisting>&lt;Directory /home/*/public_html&gt;
   1.112 -	  AllowOverride FileInfo AuthConfig Limit Options MultiViews
   1.113 -	  Indexes SymLinksIfOwnerMatch IncludesNoExec &lt;Limit GET
   1.114 -	  POST OPTIONS&gt; Order allow,deny Allow from all
   1.115 -	  &lt;/Limit&gt; &lt;LimitExcept GET POST OPTIONS&gt; Order
   1.116 -	  deny,allow Deny from all &lt;/LimitExcept&gt;
   1.117 -	  &lt;/Directory&gt;</programlisting>
   1.118 +
   1.119 +	&ch06-apache-config.lst;
   1.120 +
   1.121  	<para>If you find a similar-looking
   1.122  	  <literal>Directory</literal> group in your Apache
   1.123  	  configuration, the directive to look at inside it is
   1.124 @@ -1076,8 +1076,8 @@
   1.125  	  <literal>mod_userdir</literal>, both of which were disabled
   1.126  	  by default on my system.  I then added a few lines to the
   1.127  	  end of the config file, to configure these modules.</para>
   1.128 -	<programlisting>userdir.path = "public_html" cgi.assign = (
   1.129 -	  ".cgi" =&gt; "" )</programlisting>
   1.130 +	<programlisting>userdir.path = "public_html"
   1.131 +cgi.assign = (".cgi" =&gt; "" )</programlisting>
   1.132  	<para>With this done, <literal>lighttpd</literal> ran
   1.133  	  immediately for me.  If I had configured
   1.134  	  <literal>lighttpd</literal> before Apache, I'd almost
   1.135 @@ -1112,8 +1112,8 @@
   1.136        <para>You'll need to copy this script into your <filename
   1.137  	  class="directory">public_html</filename> directory, and
   1.138  	ensure that it's executable.</para>
   1.139 -      <programlisting>cp .../hgwebdir.cgi ~/public_html chmod 755
   1.140 -	~/public_html ~/public_html/hgwebdir.cgi</programlisting>
   1.141 +      <programlisting>cp .../hgwebdir.cgi ~/public_html
   1.142 +chmod 755 ~/public_html ~/public_html/hgwebdir.cgi</programlisting>
   1.143        <para>With basic configuration out of the way, try to visit
   1.144  	<ulink url="http://myhostname/
   1.145  	  myuser/hgwebdir.cgi">http://myhostname/
   1.146 @@ -1139,8 +1139,8 @@
   1.147  	publish <emphasis>every</emphasis> repository under the
   1.148  	directories you name.  The section should look like
   1.149  	this:</para>
   1.150 -      <programlisting>[collections] /my/root =
   1.151 -	/my/root</programlisting>
   1.152 +      <programlisting>[collections]
   1.153 +/my/root = /my/root</programlisting>
   1.154        <para>Mercurial interprets this by looking at the directory name
   1.155  	on the <emphasis>right</emphasis> hand side of the
   1.156  	<quote><literal>=</literal></quote> sign; finding repositories
   1.157 @@ -1199,8 +1199,9 @@
   1.158  	  to publish a specific list of repositories.  To do so,
   1.159  	  create a <literal>paths</literal> section, with contents of
   1.160  	  the following form.</para>
   1.161 -	<programlisting>[paths] repo1 = /my/path/to/some/repo repo2 =
   1.162 -	  /some/path/to/another</programlisting>
   1.163 +	<programlisting>[paths]
   1.164 +repo1 = /my/path/to/some/repo
   1.165 +repo2 = /some/path/to/another</programlisting>
   1.166  	<para>In this case, the virtual path (the component that will
   1.167  	  appear in a URL) is on the left hand side of each
   1.168  	  definition, while the path to the repository is on the
   1.169 @@ -1234,7 +1235,7 @@
   1.170  	you'll need to add an <envar
   1.171  	  role="rc-item-web">allow_archive</envar> item to the
   1.172  	<literal role="rc-web">web</literal> section of your <filename
   1.173 -	  role="special"> /.hgrc</filename>.</para>
   1.174 +	  role="special">~/.hgrc</filename>.</para>
   1.175  
   1.176      </sect2>
   1.177      <sect2>
   1.178 @@ -1277,8 +1278,8 @@
   1.179  	    <envar role="rc-item-web">allow_archive</envar> entry at
   1.180  	    all, this feature will be disabled.  Here is an example of
   1.181  	    how to enable all three supported formats.</para>
   1.182 -	  <programlisting>[web] allow_archive = bz2 gz
   1.183 -	    zip</programlisting>
   1.184 +	  <programlisting>[web]
   1.185 +allow_archive = bz2 gz zip</programlisting>
   1.186  	</listitem>
   1.187  	<listitem><para><envar role="rc-item-web">allowpull</envar>:
   1.188  	    Boolean.  Determines whether the web interface allows
   1.189 @@ -1296,9 +1297,9 @@
   1.190  	    address of a person or mailing list.  It often makes sense
   1.191  	    to place this entry in a repository's own <filename
   1.192  	      role="special">.hg/hgrc</filename> file, but it can make
   1.193 -	    sense to use in a global <filename role="special">
   1.194 -	      /.hgrc</filename>\ if every repository has a single
   1.195 -	    maintainer.</para>
   1.196 +	    sense to use in a global <filename
   1.197 +	      role="special">~/.hgrc</filename> if every repository
   1.198 +	    has a single maintainer.</para>
   1.199  	</listitem>
   1.200  	<listitem><para><envar role="rc-item-web">maxchanges</envar>:
   1.201  	    Integer.  The default maximum number of changesets to
   1.202 @@ -1323,7 +1324,8 @@
   1.203  	    <xref linkend="chap.template"/> for details.
   1.204  	    Here, you can see how to enable the
   1.205  	    <literal>gitweb</literal> style.</para>
   1.206 -	  <programlisting>[web] style = gitweb</programlisting>
   1.207 +	  <programlisting>[web]
   1.208 +style = gitweb</programlisting>
   1.209  	</listitem>
   1.210  	<listitem><para><envar role="rc-item-web">templates</envar>:
   1.211  	    Path.  The directory in which to search for template
   1.212 @@ -1335,7 +1337,7 @@
   1.213  	configuration items in a <literal role="rc-web">web</literal>
   1.214  	section of the <filename
   1.215  	  role="special">hgweb.config</filename> file instead of a
   1.216 -	<filename role="special"> /.hgrc</filename>\ file, for
   1.217 +	<filename role="special">~/.hgrc</filename> file, for
   1.218  	convenience.  These items are <envar
   1.219  	  role="rc-item-web">motd</envar> and <envar
   1.220  	  role="rc-item-web">style</envar>.</para>
   1.221 @@ -1346,8 +1348,7 @@
   1.222  	<para>A few <literal role="rc-web">web</literal> configuration
   1.223  	  items ought to be placed in a repository's local <filename
   1.224  	    role="special">.hg/hgrc</filename>, rather than a user's
   1.225 -	  or global <filename role="special">
   1.226 -	    /.hgrc</filename>.</para>
   1.227 +	  or global <filename role="special">~/.hgrc</filename>.</para>
   1.228  	<itemizedlist>
   1.229  	  <listitem><para><envar
   1.230  		role="rc-item-web">description</envar>: String.  A
   1.231 @@ -1367,7 +1368,7 @@
   1.232  
   1.233  	<para>Some of the items in the <literal
   1.234  	    role="rc-web">web</literal> section of a <filename
   1.235 -	    role="special"> /.hgrc</filename>\ file are only for use
   1.236 +	    role="special">~/.hgrc</filename> file are only for use
   1.237  	  with the <command role="hg-cmd">hg serve</command>
   1.238  	  command.</para>
   1.239  	<itemizedlist>
   1.240 @@ -1401,8 +1402,8 @@
   1.241  
   1.242        </sect3>
   1.243        <sect3>
   1.244 -	<title>Choosing the right <filename role="special">
   1.245 -	    /.hgrc</filename>\ file to add <literal
   1.246 +	<title>Choosing the right <filename
   1.247 +	    role="special">~/.hgrc</filename> file to add <literal
   1.248  	    role="rc-web">web</literal> items to</title>
   1.249  
   1.250  	<para>It is important to remember that a web server like
   1.251 @@ -1413,16 +1414,15 @@
   1.252  	  under that user ID.</para>
   1.253  
   1.254  	<para>If you add <literal role="rc-web">web</literal> items to
   1.255 -	  your own personal <filename role="special">
   1.256 -	    /.hgrc</filename>\ file, CGI scripts won't read that
   1.257 -	  <filename role="special"> /.hgrc</filename>\ file.  Those
   1.258 +	  your own personal <filename role="special">~/.hgrc</filename> file, CGI scripts won't read that
   1.259 +	  <filename role="special">~/.hgrc</filename> file.  Those
   1.260  	  settings will thus only affect the behaviour of the <command
   1.261  	    role="hg-cmd">hg serve</command> command when you run it.
   1.262  	  To cause CGI scripts to see your settings, either create a
   1.263 -	  <filename role="special"> /.hgrc</filename>\ file in the
   1.264 +	  <filename role="special">~/.hgrc</filename> file in the
   1.265  	  home directory of the user ID that runs your web server, or
   1.266  	  add those settings to a system-wide <filename
   1.267 -	    role="special"> /.hgrc</filename>\ file.</para>
   1.268 +	    role="special">~/.hgrc</filename> file.</para>
   1.269  
   1.270  
   1.271        </sect3>