Mercurial > hgbook
comparison en/ch11-mq.xml @ 691:4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 26 Mar 2009 21:22:03 -0700 |
parents | c838b3975bc6 |
children | 0b45854f0b7b |
comparison
equal
deleted
inserted
replaced
690:b788b405e141 | 691:4ce9d0754af3 |
---|---|
34 distribute so that they will build properly in their | 34 distribute so that they will build properly in their |
35 environments.</para> | 35 environments.</para> |
36 | 36 |
37 <para id="x_3b0">When you have few changes to maintain, it is easy to manage | 37 <para id="x_3b0">When you have few changes to maintain, it is easy to manage |
38 a single patch using the standard <command>diff</command> and | 38 a single patch using the standard <command>diff</command> and |
39 <command>patch</command> programs (see section <xref | 39 <command>patch</command> programs (see <xref |
40 linkend="sec:mq:patch"/> for a discussion of these | 40 linkend="sec:mq:patch"/> for a discussion of these |
41 tools). Once the number of changes grows, it starts to make | 41 tools). Once the number of changes grows, it starts to make |
42 sense to maintain patches as discrete <quote>chunks of | 42 sense to maintain patches as discrete <quote>chunks of |
43 work,</quote> so that for example a single patch will contain | 43 work,</quote> so that for example a single patch will contain |
44 only one bug fix (the patch might modify several files, but it's | 44 only one bug fix (the patch might modify several files, but it's |
239 <quote><literal>+</literal></quote> means <quote>insert this | 239 <quote><literal>+</literal></quote> means <quote>insert this |
240 line.</quote> For example, a line that is modified is | 240 line.</quote> For example, a line that is modified is |
241 represented by one deletion and one insertion.</para> | 241 represented by one deletion and one insertion.</para> |
242 | 242 |
243 <para id="x_3c9">We will return to some of the more subtle aspects of patches | 243 <para id="x_3c9">We will return to some of the more subtle aspects of patches |
244 later (in section <xref linkend="sec:mq:adv-patch"/>), but you | 244 later (in <xref linkend="sec:mq:adv-patch"/>), but you |
245 should have | 245 should have |
246 enough information now to use MQ.</para> | 246 enough information now to use MQ.</para> |
247 | 247 |
248 </sect1> | 248 </sect1> |
249 <sect1 id="sec:mq:start"> | 249 <sect1 id="sec:mq:start"> |
398 the application of a patch using the <command | 398 the application of a patch using the <command |
399 role="hg-ext-mq">qpop</command> command. MQ still | 399 role="hg-ext-mq">qpop</command> command. MQ still |
400 <emphasis>knows about</emphasis>, or manages, a popped patch, | 400 <emphasis>knows about</emphasis>, or manages, a popped patch, |
401 but the patch no longer has a corresponding changeset in the | 401 but the patch no longer has a corresponding changeset in the |
402 repository, and the working directory does not contain the | 402 repository, and the working directory does not contain the |
403 changes made by the patch. Figure <xref | 403 changes made by the patch. <xref |
404 linkend="fig:mq:stack"/> illustrates | 404 linkend="fig:mq:stack"/> illustrates |
405 the difference between applied and tracked patches.</para> | 405 the difference between applied and tracked patches.</para> |
406 | 406 |
407 <informalfigure id="fig:mq:stack"> | 407 <figure id="fig:mq:stack"> |
408 <mediaobject><imageobject><imagedata | 408 <title>Applied and unapplied patches in the MQ patch |
409 fileref="mq-stack"/></imageobject><textobject><phrase>XXX | 409 stack</title> |
410 add text</phrase></textobject><caption><para id="x_3dd">Applied and | 410 <mediaobject> |
411 unapplied patches in the MQ patch | 411 <imageobject><imagedata fileref="mq-stack"/></imageobject> |
412 stack</para></caption></mediaobject> | 412 <textobject><phrase>XXX add text</phrase></textobject> |
413 </informalfigure> | 413 </mediaobject> |
414 </figure> | |
414 | 415 |
415 <para id="x_3de">You can reapply an unapplied, or popped, patch using the | 416 <para id="x_3de">You can reapply an unapplied, or popped, patch using the |
416 <command role="hg-ext-mq">qpush</command> command. This | 417 <command role="hg-ext-mq">qpush</command> command. This |
417 creates a new changeset to correspond to the patch, and the | 418 creates a new changeset to correspond to the patch, and the |
418 patch's changes once again become present in the working | 419 patch's changes once again become present in the working |
439 <command role="hg-ext-mq">qpush</command> causes it to push | 440 <command role="hg-ext-mq">qpush</command> causes it to push |
440 all unapplied patches, while the <option | 441 all unapplied patches, while the <option |
441 role="hg-ext-mq-cmd-qpop-opt">-a</option> option to <command | 442 role="hg-ext-mq-cmd-qpop-opt">-a</option> option to <command |
442 role="hg-ext-mq">qpop</command> causes it to pop all applied | 443 role="hg-ext-mq">qpop</command> causes it to pop all applied |
443 patches. (For some more ways to push and pop many patches, | 444 patches. (For some more ways to push and pop many patches, |
444 see section <xref linkend="sec:mq:perf"/> | 445 see <xref linkend="sec:mq:perf"/> below.)</para> |
445 below.)</para> | |
446 | 446 |
447 &interaction.mq.tutorial.qpush-a; | 447 &interaction.mq.tutorial.qpush-a; |
448 | 448 |
449 </sect2> | 449 </sect2> |
450 <sect2> | 450 <sect2> |
698 you push more patches or do any further work.</para> | 698 you push more patches or do any further work.</para> |
699 | 699 |
700 <para id="x_3fa">If your patch <emphasis>used to</emphasis> apply cleanly, | 700 <para id="x_3fa">If your patch <emphasis>used to</emphasis> apply cleanly, |
701 and no longer does because you've changed the underlying code | 701 and no longer does because you've changed the underlying code |
702 that your patches are based on, Mercurial Queues can help; see | 702 that your patches are based on, Mercurial Queues can help; see |
703 section <xref | 703 <xref linkend="sec:mq:merge"/> for details.</para> |
704 linkend="sec:mq:merge"/> for details.</para> | |
705 | 704 |
706 <para id="x_3fb">Unfortunately, there aren't any great techniques for | 705 <para id="x_3fb">Unfortunately, there aren't any great techniques for |
707 dealing with rejected hunks. Most often, you'll need to view | 706 dealing with rejected hunks. Most often, you'll need to view |
708 the <filename role="special">.rej</filename> file and edit the | 707 the <filename role="special">.rej</filename> file and edit the |
709 target file, applying the rejected hunks by hand.</para> | 708 target file, applying the rejected hunks by hand.</para> |
939 <itemizedlist> | 938 <itemizedlist> |
940 <listitem><para id="x_41b">Want to patchbomb a mailing list with your | 939 <listitem><para id="x_41b">Want to patchbomb a mailing list with your |
941 latest series of changes?</para> | 940 latest series of changes?</para> |
942 <programlisting>hg email qbase:qtip</programlisting> | 941 <programlisting>hg email qbase:qtip</programlisting> |
943 <para id="x_41c"> (Don't know what <quote>patchbombing</quote> is? See | 942 <para id="x_41c"> (Don't know what <quote>patchbombing</quote> is? See |
944 section <xref linkend="sec:hgext:patchbomb"/>.)</para> | 943 <xref linkend="sec:hgext:patchbomb"/>.)</para> |
945 </listitem> | 944 </listitem> |
946 <listitem><para id="x_41d">Need to see all of the patches since | 945 <listitem><para id="x_41d">Need to see all of the patches since |
947 <literal>foo.patch</literal> that have touched files in a | 946 <literal>foo.patch</literal> that have touched files in a |
948 subdirectory of your tree?</para> | 947 subdirectory of your tree?</para> |
949 <programlisting>hg log -r foo.patch:qtip subdir</programlisting> | 948 <programlisting>hg log -r foo.patch:qtip subdir</programlisting> |
978 <listitem><para id="x_421">Normally, when you <command | 977 <listitem><para id="x_421">Normally, when you <command |
979 role="hg-ext-mq">qpop</command> a patch and <command | 978 role="hg-ext-mq">qpop</command> a patch and <command |
980 role="hg-ext-mq">qpush</command> it again, the changeset | 979 role="hg-ext-mq">qpush</command> it again, the changeset |
981 that represents the patch after the pop/push will have a | 980 that represents the patch after the pop/push will have a |
982 <emphasis>different identity</emphasis> than the changeset | 981 <emphasis>different identity</emphasis> than the changeset |
983 that represented the hash beforehand. See section <xref | 982 that represented the hash beforehand. See <xref |
984 linkend="sec:mqref:cmd:qpush"/> for | 983 linkend="sec:mqref:cmd:qpush"/> for |
985 information as to why this is.</para> | 984 information as to why this is.</para> |
986 </listitem> | 985 </listitem> |
987 <listitem><para id="x_422">It's not a good idea to <command | 986 <listitem><para id="x_422">It's not a good idea to <command |
988 role="hg-cmd">hg merge</command> changes from another | 987 role="hg-cmd">hg merge</command> changes from another |
1130 most is <command>filterdiff</command>, which extracts subsets | 1129 most is <command>filterdiff</command>, which extracts subsets |
1131 from a patch file. For example, given a patch that modifies | 1130 from a patch file. For example, given a patch that modifies |
1132 hundreds of files across dozens of directories, a single | 1131 hundreds of files across dozens of directories, a single |
1133 invocation of <command>filterdiff</command> can generate a | 1132 invocation of <command>filterdiff</command> can generate a |
1134 smaller patch that only touches files whose names match a | 1133 smaller patch that only touches files whose names match a |
1135 particular glob pattern. See section <xref | 1134 particular glob pattern. See <xref |
1136 linkend="mq-collab:tips:interdiff"/> for another | 1135 linkend="mq-collab:tips:interdiff"/> for another |
1137 example.</para> | 1136 example.</para> |
1138 | 1137 |
1139 </sect1> | 1138 </sect1> |
1140 <sect1> | 1139 <sect1> |
1168 one I intended, and it's often tricky to migrate changes into | 1167 one I intended, and it's often tricky to migrate changes into |
1169 the right patch after making them in the wrong one.</para> | 1168 the right patch after making them in the wrong one.</para> |
1170 | 1169 |
1171 <para id="x_436">For this reason, it is very much worth investing a little | 1170 <para id="x_436">For this reason, it is very much worth investing a little |
1172 time to learn how to use some of the third-party tools I | 1171 time to learn how to use some of the third-party tools I |
1173 described in section <xref linkend="sec:mq:tools"/>, | 1172 described in <xref linkend="sec:mq:tools"/>, |
1174 particularly | 1173 particularly |
1175 <command>diffstat</command> and <command>filterdiff</command>. | 1174 <command>diffstat</command> and <command>filterdiff</command>. |
1176 The former will give you a quick idea of what changes your patch | 1175 The former will give you a quick idea of what changes your patch |
1177 is making, while the latter makes it easy to splice hunks | 1176 is making, while the latter makes it easy to splice hunks |
1178 selectively out of one patch and into another.</para> | 1177 selectively out of one patch and into another.</para> |
1290 role="cmd-opt-filterdiff">--hunks</option> options, to | 1289 role="cmd-opt-filterdiff">--hunks</option> options, to |
1291 select exactly the file and hunk you want to extract.</para> | 1290 select exactly the file and hunk you want to extract.</para> |
1292 | 1291 |
1293 <para id="x_447">Once you have this hunk, you can concatenate it onto the | 1292 <para id="x_447">Once you have this hunk, you can concatenate it onto the |
1294 end of your destination patch and continue with the remainder | 1293 end of your destination patch and continue with the remainder |
1295 of section <xref linkend="sec:mq:combine"/>.</para> | 1294 of <xref linkend="sec:mq:combine"/>.</para> |
1296 | 1295 |
1297 </sect2> | 1296 </sect2> |
1298 </sect1> | 1297 </sect1> |
1299 <sect1> | 1298 <sect1> |
1300 <title>Differences between quilt and MQ</title> | 1299 <title>Differences between quilt and MQ</title> |