comparison en/ch12-mq.xml @ 746:d0160b0b1a9e

Merge with http://hg.serpentine.com/mercurial/book
author Dongsheng Song <dongsheng.song@gmail.com>
date Wed, 18 Mar 2009 20:32:37 +0800
parents a13813534ccd 8366882f67f2
children
comparison
equal deleted inserted replaced
745:c2cefd9f9893 746:d0160b0b1a9e
254 download anything; MQ ships with the standard Mercurial 254 download anything; MQ ships with the standard Mercurial
255 distribution.) To enable MQ, edit your <filename 255 distribution.) To enable MQ, edit your <filename
256 role="home">~/.hgrc</filename> file, and add the lines 256 role="home">~/.hgrc</filename> file, and add the lines
257 below.</para> 257 below.</para>
258 258
259 <programlisting>[extensions] hgext.mq =</programlisting> 259 <programlisting>[extensions]
260 hgext.mq =</programlisting>
260 261
261 <para>Once the extension is enabled, it will make a number of new 262 <para>Once the extension is enabled, it will make a number of new
262 commands available. To verify that the extension is working, 263 commands available. To verify that the extension is working,
263 you can use <command role="hg-cmd">hg help</command> to see if 264 you can use <command role="hg-cmd">hg help</command> to see if
264 the <command role="hg-ext-mq">qinit</command> command is now 265 the <command role="hg-ext-mq">qinit</command> command is now
868 <listitem><para>Update to the new tip revision, using <command 869 <listitem><para>Update to the new tip revision, using <command
869 role="hg-cmd">hg update <option 870 role="hg-cmd">hg update <option
870 role="hg-opt-update">-C</option></command> to override 871 role="hg-opt-update">-C</option></command> to override
871 the patches you have pushed.</para> 872 the patches you have pushed.</para>
872 </listitem> 873 </listitem>
873 <listitem><para>Merge all patches using 874 <listitem><para>Merge all patches using <command>hg qpush -m
874 \hgcmdargs{qpush}{<option role="hg-ext-mq-cmd-qpush-opt">hg 875 -a</command>. The <option
875 -m</option> <option role="hg-ext-mq-cmd-qpush-opt">hg 876 role="hg-ext-mq-cmd-qpush-opt">-m</option> option to
876 -a</option>}. The <option
877 role="hg-ext-mq-cmd-qpush-opt">hg -m</option> option to
878 <command role="hg-ext-mq">qpush</command> tells MQ to 877 <command role="hg-ext-mq">qpush</command> tells MQ to
879 perform a three-way merge if the patch fails to 878 perform a three-way merge if the patch fails to
880 apply.</para> 879 apply.</para>
881 </listitem></orderedlist> 880 </listitem></orderedlist>
882 881
929 <para>MQ also makes it easy to work with patches when you are 928 <para>MQ also makes it easy to work with patches when you are
930 using normal Mercurial commands. Every command that accepts a 929 using normal Mercurial commands. Every command that accepts a
931 changeset ID will also accept the name of an applied patch. MQ 930 changeset ID will also accept the name of an applied patch. MQ
932 augments the tags normally in the repository with an eponymous 931 augments the tags normally in the repository with an eponymous
933 one for each applied patch. In addition, the special tags 932 one for each applied patch. In addition, the special tags
934 \index{tags!special tag 933 <literal role="tag">qbase</literal> and
935 names!<literal>qbase</literal>}<literal>qbase</literal> and 934 <literal role="tag">qtip</literal> identify
936 \index{tags!special tag
937 names!<literal>qtip</literal>}<literal>qtip</literal> identify
938 the <quote>bottom-most</quote> and topmost applied patches, 935 the <quote>bottom-most</quote> and topmost applied patches,
939 respectively.</para> 936 respectively.</para>
940 937
941 <para>These additions to Mercurial's normal tagging capabilities 938 <para>These additions to Mercurial's normal tagging capabilities
942 make dealing with patches even more of a breeze.</para> 939 make dealing with patches even more of a breeze.</para>
943 <itemizedlist> 940 <itemizedlist>
944 <listitem><para>Want to patchbomb a mailing list with your 941 <listitem><para>Want to patchbomb a mailing list with your
945 latest series of changes?</para> 942 latest series of changes?</para>
946 <programlisting>hg email qbase:qtip 943 <programlisting>hg email qbase:qtip</programlisting>
947 </programlisting>
948 <para> (Don't know what <quote>patchbombing</quote> is? See 944 <para> (Don't know what <quote>patchbombing</quote> is? See
949 section <xref linkend="sec.hgext.patchbomb"/>.)</para> 945 section <xref linkend="sec.hgext.patchbomb"/>.)</para>
950 </listitem> 946 </listitem>
951 <listitem><para>Need to see all of the patches since 947 <listitem><para>Need to see all of the patches since
952 <literal>foo.patch</literal> that have touched files in a 948 <literal>foo.patch</literal> that have touched files in a
953 subdirectory of your tree?</para> 949 subdirectory of your tree?</para>
954 <programlisting> 950 <programlisting>hg log -r foo.patch:qtip subdir</programlisting>
955 hg log -r foo.patch:qtip <emphasis>subdir</emphasis>
956 </programlisting>
957 </listitem> 951 </listitem>
958 </itemizedlist> 952 </itemizedlist>
959 953
960 <para>Because MQ makes the names of patches available to the rest 954 <para>Because MQ makes the names of patches available to the rest
961 of Mercurial through its normal internal tag machinery, you 955 of Mercurial through its normal internal tag machinery, you
1079 systems. For example, on Linux systems using the 1073 systems. For example, on Linux systems using the
1080 <command>bash</command> shell, you can include the following 1074 <command>bash</command> shell, you can include the following
1081 snippet in your <filename 1075 snippet in your <filename
1082 role="home">~/.bashrc</filename>.</para> 1076 role="home">~/.bashrc</filename>.</para>
1083 1077
1084 <programlisting>alias mq=`hg -R $(hg 1078 <programlisting>alias mq=`hg -R $(hg root)/.hg/patches'</programlisting>
1085 root)/.hg/patches'</programlisting>
1086 1079
1087 <para>You can then issue commands of the form <command>mq 1080 <para>You can then issue commands of the form <command>mq
1088 pull</command> from the main repository.</para> 1081 pull</command> from the main repository.</para>
1089 1082
1090 </sect2> 1083 </sect2>