hgbook
diff en/ch14-hgext.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 | cfdb601a3c8b 8366882f67f2 |
children |
line diff
1.1 --- a/en/ch14-hgext.xml Thu Mar 12 15:51:39 2009 +0800 1.2 +++ b/en/ch14-hgext.xml Wed Mar 18 20:32:37 2009 +0800 1.3 @@ -166,11 +166,10 @@ 1.4 <orderedlist> 1.5 <listitem><para>Clone the Python <literal>inotify</literal> 1.6 binding repository. Build and install it.</para> 1.7 - <programlisting> 1.8 - hg clone http://hg.kublai.com/python/inotify cd inotify 1.9 - python setup.py build --force sudo python setup.py install 1.10 - --skip-build 1.11 - </programlisting> 1.12 + <programlisting>hg clone http://hg.kublai.com/python/inotify 1.13 +cd inotify 1.14 +python setup.py build --force 1.15 +sudo python setup.py install --skip-build</programlisting> 1.16 </listitem> 1.17 <listitem><para>Clone the <filename 1.18 class="directory">crew</filename> Mercurial repository. 1.19 @@ -178,12 +177,9 @@ 1.20 repository so that Mercurial Queues will be able to apply 1.21 patches to your cope of the <filename 1.22 class="directory">crew</filename> repository.</para> 1.23 - <programlisting> 1.24 - hg clone http://hg.intevation.org/mercurial/crew hg clone 1.25 - crew inotify hg clone 1.26 - http://hg.kublai.com/mercurial/patches/inotify 1.27 - inotify/.hg/patches 1.28 - </programlisting> 1.29 + <programlisting>hg clone http://hg.intevation.org/mercurial/crew 1.30 +hg clone crew inotify 1.31 +hg clone http://hg.kublai.com/mercurial/patches/inotify inotify/.hg/patches</programlisting> 1.32 </listitem> 1.33 <listitem><para>Make sure that you have the Mercurial Queues 1.34 extension, <literal role="hg-ext">mq</literal>, enabled. If 1.35 @@ -197,9 +193,8 @@ 1.36 using the <option role="hg-ext-mq-cmd-qpush-opt">hg 1.37 -a</option> option to the <command 1.38 role="hg-ext-mq">qpush</command> command.</para> 1.39 - <programlisting> 1.40 - cd inotify hg qpush -a 1.41 - </programlisting> 1.42 + <programlisting>cd inotify 1.43 +hg qpush -a</programlisting> 1.44 </listitem> 1.45 <listitem><para> If you get an error message from <command 1.46 role="hg-ext-mq">qpush</command>, you should not continue. 1.47 @@ -207,16 +202,14 @@ 1.48 </listitem> 1.49 <listitem><para>Build and install the patched version of 1.50 Mercurial.</para> 1.51 - <programlisting> 1.52 - python setup.py build --force sudo python setup.py install 1.53 - --skip-build 1.54 - </programlisting> 1.55 + <programlisting>python setup.py build --force 1.56 +sudo python setup.py install --skip-build</programlisting> 1.57 </listitem> 1.58 </orderedlist> 1.59 <para>Once you've build a suitably patched version of Mercurial, 1.60 all you need to do to enable the <literal 1.61 role="hg-ext">inotify</literal> extension is add an entry to 1.62 - your <filename role="special"> /.hgrc</filename>.</para> 1.63 + your <filename role="special">~/.hgrc</filename>.</para> 1.64 <programlisting>[extensions] inotify =</programlisting> 1.65 <para>When the <literal role="hg-ext">inotify</literal> extension 1.66 is enabled, Mercurial will automatically and transparently start 1.67 @@ -280,9 +273,10 @@ 1.68 <para>The <literal role="hg-ext">extdiff</literal> extension is 1.69 bundled with Mercurial, so it's easy to set up. In the <literal 1.70 role="rc-extensions">extensions</literal> section of your 1.71 - <filename role="special"> /.hgrc</filename>, simply add a 1.72 + <filename role="special">~/.hgrc</filename>, simply add a 1.73 one-line entry to enable the extension.</para> 1.74 - <programlisting>[extensions] extdiff =</programlisting> 1.75 + <programlisting>[extensions] 1.76 +extdiff =</programlisting> 1.77 <para>This introduces a command named <command 1.78 role="hg-ext-extdiff">extdiff</command>, which by default uses 1.79 your system's <command>diff</command> command to generate a 1.80 @@ -372,15 +366,16 @@ 1.81 <emphasis>new</emphasis> commands that will invoke your diff 1.82 viewer with exactly the right options.</para> 1.83 1.84 - <para>All you need to do is edit your <filename role="special"> 1.85 - /.hgrc</filename>, and add a section named <literal 1.86 - role="rc-extdiff">extdiff</literal>. Inside this section, 1.87 - you can define multiple commands. Here's how to add a 1.88 - <literal>kdiff3</literal> command. Once you've defined this, 1.89 - you can type <quote><literal>hg kdiff3</literal></quote> and 1.90 - the <literal role="hg-ext">extdiff</literal> extension will 1.91 - run <command>kdiff3</command> for you.</para> 1.92 - <programlisting>[extdiff] cmd.kdiff3 =</programlisting> 1.93 + <para>All you need to do is edit your <filename 1.94 + role="special">~/.hgrc</filename>, and add a section named 1.95 + <literal role="rc-extdiff">extdiff</literal>. Inside this 1.96 + section, you can define multiple commands. Here's how to add 1.97 + a <literal>kdiff3</literal> command. Once you've defined 1.98 + this, you can type <quote><literal>hg kdiff3</literal></quote> 1.99 + and the <literal role="hg-ext">extdiff</literal> extension 1.100 + will run <command>kdiff3</command> for you.</para> 1.101 + <programlisting>[extdiff] 1.102 +cmd.kdiff3 =</programlisting> 1.103 <para>If you leave the right hand side of the definition empty, 1.104 as above, the <literal role="hg-ext">extdiff</literal> 1.105 extension uses the name of the command you defined as the name 1.106 @@ -388,7 +383,8 @@ 1.107 be the same. Here, we define a command named 1.108 <quote><literal>hg wibble</literal></quote>, which runs 1.109 <command>kdiff3</command>.</para> 1.110 - <programlisting>[extdiff] cmd.wibble = kdiff3</programlisting> 1.111 + <programlisting>[extdiff] 1.112 + cmd.wibble = kdiff3</programlisting> 1.113 1.114 <para>You can also specify the default options that you want to 1.115 invoke your diff viewing program with. The prefix to use is 1.116 @@ -397,8 +393,9 @@ 1.117 defines a <quote><literal>hg vimdiff</literal></quote> command 1.118 that runs the <command>vim</command> editor's 1.119 <literal>DirDiff</literal> extension.</para> 1.120 - <programlisting>[extdiff] cmd.vimdiff = vim opts.vimdiff = -f 1.121 - '+next' '+execute "DirDiff" argv(0) argv(1)'</programlisting> 1.122 + <programlisting>[extdiff] 1.123 + cmd.vimdiff = vim 1.124 +opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'</programlisting> 1.125 1.126 </sect2> 1.127 </sect1> 1.128 @@ -433,7 +430,8 @@ 1.129 role="hg-ext">patchbomb</literal> extension takes just one or 1.130 two lines in your <filename role="special"> 1.131 /.hgrc</filename>.</para> 1.132 - <programlisting>[extensions] patchbomb =</programlisting> 1.133 + <programlisting>[extensions] 1.134 +patchbomb =</programlisting> 1.135 <para>Once you've enabled the extension, you will have a new 1.136 command available, named <command 1.137 role="hg-ext-patchbomb">email</command>.</para>