annotate ja/mq-collab.tex @ 783:b15bea650f30

started tour-basic.tex
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 03 Jun 2009 18:53:39 +0900
parents b96d7f6504e5
children 8a3041e6f3cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
1 %\chapter{Advanced uses of Mercurial Queues}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
2 \chapter{Mercurial Queues$B$N9bEY$J;H$$J}(B}
224
34943a3d50d6 Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents: 107
diff changeset
3 \label{chap:mq-collab}
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
4
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
5 %While it's easy to pick up straightforward uses of Mercurial Queues,
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
6 %use of a little discipline and some of MQ's less frequently used
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
7 %capabilities makes it possible to work in complicated development
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
8 %environments.
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
9
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
10 Mercurial Queues$B$NC1=c$J;H$$J}$r<h$j>e$2$?0lJ}!$>/!9$NE}@)$H(BMQ$B$N$"$^$jMQ(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
11 $B$$$i$l$J$$5!G=$rMQ$$$k$3$H$GJ#;($J3+H/4D6-$G$N:n6H$,2DG=$H$J$k!%(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
12
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
13 %In this chapter, I will use as an example a technique I have used to
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
14 %manage the development of an Infiniband device driver for the Linux
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
15 %kernel. The driver in question is large (at least as drivers go),
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
16 %with 25,000 lines of code spread across 35 source files. It is
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
17 %maintained by a small team of developers.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
18
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
19 $B$3$N>O$G$O!$(BLinux$B%+!<%M%kMQ(BInfiniband$B%G%P%$%9%I%i%$%P$N3+H/$r4IM}$9$k$N$K(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
20 $BMQ$$$?%F%/%K%C%/$rNc$H$7$FMQ$$$k!%$3$N%I%i%$%P$O!J%I%i%$%P$H$7$F$O!KBg5,(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
21 $BLO$G!$(B35$B$N%=!<%9%U%!%$%k$K$o$?$k(B25000$B9T$+$i$J$k!%$3$N%=!<%9$O>.5,LO$J3+H/(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
22 $B<T$N%A!<%`$K$h$C$F$$;~4IM}$5$l$F$$$k!%(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
23
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
24 %While much of the material in this chapter is specific to Linux, the
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
25 %same principles apply to any code base for which you're not the
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
26 %primary owner, and upon which you need to do a lot of development.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
27
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
28 $B$3$N>O$G$NAG:`$O(BLinux$B$KFC2=$7$F$$$k$,!$F1$886B'$O$$$+$J$k%3!<%I%Y!<%9$KBP(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
29 $B$7$F$bE,MQ2DG=$G!$<+J,<+?H$G=jM-$7$F$$$J$$$,!$B?$/$N3+H/$r9T$&I,MW$N$"$k(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
30 $B%3!<%I$J$I$K$bE,MQ$G$-$k!%(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
31
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
32
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
33 %\section{The problem of many targets}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
34 \section{$B%?!<%2%C%H$,J#?t$"$k$H$$$&LdBj(B}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
35
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
36 %The Linux kernel changes rapidly, and has never been internally
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
37 %stable; developers frequently make drastic changes between releases.
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
38 %This means that a version of the driver that works well with a
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
39 %particular released version of the kernel will not even \emph{compile}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
40 %correctly against, typically, any other version.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
41
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
42 Linux$B%+!<%M%k$O5^B.$KJQ2=$7!$$=$NFbIt$O7h$7$F0lDj$G$O$J$$!%3+H/<T$?$A$OIQ(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
43 $BHK$K%j%j!<%94V$G7`E*$JJQ99$r9T$&!%$3$N$?$a!$FCDj$N%j%j!<%9%P!<%8%g%s$GNI(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
44 $B$/F0$$$?%I%i%$%P$,!$Nc$($PJL$N%P!<%8%g%s$G$O@5$7$/%3%s%Q%$%k$9$k$3$H$9$i(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
45 $B$G$-$J$/$J$k$H$$$&$3$H$r0UL#$9$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
46
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
47 %To maintain a driver, we have to keep a number of distinct versions of
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
48 %Linux in mind.
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
49
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
50 $B%I%i%$%P$r0];}$9$k$?$a$K!$3+H/<T$O$$$/$D$b$NJL$N%P!<%8%g%s$N(BLinux$B$rA[Dj(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
51 $B$7$J$1$l$P$J$i$J$$!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
52 \begin{itemize}
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
53 %\item One target is the main Linux kernel development tree.
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
54
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
55 % Maintenance of the code is in this case partly shared by other
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
56 % developers in the kernel community, who make ``drive-by''
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
57 % modifications to the driver as they develop and refine kernel
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
58 % subsystems.
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
59 \item $B0l$D$N%?!<%2%C%H$O(BLinux$B%+!<%M%k$N3+H/%D%j!<$G$"$k!%$3$N>l9g!$%3!<%I(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
60 $B$N0];}4IM}$O%+!<%M%k%3%_%e%K%F%#$NB>$N3+H/<T!J$3$l$O%+!<%M%k$N%5%V(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
61 $B%7%9%F%`$r2~NI$9$k$?$a$K%I%i%$%P$r(B``$BDI$$N)$F$k(B''$BJQ99$r9T$&3+H/<T$G(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
62 $B$"$k!K$HItJ,E*$K6&M-$5$l$F$$$k!%(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
63 %\item We also maintain a number of ``backports'' to older versions of
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
64 % the Linux kernel, to support the needs of customers who are running
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
65 % older Linux distributions that do not incorporate our drivers. (To
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
66 % \emph{backport} a piece of code is to modify it to work in an older
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
67 % version of its target environment than the version it was developed
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
68 % for.)
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
69 \item $B3+H/<T$O2f!9$N%I%i%$%P$,AH$_9~$^$l$F$$$J$$8E$$(BLinux$B%G%#%9%H%j%S%e!<(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
70 $B%7%g%s$r;H$C$F$$$k8\5R$r%5%]!<%H$9$k$?$a$K!$8E$$%P!<%8%g%s$N(BLinux$B%+!<(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
71 $B%M%k$X$N(B``$B%P%C%/%]!<%H(B''$B$rJz$($F$$$k!%%3!<%I$N0lIt$r(B\emph{$B%P%C%/%]!<(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
72 $B%H(B}$B$9$k$3$H$O!$%I%i%$%P$,3+H/$5$l$?%P!<%8%g%s$h$j$b8E$$%P!<%8%g%s(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
73 $B$N4D6-$GF0$/$h$&$K$9$k$3$H$r0UL#$9$k!%(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
74 %\item Finally, we make software releases on a schedule that is
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
75 % necessarily not aligned with those used by Linux distributors and
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
76 % kernel developers, so that we can deliver new features to customers
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
77 % without forcing them to upgrade their entire kernels or
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
78 % distributions.
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
79 \item $B:G=*E*$K(BLinux$B%G%#%9%H%j%S%e!<%?$d%+!<%M%k3+H/<T$rBT$?$;$k$3$H$J$/%9(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
80 $B%1%8%e!<%kDL$j$K%=%U%H%&%'%"$r%j%j!<%9$9$k$3$H$,I,MW$G$"$j!$$3$l$K$h$C$F(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
81 $B8\5R$K%+!<%M%k$d%G%#%9%H%j%S%e!<%7%g%sA4BN$r%"%C%W%0%l!<%I$5$;$k$3$H$J$/(B
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
82 $B?75!G=$r8\5R$KFO$1$i$l$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
83 \end{itemize}
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
84
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
85 %\subsection{Tempting approaches that don't work well}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
86 \subsection{$B$d$C$F$7$^$$$,$A$J4V0c$C$?J}K!(B}
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
87
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
88 %There are two ``standard'' ways to maintain a piece of software that
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
89 %has to target many different environments.
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
90
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
91 $B$5$^$6$^$J4D6-$r%?!<%2%C%H$K$7$?%=%U%H%&%'%"$r4IM}$9$k(B2$B$D$NI8=`E*$JJ}K!(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
92 $B$,$"$k!%(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
93
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
94 %The first is to maintain a number of branches, each intended for a
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
95 %single target. The trouble with this approach is that you must
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
96 %maintain iron discipline in the flow of changes between repositories.
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
97 %A new feature or bug fix must start life in a ``pristine'' repository,
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
98 %then percolate out to every backport repository. Backport changes are
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
99 %more limited in the branches they should propagate to; a backport
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
100 %change that is applied to a branch where it doesn't belong will
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
101 %probably stop the driver from compiling.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
102
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
103 $BBh(B1$B$NJ}K!$O!$C10l$N%?!<%2%C%H8~$1$NJ#?t$N%V%i%s%A$r0];}$9$k$3$H$G$"$k!%$3(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
104 $B$NJ}K!$NLdBjE@$O!$%j%]%8%H%j4V$G$NJQ99$NN.$l$K$D$$$F873J$J5,N'$r0];}$7$J(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
105 $B$1$l$P$J$i$J$$$3$H$G$"$k!%?75!G=$d%P%0=$@5$O!$$-$l$$$J>uBV$N%j%]%8%H%j$G(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
106 $B3+;O$7!$%P%C%/%]!<%H%j%]%8%H%j$K?;F)$9$kI,MW$,$"$k!%%P%C%/%]!<%HJQ99$OGH(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
107 $B5Z$9$Y$-%V%i%s%AFb$K8BDj$5$l$F$$$J$1$l$P$J$i$J$$!%I,MW$N$J$$%V%i%s%A$X$N(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
108 $B%P%C%/%]!<%H$NGH5Z$O$*$=$i$/%I%i%$%P$r%3%s%Q%$%kITG=$K$7$F$7$^$&$@$m$&!%(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
109
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
110 %The second is to maintain a single source tree filled with conditional
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
111 %statements that turn chunks of code on or off depending on the
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
112 %intended target. Because these ``ifdefs'' are not allowed in the
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
113 %Linux kernel tree, a manual or automatic process must be followed to
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
114 %strip them out and yield a clean tree. A code base maintained in this
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
115 %fashion rapidly becomes a rat's nest of conditional blocks that are
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
116 %difficult to understand and maintain.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
117
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
118 $BBh(B2$B$NJ}K!$O!$%A%c%s%/$d%3!<%I$r!$L\E*$H$9$k%?!<%2%C%HKh$K(Bon/off$B$9$k>r7oJ8(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
119 $B$rDI2C$7$?C10l$N%=!<%9%D%j!<$r0];}$9$kJ}K!$G$"$k!%$3$l$i$N(B``ifdef''$B$O(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
120 linux$B%+!<%M%k%D%j!<$G$O5v$5$l$F$$$J$$$?$a!$<jF0$^$?$O<+F0$G$3$l$i$N%3!<%I(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
121 $B$r=|5n$7!$%/%j!<%s$J%D%j!<$r:n$k%W%m%;%9$,I,MW$K$J$k!%$3$N$h$&$J$d$jJ}$G(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
122 $B4IM}$5$l$?%3!<%I%Y!<%9$O$9$0$K>r7o@a$NAc7"$H2=$7!"M}2r$d4IM}$NK8$2$H$J$k!#(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
123
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
124 %Neither of these approaches is well suited to a situation where you
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
125 %don't ``own'' the canonical copy of a source tree. In the case of a
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
126
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
127 %Linux driver that is distributed with the standard kernel, Linus's
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
128 %tree contains the copy of the code that will be treated by the world
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
129 %as canonical. The upstream version of ``my'' driver can be modified
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
130 %by people I don't know, without me even finding out about it until
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
131 %after the changes show up in Linus's tree.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
132
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
133 $B$"$J$?$,@5<0$J%=!<%9%D%j!<$r=jM-$7$F$$$k$N$G$J$1$l$P!"$3$l$i$N$d$jJ}$N$I(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
134 $B$A$i$b$=$0$o$J$$$@$m$&!#I8=`$N(Blinux$B%+!<%M%k$KF1:-$5$l$F$$$k%I%i%$%P$N>l(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
135 $B9g!$(BLinus$B$N%D%j!<$O@$3&Cf$G@5<0$J%3!<%I$H$7$F07$o$l$k%3%T!<$r4^$s$G$$$k!%(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
136 ``$B;d(B''$B$N%I%i%$%P$N>eN.HG$O!$CN$i$J$$?M$K$h$C$FJQ99$5$lF@$k$7!$<+J,$NJQ99(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
137 $B$,(BLinus$B$N%D%j!<$KF~$C$?$"$H$G$5$($bJQ99$5$lF@$k!%(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
138
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
139 %These approaches have the added weakness of making it difficult to
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
140 %generate well-formed patches to submit upstream.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
141
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
142 $B$3$l$i$N%"%W%m!<%A$O!$$&$^$/=q$+$l$?%Q%C%A$r>eN.$XDs=P$9$k$3$H$r:$Fq$K$7(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
143 $B$F$7$^$&!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
144
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
145 %In principle, Mercurial Queues seems like a good candidate to manage a
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
146 %development scenario such as the above. While this is indeed the
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
147 %case, MQ contains a few added features that make the job more
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
148 %pleasant.
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
149
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
150 Mercurial Queues$B$O>e5-$N$h$&$J3+H/%7%J%j%*$r4IM}$9$k$h$$8uJd$N0l$D$G$"$k(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
151 $B$H$$$($k!%$3$N$h$&$J>l9g$N$?$a$K(BMQ$B$K$O:n6H$r$h$j2wE,$K$9$k$$$/$D$+$N5!G=(B
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
152 $B$,$"$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
153
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
154 %\section{Conditionally applying patches with guards}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
155 \section{$B%,!<%I$r;H$C$?%Q%C%A$N>r7oE*$JE,MQ(B}
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
156
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
157 %Perhaps the best way to maintain sanity with so many targets is to be
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
158 %able to choose specific patches to apply for a given situation. MQ
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
159 %provides a feature called ``guards'' (which originates with quilt's
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
160 %\texttt{guards} command) that does just this. To start off, let's
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
161 %create a simple repository for experimenting in.
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
162 %\interaction{mq.guards.init}
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
163 %This gives us a tiny repository that contains two patches that don't
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
164 %have any dependencies on each other, because they touch different files.
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
165
351
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
166 $BB?$/$N%?!<%2%C%H$rBP>]$H$7$J$,$i@5>o$KJ]$D0lHVNI$$J}J}$O!$>u67$K1~$8$FFC(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
167 $BDj$N%Q%C%A$rA*$Y$k$h$&$K$9$k$3$H$G$"$k!%(BMQ$B$O$3$NL\E*$N$?$a$K(Bquilt$B$N(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
168 \texttt{guards}$B%3%^%s%I$KN`;w$7$?(B``guards''$B$H8F$P$l$k5!G=$rDs6!$7$F$$$k!%(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
169 $B3+;O$KEv$?$C$F!$<B83$N$?$a$KC1=c$J%j%]%8%H%j$r:n@.$9$k!%(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
170 \interaction{mq.guards.init}
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
171 $B>.$5$J%j%]%8%H%j$r:n$j!$JL!9$N%U%!%$%k$rA`:n$9$k8_$$$K0MB8@-$N$J$$(B2$B$D$N%Q%C(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
172 $B%A$rCV$/!%(B
350
5a5419eeab70 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 349
diff changeset
173
351
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
174 %The idea behind conditional application is that you can ``tag'' a
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
175 %patch with a \emph{guard}, which is simply a text string of your
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
176 %choosing, then tell MQ to select specific guards to use when applying
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
177 %patches. MQ will then either apply, or skip over, a guarded patch,
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
178 %depending on the guards that you have selected.
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
179
351
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
180 $B>r7oIU$-$G%Q%C%A%Q%C%A$NE,MQ$r%3%s%H%m!<%k$9$kJ}K!$NGX8e$K$"$k$N(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
181 $B$O!$(B\emph{guard}$B$K$h$C$F%Q%C%A$KIU$1$i$l$?(B``$B%?%0(B''$B$G$"$k!%%?%0$O<+M3$KA*(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
182 $B$s$@C1=c$J%F%-%9%H$G!$(BMQ$B$,%Q%C%A$rE,MQ$9$k$H$-$KMQ$$$kFCDj$N%,!<%I$r;XDj(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
183 $B$9$k!%(BMQ$B$O%,!<%I%Q%C%A$NE,MQ$^$?$O%9%-%C%W$r!$;XDj$5$l$?%,!<%I$K$h$C$F7h(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
184 $BDj$9$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
185
351
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
186 %A patch can have an arbitrary number of guards;
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
187 %each one is \emph{positive} (``apply this patch if this guard is
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
188 %selected'') or \emph{negative} (``skip this patch if this guard is
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
189 %selected''). A patch with no guards is always applied.
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
190
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
191 $B%Q%C%A$OG$0U$N?t$N%,!<%I$r;}$D$3$H$,$G$-$k!%3F!9$N%,!<%I(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
192 $B$O!$(B\emph{positive}$B!J$3$N%,!<%I$,A*Br$5$l$F$$$k$H$-$K$3$N%Q%C%A$rE,MQ!K$^(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
193 $B$?$O(B\emph{negative}$B!J$3$N%,!<%I$,A*Br$5$l$F$$$k$H$-$K$3$N%Q%C%A$r%9%-%C(B
f3fa98815193 a bit more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 350
diff changeset
194 $B%W!K$G$"$k!%%,!<%I$r;}$?$J$$%Q%C%A$O>o$KE,MQ$5$l$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
195
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
196 %\section{Controlling the guards on a patch}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
197 \section{$B%Q%C%AFb$N%,!<%I$rA`:n$9$k(B}
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
198
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
199 %The \hgxcmd{mq}{qguard} command lets you determine which guards should
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
200 %apply to a patch, or display the guards that are already in effect.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
201 %Without any arguments, it displays the guards on the current topmost
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
202 %patch.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
203 %\interaction{mq.guards.qguard}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
204 %To set a positive guard on a patch, prefix the name of the guard with
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
205 %a ``\texttt{+}''.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
206 %\interaction{mq.guards.qguard.pos}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
207 %To set a negative guard on a patch, prefix the name of the guard with
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
208 %a ``\texttt{-}''.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
209 %\interaction{mq.guards.qguard.neg}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
210
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
211 \hgxcmd{mq}{qguard}$B%3%^%s%I$G$I$N%,!<%I$,%Q%C%A$KE,MQ$5$l$k$+$r;XDj$7$?(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
212 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
213 $B%3%^%s%I$r;H$&$H!$8=:_$N:G>e0L$N%Q%C%A$N%,!<%I$rI=<($9$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
214 \interaction{mq.guards.qguard}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
215 $B%Q%C%A$K%]%8%F%#%V%,!<%I$r@_Dj$9$k$K$O!$%,!<%IL>$NA0$K(B``\texttt{+}''$B$r$D(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
216 $B$1$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
217 \interaction{mq.guards.qguard.pos}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
218 $B%Q%C%A$K%M%,%F%#%V%,!<%I$r@_Dj$9$k$K$O!$%,!<%IL>$NA0$K(B``\texttt{-}''$B$r$D(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
219 $B$1$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
220 \interaction{mq.guards.qguard.neg}
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
221
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
222 %\begin{note}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
223 % The \hgxcmd{mq}{qguard} command \emph{sets} the guards on a patch; it
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
224 % doesn't \emph{modify} them. What this means is that if you run
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
225 % \hgcmdargs{qguard}{+a +b} on a patch, then \hgcmdargs{qguard}{+c} on
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
226 % the same patch, the \emph{only} guard that will be set on it
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
227 % afterwards is \texttt{+c}.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
228 %\end{note}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
229
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
230 \begin{note}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
231 \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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
232 $BBN$r(B\emph{$BJQ99$7$J$$(B}$BE@$KCm0U$5$l$?$$!%%Q%C%A$KBP$7$F(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
233 \hgcmdargs{qguard}{+a +b}$B$r<B9T$7!$F1$8%Q%C%A$K(B\hgcmdargs{qguard}{+c}$B$r(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
234 $B<B9T$9$k$H!$$3$N%Q%C%A$X$N%,!<%I$O(B\texttt{+c}$B$N$_$K$J$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
235 \end{note}
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
236
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
237 %Mercurial stores guards in the \sfilename{series} file; the form in
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
238 %which they are stored is easy both to understand and to edit by hand.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
239 %(In other words, you don't have to use the \hgxcmd{mq}{qguard} command if
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
240 %you don't want to; it's okay to simply edit the \sfilename{series}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
241 %file.)
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
242 %\interaction{mq.guards.series}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
243
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
244 Mercurial$B$O%,!<%I$r(B\sfilename{series}$B%U%!%$%k$KJ]B8$9$k!%=q<0$OM}2r$7$d(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
245 $B$9$/!$<j$GJQ99$9$k$N$b4JC1$G$"$k!%!J$D$^$j!$(B\hgxcmd{mq}{qguard}$B%3%^%s%I(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
246 $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
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
247 \interaction{mq.guards.series}
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
248
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
249 %\section{Selecting the guards to use}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
250 \section{$B;HMQ$9$k%,!<%I$rA*$V(B}
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
251
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
252 %The \hgxcmd{mq}{qselect} command determines which guards are active at a
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
253 %given time. The effect of this is to determine which patches MQ will
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
254 %apply the next time you run \hgxcmd{mq}{qpush}. It has no other effect; in
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
255 %particular, it doesn't do anything to patches that are already
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
256 %applied.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
257
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
258 \hgxcmd{mq}{qselect}$B%3%^%s%I$r<B9T$9$k$3$H$G!$$=$N;~E@$G%"%/%F%#%V$J%,!<(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
259 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
260 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
261 $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
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
262
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
263 %With no arguments, the \hgxcmd{mq}{qselect} command lists the guards
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
264 %currently in effect, one per line of output. Each argument is treated
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
265 %as the name of a guard to apply.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
266 %\interaction{mq.guards.qselect.foo}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
267 %In case you're interested, the currently selected guards are stored in
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
268 %the \sfilename{guards} file.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
269 %\interaction{mq.guards.qselect.cat}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
270 %We can see the effect the selected guards have when we run
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
271 %\hgxcmd{mq}{qpush}.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
272 %\interaction{mq.guards.qselect.qpush}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
273
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
274 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
275 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
276 $B$5$l$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
277 \interaction{mq.guards.qselect.foo}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
278 $B8=:_A*Br$5$l$F$$$k%,!<%I$K6=L#$,$"$k>l9g!$$3$l$O(B\sfilename{guards}$B%U%!%$(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
279 $B%k$KJ]B8$5$l$F$$$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
280 \interaction{mq.guards.qselect.cat}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
281 $BA*Br$5$l$?%,!<%I$N8z2L$O(B\hgxcmd{mq}{qpush}$B$N<B9T;~$K8+$k$3$H$,$G$-$k!%(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
282 \interaction{mq.guards.qselect.qpush}
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
283
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
284 %A guard cannot start with a ``\texttt{+}'' or ``\texttt{-}''
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
285 %character. The name of a guard must not contain white space, but most
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
286 %othter characters are acceptable. If you try to use a guard with an
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
287 %invalid name, MQ will complain:
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
288 %\interaction{mq.guards.qselect.error}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
289 %Changing the selected guards changes the patches that are applied.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
290 %\interaction{mq.guards.qselect.quux}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
291 %You can see in the example below that negative guards take precedence
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
292 %over positive guards.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
293 %\interaction{mq.guards.qselect.foobar}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
294
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
295 $B%,!<%I$r(B``\texttt{+}''$B$d(B``\texttt{-}''$B$NJ8;z$G;O$a$k$3$H$O$G$-$J$$!%%,!<(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
296 $B%IL>$O6uGr$r4^$s$G$O$J$i$J$$$,!$$=$NB>$NKX$s$I$NJ8;z$r4^$`$3$H$,$G$-$k!%(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
297 $B$b$7;HMQIT2D$NJ8;z$r4^$`>l9g$O!"(BMQ$B$,7Y9p$rI=<($9$k!#(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
298 \interaction{mq.guards.qselect.error}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
299 $BA*Br$5$l$?%,!<%I$rJQ99$9$k$3$H$O!"E,MQ$5$l$k%Q%C%A$NJQ99$r0UL#$9$k!#(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
300 \interaction{mq.guards.qselect.quux}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
301 $B2<$NNc$G%M%,%F%#%V%,!<%I$,%]%8%F%#%V%,!<%I$h$j$bM%@hEY$r;}$D$3$H$,$o$+$k!#(B
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
302 \interaction{mq.guards.qselect.foobar}
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
303
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
304 %\section{MQ's rules for applying patches}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
305 \section{MQ$B$N%Q%C%AE,MQ%k!<%k(B}
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
306
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
307 %The rules that MQ uses when deciding whether to apply a patch
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
308 %are as follows.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
309 MQ$B$,E,MQ$9$k%Q%C%A$r7hDj$9$k5,B'$O2<5-$N$H$*$j$G$"$k!#(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
310 %\begin{itemize}
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
311 %\item A patch that has no guards is always applied.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
312 %\item If the patch has any negative guard that matches any currently
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
313 % selected guard, the patch is skipped.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
314 %\item If the patch has any positive guard that matches any currently
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
315 % selected guard, the patch is applied.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
316 %\item If the patch has positive or negative guards, but none matches
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
317 % any currently selected guard, the patch is skipped.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
318 %\end{itemize}
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
319 \begin{itemize}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
320 \item $B%,!<%I$N$J$$%Q%C%A$O>o$KE,MQ$9$k(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
321 \item $B%Q%C%A$K8=:_A*Br$5$l$F$$$k%,!<%I$K%^%C%A$9$k%M%,%F%#%V%,!<%I$,$"$l(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
322 $B$P!"$=$N%Q%C%A$r%9%-%C%W$9$k(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
323 \item $B%Q%C%A$K8=:_A*Br$5$l$F$$$k%,!<%I$K%^%C%A$9$k%]%8%F%#%V%,!<%I$,$"$l(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
324 $B$P!"$=$N%Q%C%A$rE,MQ$9$k(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
325 \item $B%Q%C%A$,%]%8%F%#%V!&%M%,%F%#%V$$$:$l$+$N%,!<%I$r;}$D$,!"8=:_A*Br$5(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
326 $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
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
327 \end{itemize}
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
328
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
329 %\section{Trimming the work environment}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
330 \section{$B:n6H4D6-$r=L>.$9$k(B}
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
331
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
332 %In working on the device driver I mentioned earlier, I don't apply the
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
333 %patches to a normal Linux kernel tree. Instead, I use a repository
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
334 %that contains only a snapshot of the source files and headers that are
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
335 %relevant to Infiniband development. This repository is~1\% the size
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
336 %of a kernel repository, so it's easier to work with.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
337
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
338 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
339 $BMQ$7$F$$$J$+$C$?!%$=$NBe$o$j!$(BInfiniband$B%I%i%$%P$N3+H/$K4XO"$7$?%=!<%9$H(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
340 $B%X%C%@%U%!%$%k$@$1$r;}$D%j%]%8%H%j$rMQ$$$?!%$3$N%j%]%8%H%j$O%+!<%M%k%j%](B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
341 $B%8%H%j$N(B~1\%$B$[$I$N%5%$%:$G!$:n6H$,MF0W$G$"$k!%(B
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
342
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
343 %I then choose a ``base'' version on top of which the patches are
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
344 %applied. This is a snapshot of the Linux kernel tree as of a revision
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
345 %of my choosing. When I take the snapshot, I record the changeset ID
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
346 %from the kernel repository in the commit message. Since the snapshot
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
347 %preserves the ``shape'' and content of the relevant parts of the
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
348 %kernel tree, I can apply my patches on top of either my tiny
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
349 %repository or a normal kernel tree.
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
350
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
351 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
352 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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
353 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
354 $B%M%k%D%j!<$N4XO"$9$kItJ,$N867?$rJ]$C$F$$$k$?$a!$<+J,$N%Q%C%A$r3+H/MQ$N8D(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
355 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
356 $B$-$k!%(B
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
357
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
358 %Normally, the base tree atop which the patches apply should be a
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
359 %snapshot of a very recent upstream tree. This best facilitates the
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
360 %development of patches that can easily be submitted upstream with few
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
361 %or no modifications.
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
362
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
363 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
364 $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
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
365 $B$"$k$$$O$4$/6O$+$J=$@5$N$_$G!$>eN.$XDs=P$9$k$3$H$,2DG=$K$J$k!%(B
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
366
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
367 %\section{Dividing up the \sfilename{series} file}
353
89a903605c74 more mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 351
diff changeset
368 \section{\sfilename{series}$B%U%!%$%k$rJ,3d$9$k(B}
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
369
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
370 %I categorise the patches in the \sfilename{series} file into a number
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
371 %of logical groups. Each section of like patches begins with a block
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
372 %of comments that describes the purpose of the patches that follow.
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
373
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
374 $BI.<T$O(B\sfilename{series}$B%U%!%$%k$N%Q%C%A$r$$$/$D$+$NO@M}E*$J%0%k!<%W$K%+(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
375 $B%F%4%i%$%:$7$F$$$k!%%Q%C%A$N$=$l$>$l$N%;%/%7%g%s$O$"$H$KB3$/%Q%C%A$,2?$G(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
376 $B$"$k$+@bL@$9$k%3%a%s%H%V%m%C%/$G;O$^$C$F$$$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
377
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
378 %The sequence of patch groups that I maintain follows. The ordering of
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
379 %these groups is important; I'll describe why after I introduce the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
380 %groups.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
381 $B$=$N8e$K%a%s%F%J%s%9$7$F$$$k%Q%C%A%0%k!<%W$,O"$J$k!%%0%k!<%W$r@0M}$9$k$3(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
382 $B$H$O=EMW$G$"$k!%$^$:%0%k!<%W$K$D$$$F@bL@$7$?8e!$$3$NM}M3$K?($l$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
383
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
384 \begin{itemize}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
385 %\item The ``accepted'' group. Patches that the development team has
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
386 % submitted to the maintainer of the Infiniband subsystem, and which
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
387 % he has accepted, but which are not present in the snapshot that the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
388 % tiny repository is based on. These are ``read only'' patches,
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
389 % present only to transform the tree into a similar state as it is in
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
390 % the upstream maintainer's repository.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
391 \item ``accepted''$B%0%k!<%W!%3+H/%A!<%`$,(BInfiniband$B%5%V%7%9%F%`$N%a%s%F%J(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
392 $B$KDs=P$7!$<uM}$5$l$?$,!$>.%j%]%8%H%j$N%Y!<%9$H$J$C$F$$$k%9%J%C%W(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
393 $B%7%g%C%H$K$O$^$@<h$j9~$^$l$F$$$J$$$b$N!%$3$l$i$O%D%j!<$r>eN.%a%s%F(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
394 $B%J$N%j%]%8%H%j$HF1MM$N>uBV$K$9$k$?$a$KB8:_$9$k(B``$BFI$_=P$7$N$_(B''$B$N%Q%C(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
395 $B%A$G$"$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
396 %\item The ``rework'' group. Patches that I have submitted, but that
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
397 % the upstream maintainer has requested modifications to before he
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
398 % will accept them.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
399 \item ``rework''$B%0%k!<%W!%Ds=P$7$?$,>eN.%a%s%F%J$,<uM}$K@h$@$C$FJQ99$rMW(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
400 $B5a$7$?$b$N!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
401 %\item The ``pending'' group. Patches that I have not yet submitted to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
402 % the upstream maintainer, but which we have finished working on.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
403 % These will be ``read only'' for a while. If the upstream maintainer
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
404 % accepts them upon submission, I'll move them to the end of the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
405 % ``accepted'' group. If he requests that I modify any, I'll move
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
406 % them to the beginning of the ``rework'' group.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
407 \item ``pending''$B%0%k!<%W!%>eN.%a%s%F%J$K$O$^$@Ds=P$7$F$$$J$$$,!$<j85$G(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
408 $B$N:n6H$O40N;$7$?$b$N!%$3$l$i$O$7$P$i$/$N4V(B``read only''$B$K$J$C$F$*(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
409 $B$j!$>eN.$N%a%s%F%J$XDs=P$7$F<uM}$5$l$?;~$O(B``accepted''$B%0%k!<%W$X0\(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
410 $BF0$5$l$k!%%a%s%F%J$,JQ99$rMW5a$7$?>l9g$O(B``rework''$B%0%k!<%W$X0\F0$5(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
411 $B$l$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
412 %\item The ``in progress'' group. Patches that are actively being
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
413 % developed, and should not be submitted anywhere yet.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
414 \item ``in progress''$B%0%k!<%W!%$3$N%0%k!<%W$K$O!$%"%/%F%#%V$K3+H/$5(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
415 $B$l$F$*$j!$$^$@$I$3$X$bDs=P$5$l$k$Y$-$G$O$J$$%Q%C%A$,4^$^$l$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
416 %\item The ``backport'' group. Patches that adapt the source tree to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
417 % older versions of the kernel tree.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
418 \item ``backport''$B%0%k!<%W!%%=!<%9$r8E$$%P!<%8%g%s$N%+!<%M%k%D%j!<$XE,9g(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
419 $B$5$;$k%Q%C%A$+$i$J$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
420 %\item The ``do not ship'' group. Patches that for some reason should
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
421 % never be submitted upstream. For example, one such patch might
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
422 % change embedded driver identification strings to make it easier to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
423 % distinguish, in the field, between an out-of-tree version of the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
424 % driver and a version shipped by a distribution vendor.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
425 \item ``do not ship''$B%0%k!<%W!%$J$s$i$+$NM}M3$K$h$C$F7h$7$F>eN.$XDs=P$5$l(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
426 $B$k$Y$-$G$J$$%Q%C%A$+$i$J$k!%Nc$($P!$%D%j!<30$N%I%i%$%P$H%Y%s%@$K$h$C(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
427 $B$FG[I[$5$l$F$$$k%I%i%$%P$r<1JL$7$d$9$/$9$k$?$a$K%I%i%$%P$N<1JLJ8;z(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
428 $BNs$rJQ99$9$k$h$&$J%Q%C%A$,3:Ev$9$k!%(B
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
429 \end{itemize}
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
430
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
431 %Now to return to the reasons for ordering groups of patches in this
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
432 %way. We would like the lowest patches in the stack to be as stable as
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
433 %possible, so that we will not need to rework higher patches due to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
434 %changes in context. Putting patches that will never be changed first
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
435 %in the \sfilename{series} file serves this purpose.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
436
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
437 $B%Q%C%A$r$3$N$h$&$JJ}K!$G@0M}$9$kM}M3$N@bL@$XLa$m$&!%0lHL$K!$%Q%C%A%9%?%C(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
438 $B%/$NDl$K$"$k%Q%C%A$O$J$k$Y$/0BDj$G$"$C$FM_$7$$$H;W$&$b$N$@!%$=$&$G$"$l(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
439 $B$P!$%Q%C%A$N%3%s%F%-%9%H$GJQ99$K$h$k:F:n6H$r$;$:$K:Q$`!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
440 \sfilename{series}$B$K:G=i$KDI2C$9$k%Q%C%A$O7h$7$FJQ99$5$l$J$$$b$N$K$9$k$H(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
441 $B$h$$!%(B
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
442
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
443 %We would also like the patches that we know we'll need to modify to be
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
444 %applied on top of a source tree that resembles the upstream tree as
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
445 %closely as possible. This is why we keep accepted patches around for
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
446 %a while.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
447
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
448 $B$^$?!$E,MQ$N$?$a$KJQ99$7$J$1$l$P$J$i$J$$%Q%C%A$K$D$$$F$O!$$G$-$k$@$1>eN.(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
449 $B$N%D%j!<$K6a$$%=!<%9%D%j!<$KE,MQ$G$-$k$h$&$K$J$C$F$$$FM_$7$$$H9M$($k!%$3(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
450 $B$l$,<uM}$5$l$?%Q%C%A$r$7$P$i$/$N4VJ];}$7$F$$$kM}M3$G$"$k!%(B
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
451
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
452 %The ``backport'' and ``do not ship'' patches float at the end of the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
453 %\sfilename{series} file. The backport patches must be applied on top
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
454 %of all other patches, and the ``do not ship'' patches might as well
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
455 %stay out of harm's way.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
456
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
457 ``backport''$B$H(B``do not ship''$B%Q%C%A$O(B\sfilename{series}$B%U%!%$%k$NKvHx$KCV(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
458 $B$+$l$k!%(B``backport''$B%Q%C%A$OB>$N%Q%C%A$9$Y$F$N>e$+$iE,MQ$5$l$J$1$l$P$J$i(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
459 $B$J$$$7!$(B``do not ship''$B%Q%C%A$O0BA4$J$H$3$m$KCV$+$l$F$$$J$1$l$P$J$i$J$$!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
460
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
461 %\section{Maintaining the patch series}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
462 \section{$B%Q%C%A%7%j!<%:$r4IM}$9$k(B}
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
463
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
464 %In my work, I use a number of guards to control which patches are to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
465 %be applied.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
466
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
467 $B$3$N:n6H$G$O!$$I$N%Q%C%A$,E,MQ$5$l$k$+@)8f$9$k$?$a$K$$$/$D$+$N%,!<%I$rMQ(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
468 $B$$$F$$$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
469
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
470 \begin{itemize}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
471 %\item ``Accepted'' patches are guarded with \texttt{accepted}. I
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
472 % enable this guard most of the time. When I'm applying the patches
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
473 % on top of a tree where the patches are already present, I can turn
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
474 % this patch off, and the patches that follow it will apply cleanly.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
475
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
476 \item ``Accepted''$B%Q%C%A$O(B\texttt{accepted}$B$K$h$C$F%,!<%I$5$l$F$$$k!%I.<T(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
477 $B$O$3$N%,!<%I$r$[$\$$$D$bM-8z$K$7$F$$$k!%$9$G$K%Q%C%A$,B8:_$7$F$$$k%D%j!<(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
478 $B$N>e$K?7$?$J%Q%C%A$rE,MQ$9$k;~$O!$$3$N%Q%C%A$r%*%U$K$7$F!$8eB3$N%Q%C%A$,(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
479 $B%/%j!<%s$KE,MQ$5$l$k$h$&$K$9$k$3$H$,$G$-$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
480
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
481 %\item Patches that are ``finished'', but not yet submitted, have no
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
482 % guards. If I'm applying the patch stack to a copy of the upstream
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
483 % tree, I don't need to enable any guards in order to get a reasonably
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
484 % safe source tree.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
485
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
486 \item $B40@.$5$l$F$$$k$b$N$N!$$^$@Ds=P$5$l$F$$$J$$%Q%C%A$O%,!<%I$r;}$?$J(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
487 $B$$!%$3$N%Q%C%A%9%?%C%/$r>eN.%D%j!<$N%3%T!<$KE,MQ$9$k>l9g!$%,!<%I$r(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
488 $BA4$/;H$o$:$K==J,0BA4$J%=!<%9%D%j!<$rF@$k$3$H$,$G$-$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
489
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
490 %\item Those patches that need reworking before being resubmitted are
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
491 % guarded with \texttt{rework}.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
492
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
493 \item $B:FDs=P$N$?$a$K:n6H$,I,MW$J%Q%C%A$K$O(B\texttt{rework}$B%,!<%I$rMQ$$$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
494
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
495 %\item For those patches that are still under development, I use
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
496 % \texttt{devel}.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
497
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
498 \item $B3+H/Cf$N%Q%C%A$K$O(B\texttt{devel}$B%,!<%I$rMQ$$$F$$$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
499
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
500 %\item A backport patch may have several guards, one for each version
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
501 % of the kernel to which it applies. For example, a patch that
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
502 % backports a piece of code to~2.6.9 will have a~\texttt{2.6.9} guard.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
503
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
504 \item $B%P%C%/%]!<%H%Q%C%A$O%Q%C%A$,E,MQ$5$l$k%+!<%M%k$N%P!<%8%g%s$=$l$>$l(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
505 $B$KBP$7$F%,!<%I$r;}$D$3$H$,$"$k!%Nc$($P!$$"$k%3!<%I$r(B~2.6.9$B$K%P%C%/(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
506 $B%]!<%H$9$k%Q%C%A$O(B~\texttt{2.6.9}$B$H$$$&%,!<%I$r;}$D!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
507 \end{itemize}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
508 %This variety of guards gives me considerable flexibility in
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
509 %determining what kind of source tree I want to end up with. For most
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
510 %situations, the selection of appropriate guards is automated during
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
511 %the build process, but I can manually tune the guards to use for less
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
512 %common circumstances.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
513
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
514 $BB?$/$N%,!<%I$rMQ$$$k$3$H$K$h$C$F!$=@Fp$K:n6HBP>]$N%=!<%9%D%j!<$rA*$V$3$H(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
515 $B$,$G$-$k!%%S%k%I=hM}Cf$K@5$7$$%,!<%I$r<+F0E*$KA*Br$G$-$k$3$H$,$[$H$s$I$@(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
516 $B$,!$FC<l$J>u67$N$?$a$K<j$GA*$V$3$H$b2DG=$G$"$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
517
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
518 %\subsection{The art of writing backport patches}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
519 \subsection{$B%P%C%/%]!<%H%Q%C%A$r=q$/5;=Q(B}
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
520
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
521 %Using MQ, writing a backport patch is a simple process. All such a
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
522 %patch has to do is modify a piece of code that uses a kernel feature
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
523 %not present in the older version of the kernel, so that the driver
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
524 %continues to work correctly under that older version.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
525
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
526 MQ$B$r;H$C$F%P%C%/%]!<%H%Q%C%A$r=q$/$N$OC1=c$J:n6H$G$"$k!%$=$N$h$&$J%Q%C%A(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
527 $B$,$9$Y$-$3$H$O!$8E$$%P!<%8%g%s$N%+!<%M%k$KHw$o$C$F$$$J$$5!G=$r;H$&%3!<%I(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
528 $B$rJQ99$7!$8E$$%P!<%8%g%s$N%+!<%M%k$G$b@5$7$/5!G=$7B3$1$k$h$&$K$9$k$3$H$@(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
529 $B$1$G$"$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
530
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
531 %A useful goal when writing a good backport patch is to make your code
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
532 %look as if it was written for the older version of the kernel you're
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
533 %targeting. The less obtrusive the patch, the easier it will be to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
534 %understand and maintain. If you're writing a collection of backport
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
535 %patches to avoid the ``rat's nest'' effect of lots of
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
536 %\texttt{\#ifdef}s (hunks of source code that are only used
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
537 %conditionally) in your code, don't introduce version-dependent
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
538 %\texttt{\#ifdef}s into the patches. Instead, write several patches,
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
539 %each of which makes unconditional changes, and control their
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
540 %application using guards.
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
541
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
542 $B$h$$%P%C%/%]!<%H%Q%C%A$H$O!$$=$N%Q%C%A$K$h$C$F$"$?$+$b%3!<%I$,%?!<%2%C%H(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
543 $B$N8E$$%P!<%8%g%s$N%+!<%M%k$K8~$1$F=q$+$l$?$h$&$J>uBV$K$J$k$b$N$G$"$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
544 $BL5M}$N$J$$%Q%C%A$OM}2r$7$d$9$/!$%a%s%F%J%s%9$bMF0W$G$"$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
545 $B%P%C%/%]!<%H%Q%C%A$r$$$/$D$b=q$$$F$$$k$J$i$P!$%3!<%IFb$NBgNL$N(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
546 \texttt{\#ifdef}$B$G>r7oE*%3%s%Q%$%k$5$l$k%3!<%I$K$h$k:.Mp$rHr$1$k$Y$-$G$"(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
547 $B$k!%$=$N$?$a$K%P!<%8%g%s$K0MB8$7$?(B\texttt{\#ifdef}$B$G$O$J$/!$%,!<%I$K$h$C(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
548 $B$F@)8f$5$l$k>r7o%3%s%Q%$%k$K$h$i$J$$JQ99$r2C$($k$Y$-$G$"$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
549
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
550 %There are two reasons to divide backport patches into a distinct
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
551 %group, away from the ``regular'' patches whose effects they modify.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
552 %The first is that intermingling the two makes it more difficult to use
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
553 %a tool like the \hgext{patchbomb} extension to automate the process of
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
554 %submitting the patches to an upstream maintainer. The second is that
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
555 %a backport patch could perturb the context in which a subsequent
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
556 %regular patch is applied, making it impossible to apply the regular
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
557 %patch cleanly \emph{without} the earlier backport patch already being
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
558 %applied.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
559
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
560 $B%P%C%/%]!<%H%Q%C%A$rDL>o$NJQ99$r2C$($k%Q%C%A$HJL$N%0%k!<%W$KJ,3d$9$kM}M3(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
561 $B$,(B2$B$D$"$k!%Bh0l$NM}M3$O!$(B2$B$D$r:.$<9g$o$;$k$3$H$G!$>eN.$N%a%s%F%J$X%Q%C%A(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
562 $B$rDs=P$9$k$?$a$K(B\hgext{patchbomb}$B%(%/%9%F%s%7%g%s$N$h$&$J%D!<%k$r;H$&$N$,(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
563 $BFq$7$/$J$k$3$H$G$"$k!%BhFs$NM}M3$O!$%P%C%/%]!<%H%Q%C%A$O!$8eB3$NDL>o%Q%C(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
564 $B%A$NE,MQ$5$l$k%3%s%F%-%9%H$rMp$9$3$H$,$"$j!$$=$N$h$&$J>l9g!$DL>o%Q%C%A$O(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
565 $B%P%C%/%]!<%H%Q%C%A$J$7$K@5$7$/E,MQ$9$k$3$H$,IT2DG=$K$J$C$F$7$^$&!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
566
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
567 %\section{Useful tips for developing with MQ}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
568 \section{MQ$B$K$h$k3+H/$N(Btips}
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
569
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
570 %\subsection{Organising patches in directories}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
571 \subsection{$B%G%#%l%/%H%jFb$G%Q%C%A$r4IM}$9$k(B}
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
572
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
573 %If you're working on a substantial project with MQ, it's not difficult
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
574 %to accumulate a large number of patches. For example, I have one
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
575 %patch repository that contains over 250 patches.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
576
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
577 MQ$B$rMQ$$$FHf3SE*Bg5,LO$J%W%m%8%'%/%H$G:n6H$7$F$$$k>l9g!$BgNL$N%Q%C%A$,C_(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
578 $B@Q$9$k$3$H$,>/$J$/$J$$!%Nc$($PI.<T$N$H$3$m$K$O!$(B250$B0J>e$N%Q%C%A$r4^$`%Q%C(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
579 $B%A%j%]%8%H%j$,$"$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
580
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
581 %If you can group these patches into separate logical categories, you
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
582 %can if you like store them in different directories; MQ has no
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
583 %problems with patch names that contain path separators.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
584
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
585 $B$b$7$3$l$i$N%Q%C%A$rO@M}E*$J%+%F%4%j$KJ,3d$9$k$3$H$,$G$-!$JL!9$N%G%#%l%/(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
586 $B%H%j$K<}MF$7$?$$$H9M$($k$J$i$P!$%Q%C%AL>$K%Q%9%;%Q%l!<%?$r4^$a$F$b(BMQ$B$OLd(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
587 $BBj$J$/<h$j07$&$3$H$,$G$-$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
588
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
589 %\subsection{Viewing the history of a patch}
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
590 \subsection{$B%Q%C%A$N%R%9%H%j$r8+$k(B}
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
591 \label{mq-collab:tips:interdiff}
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
592
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
593 %If you're developing a set of patches over a long time, it's a good
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
594 %idea to maintain them in a repository, as discussed in
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
595 %section~\ref{sec:mq:repo}. If you do so, you'll quickly discover that
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
596 %using the \hgcmd{diff} command to look at the history of changes to a
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
597 %patch is unworkable. This is in part because you're looking at the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
598 %second derivative of the real code (a diff of a diff), but also
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
599 %because MQ adds noise to the process by modifying time stamps and
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
600 %directory names when it updates a patch.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
601
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
602 $BD9$$4|4V$K$o$?$C$FB?$/$N%Q%C%A$r:n$C$F$-$?$N$J$i!$(B~\ref{sec:mq:repo}$B@a$G(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
603 $B5DO@$7$F$-$?$h$&$K$=$l$i$r%j%]%8%H%j$G4IM}$9$k$N$ONI$$9M$($G$"$k!%$=$&$7(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
604 $B$?>l9g!$$9$0$K(B\hgcmd{diff}$B%3%^%s%I$G$O%Q%C%A$N%R%9%H%j$r8+$k$3$H$K;H$($J(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
605 $B$$$3$H$K5$$E$/$@$m$&!%$3$l$O<B:]$N%3!<%I$NFs<!E*$JGI@8J*!J(Bdiff$B$N(Bdiff$B!K$r(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
606 $B8+$F$$$k$3$H$H!$(BMQ$B$,%Q%C%A$r99?7$9$k;~$K%?%$%`%9%?%s%W$H%G%#%l%/%H%jL>$r(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
607 $BJQ99$9$k$3$H$G!$%W%m%;%9$K%N%$%:$r2C$($F$$$k$?$a$G$G$"$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
608
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
609 %However, you can use the \hgext{extdiff} extension, which is bundled
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
610 %with Mercurial, to turn a diff of two versions of a patch into
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
611 %something readable. To do this, you will need a third-party package
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
612 %called \package{patchutils}~\cite{web:patchutils}. This provides a
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
613 %command named \command{interdiff}, which shows the differences between
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
614 %two diffs as a diff. Used on two versions of the same diff, it
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
615 %generates a diff that represents the diff from the first to the second
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
616 %version.
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
617
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
618 $B$7$+$7(BMercurial$B$KF1:-$5$l$F$$$k(B\hgext{extdiff}$B%(%/%9%F%s%7%g%s$r;H$$!$(B2$B$D(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
619 $B$N%P!<%8%g%s$N%Q%C%A4V$G0UL#$N$"$k:9J,$r<h$k$3$H$,$G$-$k!%$3$N$?$a$K(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
620 \package{patchutils}~\cite{web:patchutils}$B$r;H$&I,MW$,$"$k!%$3$N%Q%C%1!<(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
621 $B%8$O(B2$B$D$N(Bdiff$B%U%!%$%k4V$N:9J,$r(Bdiff$B$H$7$FI=<($9$k(B\command{interdiff}$B$H$$(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
622 $B$&%3%^%s%I$rDs6!$7$F$$$k!%F1$8(Bdiff$B$N0[$J$k%P!<%8%g%s4V$G;HMQ$9$l$P!$A08e(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
623 $B$N(Bdiff$B$N4V$N(Bdiff$B$r@8@.$9$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
624
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
625 %You can enable the \hgext{extdiff} extension in the usual way, by
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
626 %adding a line to the \rcsection{extensions} section of your \hgrc.
356
b96d7f6504e5 compile fix
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 354
diff changeset
627 \hgrc $B%U%!%$%k$N(B \rcsection{extensions} $B%;%/%7%g%s$K<!$N9T$rDI2C$9$kDL>o$N(B
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
628 $BJ}K!$G(B\hgext{extdiff}$B$rM-8z$K$G$-$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
629 \begin{codesample2}
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
630 [extensions]
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
631 extdiff =
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
632 \end{codesample2}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
633 %The \command{interdiff} command expects to be passed the names of two
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
634 %files, but the \hgext{extdiff} extension passes the program it runs a
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
635 %pair of directories, each of which can contain an arbitrary number of
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
636 %files. We thus need a small program that will run \command{interdiff}
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
637 %on each pair of files in these two directories. This program is
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
638 %available as \sfilename{hg-interdiff} in the \dirname{examples}
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
639 %directory of the source code repository that accompanies this book.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
640 %\excode{hg-interdiff}
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
641
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
642 \command{interdiff}$B%3%^%s%I$O(B2$B$D$N%U%!%$%kL>$rEO$5$l$k$3$H$rA[Dj$7$F$$$k(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
643 $B$,!$(B\hgext{extdiff}$B3HD%$O!$(B2$B$D$N%G%#%l%/%H%j$r0z?t$H$7$F<h$k%3%^%s%I$r5/(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
644 $BF0$9$k!%=>$C$F$3$l$i$N(B2$B$D$N%G%#%l%/%H%j$N3F!9$N%U%!%$%k$KBP$7$F(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
645 \command{interdiff}$B$r5/F0$9$k>.$5$J%W%m%0%i%`$,I,MW$K$J$k!%$3$NK\$N%=!<%9(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
646 $B%3!<%I%j%]%8%H%j%G%#%l%/%H%jFb$N(B\dirname{examples}$B%G%#%l%/%H%j$K$"$k(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
647 \sfilename{hg-interdiff}$B$H$$$&%W%m%0%i%`$,$=$l$@!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
648 \excode{hg-interdiff}
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
649
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
650 %With the \sfilename{hg-interdiff} program in your shell's search path,
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
651 %you can run it as follows, from inside an MQ patch directory:
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
652 $B%7%'%k%5!<%A%Q%9$NCf$K(B\sfilename{hg-interdiff}$B$,$"$l$P!$(B MQ$B%Q%C%A%G%#%l%/(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
653 $B%H%j$NCf$+$i<!$N$h$&$K5/F0$G$-$k!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
654
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
655 \begin{codesample2}
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
656 hg extdiff -p hg-interdiff -r A:B my-change.patch
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
657 \end{codesample2}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
658 %Since you'll probably want to use this long-winded command a lot, you
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
659 %can get \hgext{hgext} to make it available as a normal Mercurial
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
660 %command, again by editing your \hgrc.
356
b96d7f6504e5 compile fix
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 354
diff changeset
661 $B$3$ND9$$%3%^%s%I$OIQHK$K;H$&$3$H$K$J$k$@$m$&!%$=$3$G(B \hgrc $B$rJT=8(B
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
662 $B$7!$(B\hgext{hgext}$B$GDL>o$N(BMercurial$B%3%^%s%I$N$h$&$K;H$($k$h$&$K$9$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
663 \begin{codesample2}
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
664 [extdiff]
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
665 cmd.interdiff = hg-interdiff
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
666 \end{codesample2}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
667 %This directs \hgext{hgext} to make an \texttt{interdiff} command
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
668 %available, so you can now shorten the previous invocation of
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
669 %\hgxcmd{extdiff}{extdiff} to something a little more wieldy.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
670 $B$3$l$O(B\hgext{hgext}$B$K(B\texttt{interdiff}$B%3%^%s%I$,MxMQ2DG=$G$"$k$3$H$r;X(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
671 $B<($9$k$?$a!$0JA0$N(B\hgxcmd{extdiff}{extdiff}$B$N5/F0$r<c434JC1$K$G$-$k!%(B
106
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
672 \begin{codesample2}
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
673 hg interdiff -r A:B my-change.patch
9cbc5d0db542 Finish off advanced MQ chapter (maybe).
Bryan O'Sullivan <bos@serpentine.com>
parents: 105
diff changeset
674 \end{codesample2}
105
ecacb6b4c9fd Grouping patches in the series file.
Bryan O'Sullivan <bos@serpentine.com>
parents: 104
diff changeset
675
107
a0d7e11db169 A brief note on interdiff.
Bryan O'Sullivan <bos@serpentine.com>
parents: 106
diff changeset
676 \begin{note}
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
677 % The \command{interdiff} command works well only if the underlying
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
678 % files against which versions of a patch are generated remain the
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
679 % same. If you create a patch, modify the underlying files, and then
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
680 % regenerate the patch, \command{interdiff} may not produce useful
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
681 % output.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
682
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
683 \command{interdiff}$B%3%^%s%I$O!$%Q%C%A$N%P!<%8%g%s$,@8@.$5$l$?85$N%U%!%$%k(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
684 $B$,F10l$KJ]$?$l$F$$$k>l9g$K8B$C$F@5$7$/F0$/!%%Q%C%A$r:n@.$7$F$+$i85$N%U%!(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
685 $B%$%k$rJQ99$7!$%Q%C%A$r:F@8@.$7$?>l9g$O(B\command{interdiff}$B$OM-MQ$J:9J,$r=P(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
686 $BNO$7$J$$$+$b$7$l$J$$!%(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
687
107
a0d7e11db169 A brief note on interdiff.
Bryan O'Sullivan <bos@serpentine.com>
parents: 106
diff changeset
688 \end{note}
a0d7e11db169 A brief note on interdiff.
Bryan O'Sullivan <bos@serpentine.com>
parents: 106
diff changeset
689
354
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
690 %The \hgext{extdiff} extension is useful for more than merely improving
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
691 %the presentation of MQ~patches. To read more about it, go to
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
692 %section~\ref{sec:hgext:extdiff}.
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
693
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
694 \hgext{extdiff}$B%(%/%9%F%s%7%g%s$O(BMQ$B%Q%C%A$NI=8=$r2~A1$9$k0J>e$N$3$H$r$9(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
695 $B$k!%$3$N%(%/%9%F%s%7%g%s$K$D$$$F99$KCN$j$?$$;~$O(B\ref{sec:hgext:extdiff}$B%;(B
4991d84ba9d6 finished mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 353
diff changeset
696 $B%/%7%g%s$r;2>H$5$l$?$$!%(B
239
fe8598eb99c4 Refer to main coverage of extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 238
diff changeset
697
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
698 %%% Local Variables:
293
3b1291f24c0d - replaved latex-mode to yatex-mode
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 290
diff changeset
699 %%% mode: yatex
104
32bf9a5f22c0 Refactor MQ chapter into three.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
700 %%% TeX-master: "00book"
349
84ae26ab0ac3 started mq-collab.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
701 %%% End: