Mercurial > hgbook
comparison en/ch13-mq-collab.xml @ 666:8fcd44708f41
Uncomment all the mangled interaction examples.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 09 Mar 2009 23:22:09 -0700 |
parents | b90b024729f1 |
children | 13513d2a128d |
comparison
equal
deleted
inserted
replaced
665:27043f385f3f | 666:8fcd44708f41 |
---|---|
106 <para>Perhaps the best way to maintain sanity with so many targets | 106 <para>Perhaps the best way to maintain sanity with so many targets |
107 is to be able to choose specific patches to apply for a given | 107 is to be able to choose specific patches to apply for a given |
108 situation. MQ provides a feature called <quote>guards</quote> | 108 situation. MQ provides a feature called <quote>guards</quote> |
109 (which originates with quilt's <literal>guards</literal> | 109 (which originates with quilt's <literal>guards</literal> |
110 command) that does just this. To start off, let's create a | 110 command) that does just this. To start off, let's create a |
111 simple repository for experimenting in. <!-- | 111 simple repository for experimenting in.</para> |
112 &interaction.mq.guards.init; --> This gives us a tiny repository | 112 |
113 that contains two patches that don't have any dependencies on | 113 &interaction.mq.guards.init; |
114 each other, because they touch different files.</para> | 114 |
115 <para>This gives us a tiny repository that contains two patches | |
116 that don't have any dependencies on each other, because they | |
117 touch different files.</para> | |
115 | 118 |
116 <para>The idea behind conditional application is that you can | 119 <para>The idea behind conditional application is that you can |
117 <quote>tag</quote> a patch with a <emphasis>guard</emphasis>, | 120 <quote>tag</quote> a patch with a <emphasis>guard</emphasis>, |
118 which is simply a text string of your choosing, then tell MQ to | 121 which is simply a text string of your choosing, then tell MQ to |
119 select specific guards to use when applying patches. MQ will | 122 select specific guards to use when applying patches. MQ will |
131 <title>Controlling the guards on a patch</title> | 134 <title>Controlling the guards on a patch</title> |
132 | 135 |
133 <para>The <command role="hg-ext-mq">qguard</command> command lets | 136 <para>The <command role="hg-ext-mq">qguard</command> command lets |
134 you determine which guards should apply to a patch, or display | 137 you determine which guards should apply to a patch, or display |
135 the guards that are already in effect. Without any arguments, it | 138 the guards that are already in effect. Without any arguments, it |
136 displays the guards on the current topmost patch. <!-- | 139 displays the guards on the current topmost patch.</para> |
137 &interaction.mq.guards.qguard; --> To set a positive guard on a | 140 |
138 patch, prefix the name of the guard with a | 141 &interaction.mq.guards.qguard; |
139 <quote><literal>+</literal></quote>. <!-- | 142 |
140 &interaction.mq.guards.qguard.pos; --> To set a negative guard | 143 <para>To set a positive guard on a patch, prefix the name of the |
144 guard with a <quote><literal>+</literal></quote>.</para> | |
145 | |
146 &interaction.mq.guards.qguard.pos; | |
147 | |
148 <para>To set a negative guard | |
141 on a patch, prefix the name of the guard with a | 149 on a patch, prefix the name of the guard with a |
142 <quote><literal>-</literal></quote>. <!-- | 150 <quote><literal>-</literal></quote>.</para> |
143 &interaction.mq.guards.qguard.neg; --></para> | 151 |
152 &interaction.mq.guards.qguard.neg; | |
144 | 153 |
145 <note> | 154 <note> |
146 <para> The <command role="hg-ext-mq">qguard</command> command | 155 <para> The <command role="hg-ext-mq">qguard</command> command |
147 <emphasis>sets</emphasis> the guards on a patch; it doesn't | 156 <emphasis>sets</emphasis> the guards on a patch; it doesn't |
148 <emphasis>modify</emphasis> them. What this means is that if | 157 <emphasis>modify</emphasis> them. What this means is that if |
156 role="special">series</filename> file; the form in which they | 165 role="special">series</filename> file; the form in which they |
157 are stored is easy both to understand and to edit by hand. (In | 166 are stored is easy both to understand and to edit by hand. (In |
158 other words, you don't have to use the <command | 167 other words, you don't have to use the <command |
159 role="hg-ext-mq">qguard</command> command if you don't want | 168 role="hg-ext-mq">qguard</command> command if you don't want |
160 to; it's okay to simply edit the <filename | 169 to; it's okay to simply edit the <filename |
161 role="special">series</filename> file.) <!-- | 170 role="special">series</filename> file.)</para> |
162 &interaction.mq.guards.series; --></para> | 171 |
172 &interaction.mq.guards.series; | |
163 | 173 |
164 </sect1> | 174 </sect1> |
165 <sect1> | 175 <sect1> |
166 <title>Selecting the guards to use</title> | 176 <title>Selecting the guards to use</title> |
167 | 177 |
173 patches that are already applied.</para> | 183 patches that are already applied.</para> |
174 | 184 |
175 <para>With no arguments, the <command | 185 <para>With no arguments, the <command |
176 role="hg-ext-mq">qselect</command> command lists the guards | 186 role="hg-ext-mq">qselect</command> command lists the guards |
177 currently in effect, one per line of output. Each argument is | 187 currently in effect, one per line of output. Each argument is |
178 treated as the name of a guard to apply. <!-- | 188 treated as the name of a guard to apply.</para> |
179 &interaction.mq.guards.qselect.foo; --> In case you're | 189 |
180 interested, the currently selected guards are stored in the | 190 &interaction.mq.guards.qselect.foo; |
181 <filename role="special">guards</filename> file. <!-- | 191 |
182 &interaction.mq.guards.qselect.cat; --> We can see the effect | 192 <para>In case you're interested, the currently selected guards are |
183 the selected guards have when we run <command | 193 stored in the <filename role="special">guards</filename> file.</para> |
184 role="hg-ext-mq">qpush</command>. <!-- | 194 |
185 &interaction.mq.guards.qselect.qpush; --></para> | 195 &interaction.mq.guards.qselect.cat; |
196 | |
197 <para>We can see the effect the selected guards have when we run | |
198 <command role="hg-ext-mq">qpush</command>.</para> | |
199 | |
200 &interaction.mq.guards.qselect.qpush; | |
186 | 201 |
187 <para>A guard cannot start with a | 202 <para>A guard cannot start with a |
188 <quote><literal>+</literal></quote> or | 203 <quote><literal>+</literal></quote> or |
189 <quote><literal>-</literal></quote> character. The name of a | 204 <quote><literal>-</literal></quote> character. The name of a |
190 guard must not contain white space, but most other characters | 205 guard must not contain white space, but most other characters |
191 are acceptable. If you try to use a guard with an invalid name, | 206 are acceptable. If you try to use a guard with an invalid name, |
192 MQ will complain: <!-- &interaction.mq.guards.qselect.error; --> | 207 MQ will complain:</para> |
193 Changing the selected guards changes the patches that are | 208 |
194 applied. <!-- &interaction.mq.guards.qselect.quux; --> You can | 209 &interaction.mq.guards.qselect.error; |
195 see in the example below that negative guards take precedence | 210 |
196 over positive guards. <!-- | 211 <para>Changing the selected guards changes the patches that are |
197 &interaction.mq.guards.qselect.foobar; --></para> | 212 applied.</para> |
213 | |
214 &interaction.mq.guards.qselect.quux; | |
215 | |
216 <para>You can see in the example below that negative guards take | |
217 precedence over positive guards.</para> | |
218 | |
219 &interaction.mq.guards.qselect.foobar; | |
198 | 220 |
199 </sect1> | 221 </sect1> |
200 <sect1> | 222 <sect1> |
201 <title>MQ's rules for applying patches</title> | 223 <title>MQ's rules for applying patches</title> |
202 | 224 |