comparison en/ch12-mq.xml @ 681:5bfa0df6aaed

Automated merge with ssh://ssh.serpentine.com/hg/share/mercurial/book
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 18 Mar 2009 00:08:22 -0700
parents 8366882f67f2
children d0160b0b1a9e
comparison
equal deleted inserted replaced
678:1879ec732a28 681:5bfa0df6aaed
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
867 <listitem><para>Update to the new tip revision, using <command 868 <listitem><para>Update to the new tip revision, using <command
868 role="hg-cmd">hg update <option 869 role="hg-cmd">hg update <option
869 role="hg-opt-update">-C</option></command> to override 870 role="hg-opt-update">-C</option></command> to override
870 the patches you have pushed.</para> 871 the patches you have pushed.</para>
871 </listitem> 872 </listitem>
872 <listitem><para>Merge all patches using 873 <listitem><para>Merge all patches using <command>hg qpush -m
873 \hgcmdargs{qpush}{<option role="hg-ext-mq-cmd-qpush-opt">hg 874 -a</command>. The <option
874 -m</option> <option role="hg-ext-mq-cmd-qpush-opt">hg 875 role="hg-ext-mq-cmd-qpush-opt">-m</option> option to
875 -a</option>}. The <option
876 role="hg-ext-mq-cmd-qpush-opt">hg -m</option> option to
877 <command role="hg-ext-mq">qpush</command> tells MQ to 876 <command role="hg-ext-mq">qpush</command> tells MQ to
878 perform a three-way merge if the patch fails to 877 perform a three-way merge if the patch fails to
879 apply.</para> 878 apply.</para>
880 </listitem></orderedlist> 879 </listitem></orderedlist>
881 880
928 <para>MQ also makes it easy to work with patches when you are 927 <para>MQ also makes it easy to work with patches when you are
929 using normal Mercurial commands. Every command that accepts a 928 using normal Mercurial commands. Every command that accepts a
930 changeset ID will also accept the name of an applied patch. MQ 929 changeset ID will also accept the name of an applied patch. MQ
931 augments the tags normally in the repository with an eponymous 930 augments the tags normally in the repository with an eponymous
932 one for each applied patch. In addition, the special tags 931 one for each applied patch. In addition, the special tags
933 \index{tags!special tag 932 <literal role="tag">qbase</literal> and
934 names!<literal>qbase</literal>}<literal>qbase</literal> and 933 <literal role="tag">qtip</literal> identify
935 \index{tags!special tag
936 names!<literal>qtip</literal>}<literal>qtip</literal> identify
937 the <quote>bottom-most</quote> and topmost applied patches, 934 the <quote>bottom-most</quote> and topmost applied patches,
938 respectively.</para> 935 respectively.</para>
939 936
940 <para>These additions to Mercurial's normal tagging capabilities 937 <para>These additions to Mercurial's normal tagging capabilities
941 make dealing with patches even more of a breeze.</para> 938 make dealing with patches even more of a breeze.</para>
942 <itemizedlist> 939 <itemizedlist>
943 <listitem><para>Want to patchbomb a mailing list with your 940 <listitem><para>Want to patchbomb a mailing list with your
944 latest series of changes?</para> 941 latest series of changes?</para>
945 <programlisting>hg email qbase:qtip 942 <programlisting>hg email qbase:qtip</programlisting>
946 </programlisting>
947 <para> (Don't know what <quote>patchbombing</quote> is? See 943 <para> (Don't know what <quote>patchbombing</quote> is? See
948 section <xref linkend="sec:hgext:patchbomb"/>.)</para> 944 section <xref linkend="sec:hgext:patchbomb"/>.)</para>
949 </listitem> 945 </listitem>
950 <listitem><para>Need to see all of the patches since 946 <listitem><para>Need to see all of the patches since
951 <literal>foo.patch</literal> that have touched files in a 947 <literal>foo.patch</literal> that have touched files in a
952 subdirectory of your tree?</para> 948 subdirectory of your tree?</para>
953 <programlisting> 949 <programlisting>hg log -r foo.patch:qtip subdir</programlisting>
954 hg log -r foo.patch:qtip <emphasis>subdir</emphasis>
955 </programlisting>
956 </listitem> 950 </listitem>
957 </itemizedlist> 951 </itemizedlist>
958 952
959 <para>Because MQ makes the names of patches available to the rest 953 <para>Because MQ makes the names of patches available to the rest
960 of Mercurial through its normal internal tag machinery, you 954 of Mercurial through its normal internal tag machinery, you
1078 systems. For example, on Linux systems using the 1072 systems. For example, on Linux systems using the
1079 <command>bash</command> shell, you can include the following 1073 <command>bash</command> shell, you can include the following
1080 snippet in your <filename 1074 snippet in your <filename
1081 role="home">~/.bashrc</filename>.</para> 1075 role="home">~/.bashrc</filename>.</para>
1082 1076
1083 <programlisting>alias mq=`hg -R $(hg 1077 <programlisting>alias mq=`hg -R $(hg root)/.hg/patches'</programlisting>
1084 root)/.hg/patches'</programlisting>
1085 1078
1086 <para>You can then issue commands of the form <command>mq 1079 <para>You can then issue commands of the form <command>mq
1087 pull</command> from the main repository.</para> 1080 pull</command> from the main repository.</para>
1088 1081
1089 </sect2> 1082 </sect2>