Mercurial > hgbook
changeset 353:89a903605c74
more mq-collab.tex
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 19 Aug 2008 19:32:28 +0900 |
parents | 4cbbb68d7840 |
children | 4991d84ba9d6 |
files | ja/mq-collab.tex |
diffstat | 1 files changed, 138 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/ja/mq-collab.tex Tue Aug 19 16:06:16 2008 +0900 +++ b/ja/mq-collab.tex Tue Aug 19 19:32:28 2008 +0900 @@ -196,103 +196,176 @@ %\section{Controlling the guards on a patch} \section{$B%Q%C%AFb$N%,!<%I$rA`:n$9$k(B} -The \hgxcmd{mq}{qguard} command lets you determine which guards should -apply to a patch, or display the guards that are already in effect. -Without any arguments, it displays the guards on the current topmost -patch. +%The \hgxcmd{mq}{qguard} command lets you determine which guards should +%apply to a patch, or display the guards that are already in effect. +%Without any arguments, it displays the guards on the current topmost +%patch. +%\interaction{mq.guards.qguard} +%To set a positive guard on a patch, prefix the name of the guard with +%a ``\texttt{+}''. +%\interaction{mq.guards.qguard.pos} +%To set a negative guard on a patch, prefix the name of the guard with +%a ``\texttt{-}''. +%\interaction{mq.guards.qguard.neg} + +\hgxcmd{mq}{qguard}$B%3%^%s%I$G$I$N%,!<%I$,%Q%C%A$KE,MQ$5$l$k$+$r;XDj$7$?(B +$B$j!$$9$G$KM-8z$K$J$C$F$$$k%,!<%I$rI=<($5$;$k$3$H$,$G$-$k!%0z?t$J$7$G$3$N(B +$B%3%^%s%I$r;H$&$H!$8=:_$N:G>e0L$N%Q%C%A$N%,!<%I$rI=<($9$k!%(B \interaction{mq.guards.qguard} -To set a positive guard on a patch, prefix the name of the guard with -a ``\texttt{+}''. +$B%Q%C%A$K%]%8%F%#%V%,!<%I$r@_Dj$9$k$K$O!$%,!<%IL>$NA0$K(B``\texttt{+}''$B$r$D(B +$B$1$k!%(B \interaction{mq.guards.qguard.pos} -To set a negative guard on a patch, prefix the name of the guard with -a ``\texttt{-}''. +$B%Q%C%A$K%M%,%F%#%V%,!<%I$r@_Dj$9$k$K$O!$%,!<%IL>$NA0$K(B``\texttt{-}''$B$r$D(B +$B$1$k!%(B \interaction{mq.guards.qguard.neg} +%\begin{note} +% The \hgxcmd{mq}{qguard} command \emph{sets} the guards on a patch; it +% doesn't \emph{modify} them. What this means is that if you run +% \hgcmdargs{qguard}{+a +b} on a patch, then \hgcmdargs{qguard}{+c} on +% the same patch, the \emph{only} guard that will be set on it +% afterwards is \texttt{+c}. +%\end{note} + \begin{note} - The \hgxcmd{mq}{qguard} command \emph{sets} the guards on a patch; it - doesn't \emph{modify} them. What this means is that if you run - \hgcmdargs{qguard}{+a +b} on a patch, then \hgcmdargs{qguard}{+c} on - the same patch, the \emph{only} guard that will be set on it - afterwards is \texttt{+c}. + \hgxcmd{mq}{qguard} $B%3%^%s%I$O%Q%C%A$K%,!<%I$r(B\emph{$B@_Dj$9$k(B}$B$,%Q%C%A<+(B + $BBN$r(B\emph{$BJQ99$7$J$$(B}$BE@$KCm0U$5$l$?$$!%%Q%C%A$KBP$7$F(B + \hgcmdargs{qguard}{+a +b}$B$r<B9T$7!$F1$8%Q%C%A$K(B\hgcmdargs{qguard}{+c}$B$r(B + $B<B9T$9$k$H!$$3$N%Q%C%A$X$N%,!<%I$O(B\texttt{+c}$B$N$_$K$J$k!%(B \end{note} -Mercurial stores guards in the \sfilename{series} file; the form in -which they are stored is easy both to understand and to edit by hand. -(In other words, you don't have to use the \hgxcmd{mq}{qguard} command if -you don't want to; it's okay to simply edit the \sfilename{series} -file.) +%Mercurial stores guards in the \sfilename{series} file; the form in +%which they are stored is easy both to understand and to edit by hand. +%(In other words, you don't have to use the \hgxcmd{mq}{qguard} command if +%you don't want to; it's okay to simply edit the \sfilename{series} +%file.) +%\interaction{mq.guards.series} + +Mercurial$B$O%,!<%I$r(B\sfilename{series}$B%U%!%$%k$KJ]B8$9$k!%=q<0$OM}2r$7$d(B +$B$9$/!$<j$GJQ99$9$k$N$b4JC1$G$"$k!%!J$D$^$j!$(B\hgxcmd{mq}{qguard}$B%3%^%s%I(B +$B$r;H$$$?$/$J$1$l$P!$D>@\(B\sfilename{series}$B$rJT=8$7$F:Q$^$9$3$H$b$G$-$k!%!K(B \interaction{mq.guards.series} %\section{Selecting the guards to use} \section{$B;HMQ$9$k%,!<%I$rA*$V(B} -The \hgxcmd{mq}{qselect} command determines which guards are active at a -given time. The effect of this is to determine which patches MQ will -apply the next time you run \hgxcmd{mq}{qpush}. It has no other effect; in -particular, it doesn't do anything to patches that are already -applied. +%The \hgxcmd{mq}{qselect} command determines which guards are active at a +%given time. The effect of this is to determine which patches MQ will +%apply the next time you run \hgxcmd{mq}{qpush}. It has no other effect; in +%particular, it doesn't do anything to patches that are already +%applied. + +\hgxcmd{mq}{qselect}$B%3%^%s%I$r<B9T$9$k$3$H$G!$$=$N;~E@$G%"%/%F%#%V$J%,!<(B +$B%I$r;XDj$9$k$3$H$,$G$-$k!%$3$N%3%^%s%I$K$h$C$F!$<!$K(B\hgxcmd{mq}{qpush}$B$,(B +$B<B9T$5$l$?$H$-$K$I$N%Q%C%A$,(BMQ$B$K$h$C$FE,MQ$5$l$k$+$,;XDj$5$l$k!%$=$l0J30(B +$B$N8z2L$O$J$/!$FC$K$9$G$KE,MQ$5$l$F$$$k%Q%C%A$KBP$7$F$O2?$b9T$o$J$$!%(B -With no arguments, the \hgxcmd{mq}{qselect} command lists the guards -currently in effect, one per line of output. Each argument is treated -as the name of a guard to apply. +%With no arguments, the \hgxcmd{mq}{qselect} command lists the guards +%currently in effect, one per line of output. Each argument is treated +%as the name of a guard to apply. +%\interaction{mq.guards.qselect.foo} +%In case you're interested, the currently selected guards are stored in +%the \sfilename{guards} file. +%\interaction{mq.guards.qselect.cat} +%We can see the effect the selected guards have when we run +%\hgxcmd{mq}{qpush}. +%\interaction{mq.guards.qselect.qpush} + +$B0z?t$J$7$G(B\hgxcmd{mq}{qselect}$B%3%^%s%I$r<B9T$9$k$H!$8=:_M-8z$J%,!<%I$N%j(B +$B%9%H$r(B1$B9T$K(B1$B$D$:$DI=<($9$k!%3F!9$N0z?t$OE,MQ$5$l$k%,!<%I$NL>A0$H$7$F2r<a(B +$B$5$l$k!%(B \interaction{mq.guards.qselect.foo} -In case you're interested, the currently selected guards are stored in -the \sfilename{guards} file. +$B8=:_A*Br$5$l$F$$$k%,!<%I$K6=L#$,$"$k>l9g!$$3$l$O(B\sfilename{guards}$B%U%!%$(B +$B%k$KJ]B8$5$l$F$$$k!%(B \interaction{mq.guards.qselect.cat} -We can see the effect the selected guards have when we run -\hgxcmd{mq}{qpush}. +$BA*Br$5$l$?%,!<%I$N8z2L$O(B\hgxcmd{mq}{qpush}$B$N<B9T;~$K8+$k$3$H$,$G$-$k!%(B \interaction{mq.guards.qselect.qpush} -A guard cannot start with a ``\texttt{+}'' or ``\texttt{-}'' -character. The name of a guard must not contain white space, but most -othter characters are acceptable. If you try to use a guard with an -invalid name, MQ will complain: -\interaction{mq.guards.qselect.error} -Changing the selected guards changes the patches that are applied. -\interaction{mq.guards.qselect.quux} -You can see in the example below that negative guards take precedence -over positive guards. +%A guard cannot start with a ``\texttt{+}'' or ``\texttt{-}'' +%character. The name of a guard must not contain white space, but most +%othter characters are acceptable. If you try to use a guard with an +%invalid name, MQ will complain: +%\interaction{mq.guards.qselect.error} +%Changing the selected guards changes the patches that are applied. +%\interaction{mq.guards.qselect.quux} +%You can see in the example below that negative guards take precedence +%over positive guards. +%\interaction{mq.guards.qselect.foobar} + +$B%,!<%I$r(B``\texttt{+}''$B$d(B``\texttt{-}''$B$NJ8;z$G;O$a$k$3$H$O$G$-$J$$!%%,!<(B +$B%IL>$O6uGr$r4^$s$G$O$J$i$J$$$,!$$=$NB>$NKX$s$I$NJ8;z$r4^$`$3$H$,$G$-$k!%(B +$B$b$7;HMQIT2D$NJ8;z$r4^$`>l9g$O!"(BMQ$B$,7Y9p$rI=<($9$k!#(B +\interaction{mq.guards.qselect.error} +$BA*Br$5$l$?%,!<%I$rJQ99$9$k$3$H$O!"E,MQ$5$l$k%Q%C%A$NJQ99$r0UL#$9$k!#(B +\interaction{mq.guards.qselect.quux} +$B2<$NNc$G%M%,%F%#%V%,!<%I$,%]%8%F%#%V%,!<%I$h$j$bM%@hEY$r;}$D$3$H$,$o$+$k!#(B \interaction{mq.guards.qselect.foobar} %\section{MQ's rules for applying patches} \section{MQ$B$N%Q%C%AE,MQ%k!<%k(B} -The rules that MQ uses when deciding whether to apply a patch -are as follows. +%The rules that MQ uses when deciding whether to apply a patch +%are as follows. +MQ$B$,E,MQ$9$k%Q%C%A$r7hDj$9$k5,B'$O2<5-$N$H$*$j$G$"$k!#(B +%\begin{itemize} +%\item A patch that has no guards is always applied. +%\item If the patch has any negative guard that matches any currently +% selected guard, the patch is skipped. +%\item If the patch has any positive guard that matches any currently +% selected guard, the patch is applied. +%\item If the patch has positive or negative guards, but none matches +% any currently selected guard, the patch is skipped. +%\end{itemize} \begin{itemize} -\item A patch that has no guards is always applied. -\item If the patch has any negative guard that matches any currently - selected guard, the patch is skipped. -\item If the patch has any positive guard that matches any currently - selected guard, the patch is applied. -\item If the patch has positive or negative guards, but none matches - any currently selected guard, the patch is skipped. +\item $B%,!<%I$N$J$$%Q%C%A$O>o$KE,MQ$9$k(B +\item $B%Q%C%A$K8=:_A*Br$5$l$F$$$k%,!<%I$K%^%C%A$9$k%M%,%F%#%V%,!<%I$,$"$l(B + $B$P!"$=$N%Q%C%A$r%9%-%C%W$9$k(B +\item $B%Q%C%A$K8=:_A*Br$5$l$F$$$k%,!<%I$K%^%C%A$9$k%]%8%F%#%V%,!<%I$,$"$l(B + $B$P!"$=$N%Q%C%A$rE,MQ$9$k(B +\item $B%Q%C%A$,%]%8%F%#%V!&%M%,%F%#%V$$$:$l$+$N%,!<%I$r;}$D$,!"8=:_A*Br$5(B + $B$l$F$$$k%,!<%I$H%^%C%A$9$k$b$N$,$J$1$l$P!"$=$N%Q%C%A$r%9%-%C%W$9$k(B \end{itemize} %\section{Trimming the work environment} \section{$B:n6H4D6-$r=L>.$9$k(B} -In working on the device driver I mentioned earlier, I don't apply the -patches to a normal Linux kernel tree. Instead, I use a repository -that contains only a snapshot of the source files and headers that are -relevant to Infiniband development. This repository is~1\% the size -of a kernel repository, so it's easier to work with. +%In working on the device driver I mentioned earlier, I don't apply the +%patches to a normal Linux kernel tree. Instead, I use a repository +%that contains only a snapshot of the source files and headers that are +%relevant to Infiniband development. This repository is~1\% the size +%of a kernel repository, so it's easier to work with. + +$B0JA08@5Z$7$?%G%P%$%9%I%i%$%P$G$N:n6H$G$O!"(BLinux$B%+!<%M%k%D%j!<$K%Q%C%A$rE,(B +$BMQ$7$F$$$J$+$C$?!%$=$NBe$o$j!$(BInfiniband$B%I%i%$%P$N3+H/$K4XO"$7$?%=!<%9$H(B +$B%X%C%@%U%!%$%k$@$1$r;}$D%j%]%8%H%j$rMQ$$$?!%$3$N%j%]%8%H%j$O%+!<%M%k%j%](B +$B%8%H%j$N(B~1\%$B$[$I$N%5%$%:$G!$:n6H$,MF0W$G$"$k!%(B -I then choose a ``base'' version on top of which the patches are -applied. This is a snapshot of the Linux kernel tree as of a revision -of my choosing. When I take the snapshot, I record the changeset ID -from the kernel repository in the commit message. Since the snapshot -preserves the ``shape'' and content of the relevant parts of the -kernel tree, I can apply my patches on top of either my tiny -repository or a normal kernel tree. +%I then choose a ``base'' version on top of which the patches are +%applied. This is a snapshot of the Linux kernel tree as of a revision +%of my choosing. When I take the snapshot, I record the changeset ID +%from the kernel repository in the commit message. Since the snapshot +%preserves the ``shape'' and content of the relevant parts of the +%kernel tree, I can apply my patches on top of either my tiny +%repository or a normal kernel tree. -Normally, the base tree atop which the patches apply should be a -snapshot of a very recent upstream tree. This best facilitates the -development of patches that can easily be submitted upstream with few -or no modifications. +$B$3$3$G%Q%C%A$rE,MQ$9$k$?$a$N(B``base''$B%P!<%8%g%s$rA*$V!%$3$l$OG$0U$KA*$s$@(B +Linux$B%+!<%M%k%D%j!<$N%9%J%C%W%7%g%C%H$G!$:n@.$9$k:]!$%+!<%M%k%j%]%8%H%j$N(B +$B%A%'%s%8%;%C%H(BID$B$r%3%_%C%H%a%C%;!<%8$K5-O?$7$F$*$/!%%9%J%C%W%7%g%C%H$O%+!<(B +$B%M%k%D%j!<$N4XO"$9$kItJ,$N867?$rJ]$C$F$$$k$?$a!$<+J,$N%Q%C%A$r3+H/MQ$N8D(B +$BJL$N%j%]%8%H%j$KE,MQ$9$k$N$HF1MM$KDL>o$N%+!<%M%k%D%j!<$KE,MQ$9$k$3$H$,$G(B +$B$-$k!%(B + +%Normally, the base tree atop which the patches apply should be a +%snapshot of a very recent upstream tree. This best facilitates the +%development of patches that can easily be submitted upstream with few +%or no modifications. + +$BDL>o!$%Q%C%A$,E,MQ$5$l$k%Y!<%9%D%j!<$O>eN.$N%D%j!<$N$4$/:G6a$N%9%J%C%W(B +$B%7%g%C%H$G$"$k$Y$-$@!%$3$&$9$k$3$H$G!$3+H/$7$?%Q%C%A$r=$@5$9$k$3$H$J$/!$(B +$B$"$k$$$O$4$/6O$+$J=$@5$N$_$G!$>eN.$XDs=P$9$k$3$H$,2DG=$K$J$k!%(B %\section{Dividing up the \sfilename{series} file} -\section{\sfilename{series}$B%U%!%$%k$X%@%$%V$9$k(B} +\section{\sfilename{series}$B%U%!%$%k$rJ,3d$9$k(B} I categorise the patches in the \sfilename{series} file into a number of logical groups. Each section of like patches begins with a block