Mercurial > hgbook
changeset 347:b3e736000aef
completed mq.tex.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 01 Aug 2008 16:09:39 +0900 |
parents | 0b99bf82b573 |
children | 32d33b238b7e 84ae26ab0ac3 |
files | ja/mq.tex |
diffstat | 1 files changed, 87 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/ja/mq.tex Fri Aug 01 12:38:25 2008 +0900 +++ b/ja/mq.tex Fri Aug 01 16:09:39 2008 +0900 @@ -1301,7 +1301,7 @@ %MQ commands that work with patches let you refer to a patch either by %using its name or by a number. By name is obvious enough; pass the %name \filename{foo.patch} to \hgxcmd{mq}{qpush}, for example, and it will -%push patches until \filename{foo.patch} is applied. +%push patches until \filename{foo.patch} is applied. $B%Q%C%A$r07$&(BMQ$B%3%^%s%I$O!$%Q%C%A$r%Q%C%AL>$^$?$OHV9f$G;2>H$9$k!%L>A0$N>l(B $B9g$ONc$($P%U%!%$%kL>(B\filename{foo.patch}$B$r(B\hgxcmd{mq}{qpush}$B$KEO$9!%$3$N(B @@ -1583,69 +1583,109 @@ %histogram of the modifications made to each file in a patch. It %provides a good way to ``get a sense of'' a patch---which files it %affects, and how much change it introduces to each file and as a - %whole. (I find that it's a good idea to use \command{diffstat}'s %\cmdopt{diffstat}{-p} option as a matter of course, as otherwise it %will try to do clever things with prefixes of file names that %inevitably confuse at least me.) \command{diffstat}$B%3%^%s%I(B~\cite{web:diffstat}$B$O%Q%C%AFb$N$=$l$>$l$N%U%!(B -$B%$%k$X$NJQ99$N%R%9%H%0%i%`$r@8@.$9$k!%(B - -$B$3$l$O!$%Q%C%A$,1F6A$r5Z$\$9%U%!%$%k$rGD0.$7$?$j!$A4BN$G$=$l$>$l$N%U%!%$(B -$B%k$X$I$NDxEYJQ99$r2C$($k$N$+GD0.$9$k$N$KLrN)$D!%(B -(\command{diffstat}$B%3%^%s%I$N(B\cmdopt{diffstat}{-p}$B%*%W%7%g%s$,(B - - -) +$B%$%k$X$NJQ99$N%R%9%H%0%i%`$r@8@.$9$k!%$3$l$O!$%Q%C%A$,1F6A$r5Z$\$9%U%!%$(B +$B%k$rGD0.$7$?$j!$A4BN$G$=$l$>$l$N%U%!%$%k$X$I$NDxEYJQ99$r2C$($k$N$+GD0.$9(B +$B$k$N$KLrN)$D!%(B $B!J(B\command{diffstat}$B%3%^%s%I$N(B\cmdopt{diffstat}{-p}$B%*%W%7%g(B +$B%s$rMQ$$$k$N$OL^O@NI$$9M$($G$"$k!%$5$b$J$1$l$P%3%^%s%I$O%U%!%$%kL>$N(B +prefix$B$KBP$7$F(B``$B8-$$(B''$B$3$H$r$7$G$+$9$?$a!$>/$J$/$H$bI.<T$O:.Mp$rHr$1$i$l(B +$B$J$+$C$?!%!K(B \begin{figure}[ht] \interaction{mq.tools.tools} - \caption{The \command{diffstat}, \command{filterdiff}, and \command{lsdiff} commands} +% \caption{The \command{diffstat}, \command{filterdiff}, and + % \command{lsdiff} commands} + \caption{\command{diffstat}, \command{filterdiff}, $B$*$h$S(B + \command{lsdiff} $B%3%^%s%I(B} \label{ex:mq:tools} \end{figure} -The \package{patchutils} package~\cite{web:patchutils} is invaluable. -It provides a set of small utilities that follow the ``Unix -philosophy;'' each does one useful thing with a patch. The -\package{patchutils} command I use most is \command{filterdiff}, which -extracts subsets from a patch file. For example, given a patch that -modifies hundreds of files across dozens of directories, a single -invocation of \command{filterdiff} can generate a smaller patch that -only touches files whose names match a particular glob pattern. See -section~\ref{mq-collab:tips:interdiff} for another example. +%The \package{patchutils} package~\cite{web:patchutils} is invaluable. +%It provides a set of small utilities that follow the ``Unix +%philosophy;'' each does one useful thing with a patch. The +%\package{patchutils} command I use most is \command{filterdiff}, which +%extracts subsets from a patch file. For example, given a patch that + +%modifies hundreds of files across dozens of directories, a single +%invocation of \command{filterdiff} can generate a smaller patch that +%only touches files whose names match a particular glob pattern. See +%section~\ref{mq-collab:tips:interdiff} for another example. + +\package{patchutils}$B%Q%C%1!<%8(B~\cite{web:patchutils}$B$OHs>o$KM-MQ$G$"$k!%(B +$B$3$N%Q%C%1!<%8$O(B``UNIX$BE/3X(B''$B$K=>$C$?>.$5$J%f!<%F%#%j%F%#$+$i$J$j!$3F!9$N(B +$B%f!<%F%#%j%F%#$O%Q%C%A$KBP$7$FM-MQ$JC15!G=$rDs6!$9(B +$B$k!%(B\package{patchutils}$B$NCf$GI.<T$,:G$bNI$/;H$&%3%^%s%I$O(B +\command{filterdiff}$B$G!$$3$l$O%Q%C%A%U%!%$%k$+$i%Q%C%A$NItJ,=89g$r<h$j=P(B +$B$9!%Nc$($P!$(B10$B0J>e$N%G%#%l%/%H%j$K8Y$C$F?tI4$N%U%!%$%k$KJQ99$r9T$&$h$&$J(B +$B%Q%C%A$,$"$k$H$7$F!$$?$@0l2s$N(B\command{filterdiff}$B$N<B9T$GFCDj$N%Q%?!<%s(B +$B$K%^%C%A$7$?%U%!%$%k$N$_$rJQ99$9$k$h$j>.$5$J%Q%C%A$r@8@.$9$k$3$H$,$G$-(B +$B$k!%$=$N$[$+$NNc$O(B\ref{mq-collab:tips:interdiff}$B$r8+$h!%(B + %\section{Good ways to work with patches} \section{$B9%$^$7$$%Q%C%A<h$j07$$J}K!(B} -Whether you are working on a patch series to submit to a free software -or open source project, or a series that you intend to treat as a -sequence of regular changesets when you're done, you can use some -simple techniques to keep your work well organised. +%Whether you are working on a patch series to submit to a free software +%or open source project, or a series that you intend to treat as a +%sequence of regular changesets when you're done, you can use some +%simple techniques to keep your work well organised. + +$B%U%j!<%=%U%H$d%*!<%W%s%=!<%9%W%m%8%'%/%H$KDs=P$9$k$?$a$N%Q%C%A%7%j!<%:$K(B +$BBP$7$F:n6H$7$F$$$k$H$-$d!$:n6H$,=*$C$?$H$-$KDL>o$N%A%'%s%8%;%C%H$H$7$F<h(B +$B$j9~$^$l$kM=Dj$N%Q%C%A%7%j!<%:$KBP$7$F$@9T$7$F$$$k$H$-$O!$:n6H$r$&$^$/7O(B +$BE}$E$1$k$?$a$NC1=c$J%F%/%K%C%/$,$"$k!%(B -Give your patches descriptive names. A good name for a patch might be -\filename{rework-device-alloc.patch}, because it will immediately give -you a hint what the purpose of the patch is. Long names shouldn't be -a problem; you won't be typing the names often, but you \emph{will} be -running commands like \hgxcmd{mq}{qapplied} and \hgxcmd{mq}{qtop} over and over. -Good naming becomes especially important when you have a number of -patches to work with, or if you are juggling a number of different -tasks and your patches only get a fraction of your attention. +%Give your patches descriptive names. A good name for a patch might be +%\filename{rework-device-alloc.patch}, because it will immediately give +%you a hint what the purpose of the patch is. Long names shouldn't be a +%problem; you won't be typing the names often, but you \emph{will} be +%running commands like \hgxcmd{mq}{qapplied} and \hgxcmd{mq}{qtop} over +%and over. Good naming becomes especially important when you have a +%number of patches to work with, or if you are juggling a number of +%different tasks and your patches only get a fraction of your attention. + +$B%Q%C%A$K5-=RE*$JL>A0$rM?$($k!%%Q%C%A$KM?$($k$Y$-NI$$L>A0$O(B +\filename{rework-device-alloc.patch}$B$N$h$&$J$b$N$G$"$k!%M}M3$OB(:B$K%Q%C(B +$B%A$NL\E*$N%R%s%H$rM?$($k$+$i$G$"$k!%D9$$L>A0$OLdBj$K$O$J$i$J$$!%$J$<$J$i(B +$BL>A0$r%?%$%W$9$k$3$H$OLGB?$K$J$/!$Be$o$j$K(B\hgxcmd{mq}{qapplied}$B$d(B +\hgxcmd{mq}{qtop}$B$N$h$&$J%3%^%s%I$r7+$jJV$7<B9T$9$k$3$H$K$J$k$+$i$G$"$k!%(B +$BB??t$N%Q%C%A$KBP$7$F:n6H$r$7$F$$$k$H$-$O!$NI$$L>A0$rIU$1$k$3$H$OFC$K=EMW(B +$B$H$J$k!%$=$&$7$J$$$H!$$b$7$"$J$?$,$?$/$5$s$NJL$N%?%9%/$rJz$($F$$$k$J$i(B +$B$P!$%Q%C%A$N6hJL$O$D$+$J$/$J$C$F$7$^$&!%(B -Be aware of what patch you're working on. Use the \hgxcmd{mq}{qtop} -command and skim over the text of your patches frequently---for -example, using \hgcmdargs{tip}{\hgopt{tip}{-p}})---to be sure of where -you stand. I have several times worked on and \hgxcmd{mq}{qrefresh}ed a -patch other than the one I intended, and it's often tricky to migrate -changes into the right patch after making them in the wrong one. +%Be aware of what patch you're working on. Use the \hgxcmd{mq}{qtop} +%command and skim over the text of your patches frequently---for +%example, using \hgcmdargs{tip}{\hgopt{tip}{-p}}---to be sure of where +%you stand. I have several times worked on and \hgxcmd{mq}{qrefresh}ed a +%patch other than the one I intended, and it's often tricky to migrate +%changes into the right patch after making them in the wrong one. + +$B$I$N%Q%C%A$K$D$$$F:n6H$7$F$$$k$N$+GD0.$7$F$*$/$Y$-$G$"(B +$B$k!%(B\hgxcmd{mq}{qtop}$B%3%^%s%I$r;H$$!$%Q%C%A$rIQHK$K%A%'%C%/$9$Y$-$G$"$k!%(B +$B$^$?!$Nc$($P(B\hgcmdargs{tip}{\hgopt{tip}{-p}}$B$r;H$C$F!$$$$^$I$3$K$$$k$N$+(B +$B$rD4$Y$k$3$H$bI,MW$G$"$k!%0U?^$7$F$$$k%Q%C%A0J30$N%Q%C%A$K$D$$$F(B +\hgxcmd{mq}{qrefresh}$B$r9T$$!$4V0c$C$?%Q%C%A$K2C$($i$l$?JQ99$r@5$7$$%Q%C%A(B +$B$K0\F0$5$;$?!%(B -For this reason, it is very much worth investing a little time to -learn how to use some of the third-party tools I described in -section~\ref{sec:mq:tools}, particularly \command{diffstat} and -\command{filterdiff}. The former will give you a quick idea of what -changes your patch is making, while the latter makes it easy to splice -hunks selectively out of one patch and into another. +%For this reason, it is very much worth investing a little time to +%learn how to use some of the third-party tools I described in +%section~\ref{sec:mq:tools}, particularly \command{diffstat} and +%\command{filterdiff}. The former will give you a quick idea of what +%changes your patch is making, while the latter makes it easy to splice +%hunks selectively out of one patch and into another. + +$B$3$N$?$a!$%;%/%7%g%s(B~\ref{sec:mq:tools}$B$G=R$Y$?%5!<%I%Q!<%F%#@=$N$$$/$D$+(B +$B$N%D!<%k!$FC$K(B\command{diffstat}$B$H(B\command{filterdiff}$B$N;H$$J}$r3X$V$N$O(B +$B$H$F$b0UL#$,$"$k!%A0<T$O!$$"$J$?$N%Q%C%A$,$I$N$h$&$JJQ99$r2C$($k$N$+B(:B(B +$B$KCN$k$3$H$,$G$-!$0lJ}$G8e<T$O%Q%C%A$NCf$N(Bhunk$B$rJL$N%Q%C%A$XA^F~$9$k$N$r(B +$BMF0W$K$9$k!%(B + %\section{MQ cookbook} \section{MQ$B%/%C%/%V%C%/(B} @@ -1673,7 +1713,7 @@ %Continue by creating a patch stack and making your changes. %\interaction{mq.tarball.qinit} -$B%Q%C%A%9%?%C%/$r:n$jJQ99$r9T$&!%(B +$B?7$?$J%Q%C%A%9%?%C%/$r:n$j!$JQ99$r9T$&!%(B \interaction{mq.tarball.qinit} %Let's say a few weeks or months pass, and your package author releases @@ -1816,7 +1856,7 @@ \hgcmd{add}$B$H(B\hgcmd{remove}$B$,BP1~$9$k!%$^$?!$(Bquilt$B$N(B\texttt{edit}$B%3%^%s%I(B $B$KBP1~$9$k(BMQ$B%3%^%s%I$O$J$$!%(B -%%% Local Variables: +%%% Local Variables: %%% mode: yatex %%% TeX-master: "00book" -%%% End: +%%% End: