Mercurial > hgbook
annotate ja/hgext.tex @ 387:1604f2b2054b
more intro.tex
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sun, 22 Feb 2009 00:48:17 +0900 |
parents | 81116699a510 |
children | 8a3041e6f3cb |
rev | line source |
---|---|
355 | 1 %\chapter{Adding functionality with extensions} |
2 \chapter{$B3HD%$K$h$k5!G=$NDI2C(B} | |
223
4c9b9416cd23
Skeleton for chapter on extensions.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
3 \label{chap:hgext} |
4c9b9416cd23
Skeleton for chapter on extensions.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
4 |
355 | 5 %While the core of Mercurial is quite complete from a functionality |
6 %standpoint, it's deliberately shorn of fancy features. This approach | |
7 %of preserving simplicity keeps the software easy to deal with for both | |
8 %maintainers and users. | |
9 | |
10 $B5!G=$N4QE@$+$i8+$k$H(BMercurial$B$O$+$J$j40Hw$7$F$$$k$,!$GI<j$J5!G=$K$D$$$F$O(B | |
11 $B0U?^E*$KGS=|$7$F$$$k!%(BMercurial$B$N%a%s%F%J$H%f!<%6$NAPJ}$K$H$C$FC1=c$5$rJ](B | |
12 $B$D$?$a$K$3$N%"%W%m!<%A$r<h$C$F$$$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
13 |
355 | 14 %However, Mercurial doesn't box you in with an inflexible command set: |
15 %you can add features to it as \emph{extensions} (sometimes known as | |
16 %\emph{plugins}). We've already discussed a few of these extensions in | |
17 %earlier chapters. | |
18 | |
19 $B$7$+$7$J$,$i!$(BMercurial$B$OM;DL$NMx$+$J$$%3%^%s%I%;%C%H$rDs6!$7$F$$$k$N$G$O(B | |
20 $B$J$$!%(B\emph{extensions}$B!J$"$k$$$O(B\emph{plugins}$B$H8F$P$l$k$3$H$b$"$k!K$K$h$C(B | |
21 $B$F5!G=$rDI2C$9$k$3$H$,$G$-$k!%$3$l$i$N$$$/$D$+$K$D$$$F$O!$0JA0$N>O$G8+$F(B | |
22 $B$$$k!%(B | |
23 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
24 \begin{itemize} |
355 | 25 %\item Section~\ref{sec:tour-merge:fetch} covers the \hgext{fetch} |
26 % extension; this combines pulling new changes and merging them with | |
27 % local changes into a single command, \hgxcmd{fetch}{fetch}. | |
28 \item $B%;%/%7%g%s(B\ref{sec:tour-merge:fetch}$B$O(B\hgext{fetch}$B%(%/%9%F%s%7%g%s(B | |
29 $B$r%+%P!<$7$F$$$k!%$3$l$O?7$7$$JQ99$r(Bpull$B$7!$%m!<%+%k$JJQ99$H%^!<%8(B | |
30 $B$rC10l$N%3%^%s%I(B\hgxcmd{fetch}{fetch}$B$G<B9T$9$k!%(B | |
31 %\item In chapter~\ref{chap:hook}, we covered several extensions that | |
32 % are useful for hook-related functionality: \hgext{acl} adds access | |
33 % control lists; \hgext{bugzilla} adds integration with the Bugzilla | |
34 % bug tracking system; and \hgext{notify} sends notification emails on | |
35 % new changes. | |
36 \item \ref{chap:hook}$B$G$O!$%U%C%/$K4XO"$7$?$$$/$D$+$N3HD%$K$D$$$F07$&!%(B | |
37 \hgext{acl}$B$O%"%/%;%9@)8f%j%9%H$rDI2C$9$k!%(B\hgext{bugzilla}$B$O(BBugzilla$B5!G=(B | |
38 $B$NE}9g5!G=$rDs6!$9$k!%(B\hgext{notify}$B$O!$?7$?$JJQ99$N:]$KDLCNEE;R%a!<%k$r(B | |
39 $BAw$k5!G=$rDs6!$9$k!%(B | |
40 %\item The Mercurial Queues patch management extension is so invaluable | |
41 % that it merits two chapters and an appendix all to itself. | |
42 % Chapter~\ref{chap:mq} covers the basics; | |
43 % chapter~\ref{chap:mq-collab} discusses advanced topics; and | |
44 % appendix~\ref{chap:mqref} goes into detail on each command. | |
45 \item Mercurial Queue$B$H$$$&%Q%C%A%^%M!<%8%a%s%H3HD%$O!$Hs>o$K=EMW$J$N$G(B2 | |
46 $B>O$HIUO?(B1$B>O$rHq$d$7$F@bL@$9$k!%(B | |
47 Chapter~\ref{chap:mq}$B$O4pK\E*$J5!G=$r@bL@$9$k!%(B | |
48 chapter~\ref{chap:mq-collab}$B$G$O9bEY$J5!G=$K$D$$$F@bL@$7!$(B | |
49 appendix~\ref{chap:mqref}$B$G$O3F%3%^%s%I$N>\:Y$r@bL@$9$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
50 \end{itemize} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
51 |
355 | 52 %In this chapter, we'll cover some of the other extensions that are |
53 %available for Mercurial, and briefly touch on some of the machinery | |
54 %you'll need to know about if you want to write an extension of your | |
55 %own. | |
56 $B$3$N>O$G$O(BMercurial$B$GMxMQ2DG=$J$=$NB>$N3HD%$K$D$$$F<h$j07$$!$$^$?<+J,$G(B | |
57 Mercurial$B3HD%$r=q$/;~$KLrN)$DFbIt$N5!9=$K$D$$$F$b@bL@$9$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
58 \begin{itemize} |
355 | 59 %\item In section~\ref{sec:hgext:inotify}, we'll discuss the |
60 % possibility of \emph{huge} performance improvements using the | |
61 % \hgext{inotify} extension. | |
62 \item \ref{sec:hgext:inotify}$B@a$G$O(B\hgext{inotify}$B3HD%$rMQ$$$k$3$H$GF@$i(B | |
63 $B$l$k(B\emph{$BBg$-$J(B}$B@-G=8~>e$K$D$$$F=R$Y$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
64 \end{itemize} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
65 |
355 | 66 %\section{Improve performance with the \hgext{inotify} extension} |
67 \section{\hgext{inotify}$B3HD%$K$h$k@-G=8~>e(B} | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
68 \label{sec:hgext:inotify} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
69 |
355 | 70 %Are you interested in having some of the most common Mercurial |
71 %operations run as much as a hundred times faster? Read on! | |
72 Mercurial$B$N:G$bB?MQ$5$l$k%3%^%s%I$N$$$/$D$+$,?tI4G\B.$/$J$k$3$H$K6=L#$,$"(B | |
73 $B$k$J$i$P$<$RFI$s$GM_$7$$!*(B | |
74 | |
75 %Mercurial has great performance under normal circumstances. For | |
76 %example, when you run the \hgcmd{status} command, Mercurial has to | |
77 %scan almost every directory and file in your repository so that it can | |
78 %display file status. Many other Mercurial commands need to do the | |
79 %same work behind the scenes; for example, the \hgcmd{diff} command | |
80 %uses the status machinery to avoid doing an expensive comparison | |
81 %operation on files that obviously haven't changed. | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
82 |
355 | 83 $BDL>o$N>r7o2<$G(BMercurial$B$O9b$$@-G=$r;}$C$F$$$k$,!$(B \hgcmd{status}$B%3%^%s%I(B |
84 $B$r<B9T$7$?;~!$(BMercurial$B$O$[$\A4$F$N%G%#%l%/%H%j$H%U%!%$%k$r%9%-%c%s$9$k$3(B | |
85 $B$H$K$J$k!%B>$NB?$/$N(BMercurial$B%3%^%s%I$O!$$3$N$h$&$JA`:n$r0U<1$5$;$J$$$h$&(B | |
86 $B$K$J$C$F$$$k!%Nc$($P(B\hgcmd{diff}$B$O%9%F!<%?%95!9=$rMQ$$$F!$L@$i$+$KJQ99$5(B | |
87 $B$l$F$$$J$$%U%!%$%k$NHf3S$rHr$1$F$$$k!%(B | |
88 | |
89 %Because obtaining file status is crucial to good performance, the | |
90 %authors of Mercurial have optimised this code to within an inch of its | |
91 %life. However, there's no avoiding the fact that when you run | |
92 %\hgcmd{status}, Mercurial is going to have to perform at least one | |
93 %expensive system call for each managed file to determine whether it's | |
94 %changed since the last time Mercurial checked. For a sufficiently | |
95 %large repository, this can take a long time. | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
96 |
355 | 97 $BNI$$@-G=$rF@$k$?$a$K$O!$%U%!%$%k%9%F!<%?%9$N<hF@$,=EMW$J4X?4;v$H$J$k$?(B |
98 $B$a!$(BMercurial$B$N:n<T$?$A$O$3$l$r$.$j$.$j$N$H$3$m$^$G:GE,2=$7$F$$$k!%$7$+$7(B | |
99 \hgcmd{status}$B%3%^%s%I$G$O$3$l$rHr$1$k<jN)$F$,$J$$!%(B Mercurial$B$O!$4IM}$7(B | |
100 $B$F$$$k%U%!%$%k$,:G8e$K%A%'%C%/$7$?;~$+$iJQ99$5$l$F$$$k$+D4$Y$k$?$a$K!$>/(B | |
101 $B$J$/$H$b0l$D$N9b2A$J%7%9%F%`%3!<%k$r$9$kI,MW$,$"$k!%$"$kDxEY0J>eBg$-$J%j(B | |
102 $B%]%8%H%j$G$O!$$3$NA`:n$K$OD9$$;~4V$rMW$9$k!%(B | |
103 | |
104 %To put a number on the magnitude of this effect, I created a | |
105 %repository containing 150,000 managed files. I timed \hgcmd{status} | |
106 %as taking ten seconds to run, even when \emph{none} of those files had | |
107 %been modified. | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
108 |
355 | 109 $B$3$N1F6A$K$D$$$FD4$Y$k$?$a$K(B150,000$B$N%U%!%$%k$rMJ$9$k%j%]%8%H%j$r:n@.$7(B |
110 $B$?!%(B\emph{$B$^$C$?$/(B}$BJQ99$,$J$$>l9g$G$b(B\hgcmd{status}$B%3%^%s%I$N<B9T$K$O(B10 | |
111 $BIC$rMW$7$?!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
112 |
355 | 113 %Many modern operating systems contain a file notification facility. |
114 %If a program signs up to an appropriate service, the operating system | |
115 %will notify it every time a file of interest is created, modified, or | |
116 %deleted. On Linux systems, the kernel component that does this is | |
117 %called \texttt{inotify}. | |
118 | |
119 $B6aG/$N%*%Z%l!<%F%#%s%0%7%9%F%`$O!$%U%!%$%kDLCN$N5!9=$rHw$($F$$$k!%%W%m%0(B | |
120 $B%i%`$,E,@Z$J%5!<%S%9$KEPO?$9$k$H!$%*%Z%l!<%F%#%s%0%7%9%F%`$OBP>]$H$J$k%U%!(B | |
121 $B%$%k$N:n@.!$JQ99!$:o=|$r%W%m%0%i%`$KDLCN$9$k!%(B Linux$B%7%9%F%`$G$O$3$l$r9T(B | |
122 $B$&%+!<%M%k%3%s%]!<%M%s%H$O(B\texttt{inotify}$B$H8F$P$l$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
123 |
355 | 124 %Mercurial's \hgext{inotify} extension talks to the kernel's |
125 %\texttt{inotify} component to optimise \hgcmd{status} commands. The | |
126 %extension has two components. A daemon sits in the background and | |
127 %receives notifications from the \texttt{inotify} subsystem. It also | |
128 %listens for connections from a regular Mercurial command. The | |
129 %extension modifies Mercurial's behaviour so that instead of scanning | |
130 %the filesystem, it queries the daemon. Since the daemon has perfect | |
131 %information about the state of the repository, it can respond with a | |
132 %result instantaneously, avoiding the need to scan every directory and | |
133 %file in the repository. | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
134 |
355 | 135 Mercurial$B$N(B\hgext{inotify}$B3HD%$O!$(B\hgcmd{status}$B%3%^%s%I$r:GE,2=$9$k$?$a(B |
136 $B$K!$%+!<%M%k$N(B\texttt{inotify}$B%3%s%]!<%M%s%H$X%"%/%;%9$9$k!%$3$N3HD%$O(B2$B$D(B | |
137 $B$N%3%s%]!<%M%s%H$+$i$J$k!%(B \texttt{inotify}$B%5%V%7%9%F%`$+$iDLCN$r<u$1<h$k(B | |
138 $B$?$a$N%G!<%b%s$,%P%C%/%0%i%s%I$GF0:n$9$k!%$3$N%G!<%b%s$O(BMercurial$B$NB>$N%3(B | |
139 $B%^%s%I$+$i$N@\B3$b<u$1IU$1$k!%$3$N3HD%$O(BMercurial$B$N5sF0$rJQ99$7!$%U%!%$%k(B | |
140 $B%7%9%F%`$r%9%-%c%s$9$k$N$G$O$J$/!$%G!<%b%s$X$NLd$$9g$o$;$r9T$&$h$&$K$9(B | |
141 $B$k!%%G!<%b%s$O%j%]%8%H%j$N>uBV$r40A4$KGD0.$7$F$$$k$N$G!$D>$A$KLd$$9g$o$;(B | |
142 $B$KJVEz$9$k$3$H$,$G$-!$%j%]%8%H%j$N%G%#%l%/%H%j$H%U%!%$%k$N%9%-%c%s$rHr$1(B | |
143 $B$k$3$H$,$G$-$k!%(B | |
144 | |
145 %Recall the ten seconds that I measured plain Mercurial as taking to | |
146 %run \hgcmd{status} on a 150,000 file repository. With the | |
147 %\hgext{inotify} extension enabled, the time dropped to 0.1~seconds, a | |
148 %factor of \emph{one hundred} faster. | |
149 | |
150 $B%W%l!<%s$J(BMercurial$B$G$O(B\hgcmd{status}$B%3%^%s%I$,(B150,000$B%U%!%$%k$N%j%]%8%H(B | |
151 $B%j$KBP$7$F(B10$BIC$rMW$7$F$$$?$3$H$r;W$$=P$7$FM_$7$$!#(B | |
152 \hgext{inotify}$B3HD%$r;H$C$?>l9g!"=jMW;~4V$O(B0.1$BIC$K2<$,$j!$(B\emph{100}$BG\B.(B | |
153 $B$/$J$C$F$$$k$3$H$,J,$+$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
154 |
355 | 155 %Before we continue, please pay attention to some caveats. |
156 $B$5$i$K?J$`A0$K!$Cm0UE@$r5s$2$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
157 \begin{itemize} |
355 | 158 %\item The \hgext{inotify} extension is Linux-specific. Because it |
159 % interfaces directly to the Linux kernel's \texttt{inotify} | |
160 % subsystem, it does not work on other operating systems. | |
161 \item \hgext{inotify}$B3HD%$O(BLinux$BFCM-$N$b$N$G$"$k!%$3$N5!G=3HD%$O(BLinux$B$N(B | |
162 \texttt{inotify}$B%5%V%7%9%F%`$KD>@\%"%/%;%9$9$k$?$a!$B>$N%*%Z%l!<(B | |
163 $B%F%#%s%0%7%9%F%`$G$OF0:n$7$J$$!%(B | |
164 | |
165 %\item It should work on any Linux distribution that was released after | |
166 % early~2005. Older distributions are likely to have a kernel that | |
167 % lacks \texttt{inotify}, or a version of \texttt{glibc} that does not | |
168 % have the necessary interfacing support. | |
169 \item 2005$BG/=i$a0J9_$K%j%j!<%9$5$l$?$I$N$h$&$J(BLinux$B%G%#%9%H%j%S%e!<%7%g(B | |
170 $B%s$G$bF0:n$9$k$O$:$@$,!$8E$$%G%#%9%H%j%S%e!<%7%g%s$G$O(B | |
171 \texttt{inotify}$B$r7g$$$F$$$?$j!$I,MW$J%$%s%?!<%U%'!<%9%5%]!<%H$r(B | |
172 \texttt{glibc}$B$,Ds6!$7$F$$$J$+$C$?$j$9$k2DG=@-$,$"$k!%(B | |
173 | |
174 %\item Not all filesystems are suitable for use with the | |
175 % \hgext{inotify} extension. Network filesystems such as NFS are a | |
176 % non-starter, for example, particularly if you're running Mercurial | |
177 | |
178 % on several systems, all mounting the same network filesystem. The | |
179 % kernel's \texttt{inotify} system has no way of knowing about changes | |
180 % made on another system. Most local filesystems (e.g.~ext3, XFS, | |
181 % ReiserFS) should work fine. | |
182 \item $BA4$F$N%U%!%$%k%7%9%F%`$,(B\hgext{inotify}$B3HD%$GMxMQ2DG=$J$o$1$G$O$J(B | |
183 $B$$!%Nc$((B | |
184 $B$P(BMercurial$B$r$$$/$D$+$N%7%9%F%`$GF0:n$5$;$F$$$k>l9g!$F10l$N%M%C%H%o!<%/%U%!(B | |
185 $B%$%k%7%9%F%`$r3F!9$N%7%9%F%`$G%^%&%s%H$7$F$$$k$3$H$,B?$$$,!$(B NFS$B$J$I$N%M%C(B | |
186 $B%H%o!<%/%U%!%$%k%7%9%F%`$O9MN8$5$l$F$$$J$$!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
187 \end{itemize} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
188 |
357 | 189 %The \hgext{inotify} extension is not yet shipped with Mercurial as of |
190 %May~2007, so it's a little more involved to set up than other | |
191 %extensions. But the performance improvement is worth it! | |
192 | |
193 2007$BG/(B5$B7n$^$G$O(B\hgext{inotify}$B3HD%$O(BMercurial$B$KF1:-$5$l$F$$$J$+$C$?!%$=$N(B | |
194 $B$?$a!$%;%C%H%"%C%W$OB>$N3HD%$KHf$Y$F$d$dJ#;($@$,!$F@$i$l$k@-G=8~>e$O$K$O(B | |
195 $B$=$l$@$1$N2ACM$,$"$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
196 |
357 | 197 %The extension currently comes in two parts: a set of patches to the |
198 %Mercurial source code, and a library of Python bindings to the | |
199 %\texttt{inotify} subsystem. | |
200 | |
201 $B8=:_!$3HD%$O(B2$B$D$N%Q!<%H$KJ,$+$l$F$$$k!%(BMercurial$B%=!<%9%3!<%I$X$N%Q%C%A$H(B | |
202 \texttt{inotify}$B%5%V%7%9%F%`$X$N(BPython$B%P%$%s%G%#%s%0%i%$%V%i%j$G$"$k!%(B | |
203 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
204 \begin{note} |
357 | 205 % There are \emph{two} Python \texttt{inotify} binding libraries. One |
206 % of them is called \texttt{pyinotify}, and is packaged by some Linux | |
207 % distributions as \texttt{python-inotify}. This is \emph{not} the | |
208 % one you'll need, as it is too buggy and inefficient to be practical. | |
209 | |
210 Python$B$N(B\texttt{inotify}$B%P%$%s%G%#%s%0%i%$%V%i%j$O(B\emph{2$B$D(B}$B$"$k!%(B1$B$D$O(B | |
211 \texttt{pyinotify}$B$G$"$j!$$$$/$D$+$N(BLinux$B%G%#%9%H%j%S%e!<%7%g%s$G$O(B | |
212 \texttt{python-inotify}$B$H$7$F%Q%C%1!<%82=$5$l$F$$$k!%$3$l$O%P%0$,Hs>o$KB?(B | |
213 $B$/!$<BMQ$9$k$K$OHs8zN(E*$G$"$j!$;H$&$Y$-$G(B\emph{$B$J$$(B}$B!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
214 \end{note} |
359 | 215 |
357 | 216 %To get going, it's best to already have a functioning copy of |
217 %Mercurial installed. | |
218 $B@h$X?J$`$KEv$C$F!$@5$7$/5!G=$9$k(BMercurial$B$,%$%s%9%H!<%k$5$l$F$$$k$3$H$,(B | |
219 $BK>$^$7$$!%(B | |
220 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
221 \begin{note} |
357 | 222 % If you follow the instructions below, you'll be \emph{replacing} and |
223 % overwriting any existing installation of Mercurial that you might | |
224 % already have, using the latest ``bleeding edge'' Mercurial code. | |
225 % Don't say you weren't warned! | |
226 $B0J2<$N;X<($K=>$C$F%$%s%9%H!<%k$7$?(BMercurial$B$r!$:G?7$N(BMercurial$B%3!<%I$G(B | |
227 \emph{$BCV$-49$($k(B}$B$3$H$,$G$-$k!%!J7Y9p$5$l$J$+$C$?$H$O8@$o$J$$$3$H!K(B | |
228 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
229 \end{note} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
230 \begin{enumerate} |
357 | 231 %\item Clone the Python \texttt{inotify} binding repository. Build and |
232 % install it. | |
233 \item Python \texttt{inotify}$B%P%$%s%G%#%s%0$N%j%]%8%H%j$r%/%m!<%s$7!$%S(B | |
234 $B%k%I$H%$%s%9%H!<%k$r9T$&!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
235 \begin{codesample4} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
236 hg clone http://hg.kublai.com/python/inotify |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
237 cd inotify |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
238 python setup.py build --force |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
239 sudo python setup.py install --skip-build |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
240 \end{codesample4} |
357 | 241 %\item Clone the \dirname{crew} Mercurial repository. Clone the |
242 % \hgext{inotify} patch repository so that Mercurial Queues will be | |
243 % able to apply patches to your cope of the \dirname{crew} repository. | |
244 \item Merecurial$B$N(B\dirname{crew}$B%j%]%8%H%j$r%/%m!<%s$9(B | |
245 $B$k!%(B\hgext{inotify}$B%Q%C%A%j%]%8%H%j$r%/%m!<%s$7!$(BMercurial Queues | |
246 $B$,(B\dirname{crew}$B%j%]%8%H%j$K%Q%C%A$rEv$F$i$l$k$h$&$K$9$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
247 \begin{codesample4} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
248 hg clone http://hg.intevation.org/mercurial/crew |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
249 hg clone crew inotify |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
250 hg clone http://hg.kublai.com/mercurial/patches/inotify inotify/.hg/patches |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
251 \end{codesample4} |
357 | 252 %\item Make sure that you have the Mercurial Queues extension, |
253 % \hgext{mq}, enabled. If you've never used MQ, read | |
254 % section~\ref{sec:mq:start} to get started quickly. | |
255 | |
256 \item Mercurial Queues$B3HD%!J(B\hgext{mq}$B!K$,M-8z$K$J$C$F$$$k$3$H$r3NG'$9(B | |
257 $B$k!%(BMQ$B$r;H$C$?$3$H$,$J$1$l$P!$(B\ref{sec:mq:start}$B$r0lFI$9$k$3$H$r$*(B | |
258 $B$9$9$a$9$k!%(B | |
259 | |
260 %\item Go into the \dirname{inotify} repo, and apply all of the | |
261 % \hgext{inotify} patches using the \hgxopt{mq}{qpush}{-a} option to | |
262 % the \hgxcmd{mq}{qpush} command. | |
263 \item \dirname{inotify}$B%j%]%8%H%j$X9T$-!$(B\hgxcmd{mq}{qpush}$B%3%^%s%I$K(B | |
264 \hgxopt{mq}{qpush}{-a}$B%*%W%7%g%s$r;H$C$F(B\hgext{inotify}$B$N%Q%C%A$r$9(B | |
265 $B$Y$FE,MQ$9$k!%(B | |
266 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
267 \begin{codesample4} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
268 cd inotify |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
269 hg qpush -a |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
270 \end{codesample4} |
357 | 271 % If you get an error message from \hgxcmd{mq}{qpush}, you should not |
272 % continue. Instead, ask for help. | |
273 | |
274 \hgxcmd{mq}{qpush}$B$G%(%i!<$,5/$-$?>l9g!$@h$X?J$^$:$K=u8@$r5a$a$FM_$7$$!%(B | |
275 | |
276 %\item Build and install the patched version of Mercurial. | |
277 \item $B%Q%C%A$rEv$F$?(BMercurial$B$r%S%k%I$7$F%$%s%9%H!<%k$9$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
278 \begin{codesample4} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
279 python setup.py build --force |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
280 sudo python setup.py install --skip-build |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
281 \end{codesample4} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
282 \end{enumerate} |
357 | 283 %Once you've build a suitably patched version of Mercurial, all you |
284 %need to do to enable the \hgext{inotify} extension is add an entry to | |
285 %your \hgrc. | |
286 | |
287 $BE,@Z$J%Q%C%A$NEv$C$?(BMercurial$B$r%S%k%I$9$l$P!$8e$O(B\hgext{inotify}$B3HD%$rMx(B | |
288 $BMQ$9$k$h$&$K(B\hgrc $B$r@_Dj$9$k$@$1$G$"$k!%(B | |
289 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
290 \begin{codesample2} |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
291 [extensions] |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
292 inotify = |
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
293 \end{codesample2} |
357 | 294 %When the \hgext{inotify} extension is enabled, Mercurial will |
295 %automatically and transparently start the status daemon the first time | |
296 %you run a command that needs status in a repository. It runs one | |
297 %status daemon per repository. | |
298 | |
299 \hgext{inotify}$B$,M-8z$K$J$C$F$$$k$H!$(BMercurial$B$O%j%]%8%H%jFb$G%3%^%s%I$,(B | |
300 $B:G=i$K<B9T$5$l$?;~$K<+F0E*$+$DF)2aE*$K%9%F!<%?%9%G!<%b%s$r5/F0$9$k!%%j%](B | |
301 $B%8%H%j(B1$B$D$4$H$K(B1$B$D$N%9%F!<%?%9%G!<%b%s$,5/F0$5$l$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
302 |
357 | 303 %The status daemon is started silently, and runs in the background. If |
304 %you look at a list of running processes after you've enabled the | |
305 %\hgext{inotify} extension and run a few commands in different | |
306 %repositories, you'll thus see a few \texttt{hg} processes sitting | |
307 %around, waiting for updates from the kernel and queries from | |
308 %Mercurial. | |
309 | |
310 $B%9%F!<%?%9%G!<%b%s$O2?$b=PNO$r9T$o$:!$%P%C%/%0%i%&%s%I$GF0:n$9(B | |
311 $B$k!%(B\hgext{inotify}$B3HD%$rM-8z$K$7$?8e$GJL$N%j%]%8%H%jFb$G$$$/$D$+%3%^%s%I(B | |
312 $B$r<B9T$7!$<B9TCf$N%W%m%;%9$N%j%9%H$r8+$k$H!$$$$/$D$+$N(B\texttt{hg}$B%W%m%;%9(B | |
313 $B$,%+!<%M%k$+$i$N%"%C%W%G!<%H$H(BMercurial$B$+$i$NLd$$9g$o$;$rBT$C$F$$$k$N$,(B | |
314 $B8+$i$l$k$@$m$&!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
315 |
357 | 316 %The first time you run a Mercurial command in a repository when you |
317 %have the \hgext{inotify} extension enabled, it will run with about the | |
318 %same performance as a normal Mercurial command. This is because the | |
319 %status daemon needs to perform a normal status scan so that it has a | |
320 %baseline against which to apply later updates from the kernel. | |
321 %However, \emph{every} subsequent command that does any kind of status | |
322 %check should be noticeably faster on repositories of even fairly | |
323 %modest size. Better yet, the bigger your repository is, the greater a | |
324 %performance advantage you'll see. The \hgext{inotify} daemon makes | |
325 %status operations almost instantaneous on repositories of all sizes! | |
326 | |
327 \hgext{inotify}$B3HD%$rM-8z$K$7!$%j%]%8%H%jFb$G(BMercurial$B%3%^%s%I$r:G=i$K<B(B | |
328 $B9T$7$?;~$ODL>o$N(BMercurial$B%3%^%s%I$HF1MM$N@-G=$GF0$/!%%9%F!<%?%9%G!<%b%s$O(B | |
329 $BDL>o$N%9%F!<%?%9%9%-%c%s$r9T$$!$%+!<%M%k$+$i99?7$NDLCN$r<u$1$k$?$a$N%Y!<(B | |
330 $B%9%i%$%s$r<hF@$7$F$*$+$J$1$l$P$J$i$J$$$+$i$G$"$k!%0lJ}$G!$8eB3$N%9%F!<%?(B | |
331 $B%9%A%'%C%/$r9T$&(B\emph{$B$9$Y$F$N(B}$B%3%^%s%I$O!$$=$3$=$3$NBg$-$5$N%j%]%8%H%j$K(B | |
332 $BBP$7$F$bL\$K8+$($F9bB.2=$5$l$k!%$5$i$K%j%]%8%H%j$,Bg$-$/$J$k$KO"$l$F@-G=(B | |
333 $B$N8~>e$OBg$-$/$J$k!%(B\hgext{inotify}$B%G!<%b%s$O!$%j%]%8%H%j$N%5%$%:$K4X$o$i(B | |
334 $B$:!$%9%F!<%?%9<hF@$r$[$\=V;~$K9T$&$3$H$,$G$-$k!%(B | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
335 |
357 | 336 %If you like, you can manually start a status daemon using the |
337 %\hgxcmd{inotify}{inserve} command. This gives you slightly finer | |
338 %control over how the daemon ought to run. This command will of course | |
339 %only be available when the \hgext{inotify} extension is enabled. | |
340 | |
341 \hgxcmd{inotify}{inserve}$B%3%^%s%I$r;H$C$F%9%F!<%?%9%G!<%b%s$r<jF0$G<B9T$9(B | |
342 $B$k$3$H$b2DG=$G$"$k!%$3$l$K$h$j!$%G!<%b%s$,$I$N$h$&$KF0:n$9$k$N$+$r$d$d:Y(B | |
343 $B$+$/%3%s%H%m!<%k$9$k$3$H$,$G$-$k!%EvA3$J$,$i!$$3$N%3%^%s%I$O(B | |
344 \hgext{inotify}$B$,M-8z$N>l9g$N$_MxMQ2DG=$G$"$k!%(B | |
345 | |
224
34943a3d50d6
Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents:
223
diff
changeset
|
346 |
357 | 347 %When you're using the \hgext{inotify} extension, you should notice |
348 %\emph{no difference at all} in Mercurial's behaviour, with the sole | |
349 %exception of status-related commands running a whole lot faster than | |
350 %they used to. You should specifically expect that commands will not | |
351 %print different output; neither should they give different results. | |
352 %If either of these situations occurs, please report a bug. | |
353 | |
354 \hgext{inotify}$B3HD%$r;H$C$F$$$k;~$O(BMercurial$B$N(B\emph{$BA4$/JQ2=$J$7(B}$B$H$$$&F0(B | |
355 $B:n$K5$IU$/$@$m$&!%%9%F!<%?%9$K4X78$9$k%3%^%s%I$O0JA0$h$j$:$C$H9bB.$K$J$C(B | |
356 $B$F$$$k$H$$$&0l$D$NNc30$r=|$$$F%3%^%s%I$OFCJL$N=PNO$b7k2L$b=PNO$7$J$$$3$H(B | |
357 $B$KN10U$5$l$?$$!%2?$+FCJL$J$3$H$,5/$-$?$i%P%0$H$7$FJs9p$7$FM_$7$$!%(B | |
223
4c9b9416cd23
Skeleton for chapter on extensions.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
358 |
355 | 359 %\section{Flexible diff support with the \hgext{extdiff} extension} |
360 \section{\hgext{extdiff}$B3HD%$K$h$k=@Fp$J(Bdiff$B%5%]!<%H(B} | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
361 \label{sec:hgext:extdiff} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
362 |
358 | 363 %Mercurial's built-in \hgcmd{diff} command outputs plaintext unified |
364 %diffs. | |
365 %\interaction{extdiff.diff} | |
366 %If you would like to use an external tool to display modifications, | |
367 %you'll want to use the \hgext{extdiff} extension. This will let you | |
368 %use, for example, a graphical diff tool. | |
369 | |
370 Mercurial$B$N%S%k%H%$%s%3%^%s%I(B\hgcmd{diff}$B$O(Bunified$B7A<0$N(Bdiff$B$r%W%l!<%s%F(B | |
371 $B%-%9%H$G=PNO$9$k!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
372 \interaction{extdiff.diff} |
358 | 373 $BJQ99$r30It%D!<%k$r;H$C$FI=<($7$?$$$J$i$P!$(B\hgext{extdiff}$B3HD%$r;H$&$HNI(B |
374 $B$$!%$3$N3HD%$ONc$($P%0%i%U%#%+%k$J(Bdiff$BI=<($r9T$&!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
375 |
358 | 376 %The \hgext{extdiff} extension is bundled with Mercurial, so it's easy |
377 %to set up. In the \rcsection{extensions} section of your \hgrc, | |
378 %simply add a one-line entry to enable the extension. | |
379 | |
380 \hgext{extdiff}$B3HD%$O(BMercurial$B$KF1:-$5$l$F$$$k$N$G!$%;%C%H%"%C%W$OMF0W$G(B | |
381 $B$"$k!%(B\hgrc $B$NCf$N(B\rcsection{extensions}$B%;%/%7%g%s$K(B1$B9T$N@_Dj$rDI2C$9$k(B | |
382 $B$@$1$GNI$$!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
383 \begin{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
384 [extensions] |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
385 extdiff = |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
386 \end{codesample2} |
358 | 387 |
388 %This introduces a command named \hgxcmd{extdiff}{extdiff}, which by | |
389 %default uses your system's \command{diff} command to generate a | |
390 %unified diff in the same form as the built-in \hgcmd{diff} command. | |
391 %\interaction{extdiff.extdiff} | |
392 %The result won't be exactly the same as with the built-in \hgcmd{diff} | |
393 %variations, because the output of \command{diff} varies from one | |
394 %system to another, even when passed the same options. | |
395 | |
396 $B$3$N3HD%$G(B\hgxcmd{extdiff}{extdiff}$B$H$$$&%3%^%s%I$,;H$($k$h$&$K$J$k!%(B | |
397 $B$3$N%3%^%s%I$O%7%9%F%`$N(B\command{diff}$B$r;H$C$FAH$_9~$_$N(B\hgcmd{diff}$B%3%^(B | |
398 $B%s%I$HF1MM$N(Bunified$B7A<0$N(Bdiff$B$r@8@.$9$k!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
399 \interaction{extdiff.extdiff} |
358 | 400 $BF@$i$l$k@.2LJ*$OAH$_9~$_$N(B\hgcmd{diff}$B$HA4$/F1$8$K$O$J$i$J$$$@$m$&!%M}M3(B |
401 $B$O(B\command{diff}$B%3%^%s%I$O%7%9%F%`Kh$K0[$J$j!$F1$8%*%W%7%g%s$rEO$7$F$bF1(B | |
402 $B$8=PNO$r$9$k$H$O8B$i$J$$$+$i$@!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
403 |
358 | 404 %As the ``\texttt{making snapshot}'' lines of output above imply, the |
405 %\hgxcmd{extdiff}{extdiff} command works by creating two snapshots of | |
406 %your source tree. The first snapshot is of the source revision; the | |
407 %second, of the target revision or working directory. The | |
408 %\hgxcmd{extdiff}{extdiff} command generates these snapshots in a | |
409 %temporary directory, passes the name of each directory to an external | |
410 %diff viewer, then deletes the temporary directory. For efficiency, it | |
411 %only snapshots the directories and files that have changed between the | |
412 %two revisions. | |
413 | |
414 $B=PNO$N(B``\texttt{making snapshot}''$B9T$,<gD%$9$k$h$&(B | |
415 $B$K!$(B\hgxcmd{extdiff}{extdiff}$B%3%^%s%I$O%=!<%9%D%j!<$N(B2$B$D$N%9%J%C%W%7%g%C(B | |
416 $B%H$r:n$k$h$&$KF/$/!%(B 1$B$DL\$N%9%J%C%W%7%g%C%H$O%=!<%9%j%S%8%g%s$G!$(B2$B$DL\$O(B | |
417 $B%o!<%-%s%0%G%#%l%/%H%j$N%?!<%2%C%H%j%S%8%g%s$G$"$k!%(B | |
418 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$O$3$l$i$N%9%J%C%W%7%g%C%H$r%F%s%]%i%j%G%#(B | |
419 $B%l%/%H%j$K:n$j!$30It(Bdiff$B%S%e!<%"$K$=$l$>$l$N%G%#%l%/%H%j$NL>A0$rEO$9!%$=(B | |
420 $B$N8e!$%F%s%]%i%j%G%#%l%/%H%j$r>C5n$9$k!%8zN($N$?$a$K(B2$B$D$N%j%S%8%g%s4V$GJQ(B | |
421 $B99$N$"$C$?%G%#%l%/%H%j$H%U%!%$%k$N%9%J%C%W%7%g%C%H$@$1$r<h$k!%(B | |
422 | |
423 %Snapshot directory names have the same base name as your repository. | |
424 %If your repository path is \dirname{/quux/bar/foo}, then \dirname{foo} | |
425 %will be the name of each snapshot directory. Each snapshot directory | |
426 %name has its changeset ID appended, if appropriate. If a snapshot is | |
427 %of revision \texttt{a631aca1083f}, the directory will be named | |
428 %\dirname{foo.a631aca1083f}. A snapshot of the working directory won't | |
429 %have a changeset ID appended, so it would just be \dirname{foo} in | |
430 | |
431 %this example. To see what this looks like in practice, look again at | |
432 %the \hgxcmd{extdiff}{extdiff} example above. Notice that the diff has | |
433 %the snapshot directory names embedded in its header. | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
434 |
358 | 435 $B%9%J%C%W%7%g%C%H%G%#%l%/%H%j$NL>A0$O%j%]%8%H%j$HF1$8%Y!<%9%M!<%`$r;}$D!%(B |
436 $B%j%]%8%H%j$N%Q%9$,(B\dirname{/quux/bar/foo}$B$J$i$P!$(B\dirname{foo}$B$,%9%J%C%W(B | |
437 $B%7%g%C%H%G%#%l%/%H%j$N%Y!<%9%M!<%`$K$J$j!$$3$3$K%A%'%s%8%;%C%H(BID$B$,IU2C$5(B | |
438 $B$l$k!%%9%J%C%W%7%g%C%H$N%j%S%8%g%s$,(B\texttt{a631aca1083f}$B$J$i!$%G%#%l%/%H(B | |
439 $B%j$O(B\dirname{foo.a631aca1083f}$B$H$J$k!%%o!<%-%s%0%G%#%l%/%H%j$N%9%J%C%W(B | |
440 $B%7%g%C%H$O%A%'%s%8%;%C%H(BID$B$r;}$?$J$$$N$G!$$3$NNc$G$O(B\dirname{foo}$B$H$$$&L>(B | |
441 $BA0$K$J$k!%<B:]$NF0:n$r8+$k$K$O!$>e5-$N(B\hgxcmd{extdiff}{extdiff}$B$r;2>H$5$l(B | |
442 $B$?$$!%(B diff$B$N%X%C%@$K$O%9%J%C%W%7%g%C%H%G%#%l%/%H%jL>$,Kd$a9~$^$l$F$$$kE@(B | |
443 $B$KN10U$5$l$?$$!%(B | |
444 | |
445 %The \hgxcmd{extdiff}{extdiff} command accepts two important options. | |
446 %The \hgxopt{extdiff}{extdiff}{-p} option lets you choose a program to | |
447 %view differences with, instead of \command{diff}. With the | |
448 %\hgxopt{extdiff}{extdiff}{-o} option, you can change the options that | |
449 %\hgxcmd{extdiff}{extdiff} passes to the program (by default, these | |
450 %options are ``\texttt{-Npru}'', which only make sense if you're | |
451 %running \command{diff}). In other respects, the | |
452 %\hgxcmd{extdiff}{extdiff} command acts similarly to the built-in | |
453 %\hgcmd{diff} command: you use the same option names, syntax, and | |
454 %arguments to specify the revisions you want, the files you want, and | |
455 %so on. | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
456 |
358 | 457 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$K$O=EMW$J%*%W%7%g%s$,(B2$B$D$"$k!%(B |
458 \hgxopt{extdiff}{extdiff}{-p}$B%*%W%7%g%s$G:9J,$r<h$k%3%^%s%I$H$7$F(B | |
459 \command{diff}$B0J30$N%3%^%s%I$r;XDj$G$-$k!%(B \hgxopt{extdiff}{extdiff}{-o} | |
460 $B%*%W%7%g%s$G(B\hgxcmd{extdiff}{extdiff}$B$,30It%W%m%0%i%`$KEO$9%*%W%7%g%s$rJQ(B | |
461 $B99$9$k$3$H$,$G$-$k!%!J%G%U%)%k%H$G$O(B``\texttt{-Npru}''$B$,EO$5$l$k!%$3$l$O(B | |
462 \command{diff}$B$,5/F0$5$l$k;~$N$_0UL#$r;}$D!%!K$=$NB>$NE@$G$O(B | |
463 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$O%S%k%H%$%s$N(B\hgcmd{diff}$B$HF1MM$NF0:n$r(B | |
464 $B$9$k!%$9$J$o$A!$F1$8%*%W%7%g%sL>!$J8K!!$%j%S%8%g%s$d%U%!%$%k$r;XDj$9$k=q(B | |
465 $B<0$J$I$r;}$D!%(B | |
466 | |
467 %As an example, here's how to run the normal system \command{diff} | |
468 %command, getting it to generate context diffs (using the | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
469 |
358 | 470 %\cmdopt{diff}{-c} option) instead of unified diffs, and five lines of |
471 %context instead of the default three (passing \texttt{5} as the | |
472 %argument to the \cmdopt{diff}{-C} option). | |
473 %\interaction{extdiff.extdiff-ctx} | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
474 |
358 | 475 $B$3$3$G%7%9%F%`$NDL>o%3%^%s%I$N(B\command{diff}$B$r!$(Bunified diff$B7A<0$G$O$J(B |
476 $B$/!$!J(B\cmdopt{diff}{-c}$B%*%W%7%g%s$r;H$C$F!K(Bcontext diff$B7A<0$r=PNO$5$;$kNc(B | |
477 $B$r8+$F$_$h$&!%(Bcontext diff$B$K4^$^$l$k%3%s%F%-%9%H$N9T?t$b%G%U%)%k%H$N(B3$B9T$G(B | |
478 $B$O$J$/!$!J(B\cmdopt{diff}{-C}$B$X(B\texttt{5}$B%*%W%7%g%s$rEO$7$F!K(B5$B9T=PNO$5$;$k(B | |
479 $B$h$&$K$9$k!%(B | |
480 | |
481 %Launching a visual diff tool is just as easy. Here's how to launch | |
482 %the \command{kdiff3} viewer. | |
483 $B%S%8%e%"%k(Bdiff$B%D!<%k$N5/F0$O$?$d$9$$!%$3$3$G$O(B\command{kdiff3}$B%S%e!<%"$N(B | |
484 $B5/F0J}K!$r<($9!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
485 \begin{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
486 hg extdiff -p kdiff3 -o '' |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
487 \end{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
488 |
358 | 489 %If your diff viewing command can't deal with directories, you can |
490 %easily work around this with a little scripting. For an example of | |
491 %such scripting in action with the \hgext{mq} extension and the | |
492 %\command{interdiff} command, see | |
493 %section~\ref{mq-collab:tips:interdiff}. | |
494 | |
495 $BMxMQ$7$h$&$H$9$k(Bdiff$B%S%e!<%3%^%s%I$,%G%#%l%/%H%j$r07$($J$$>l9g!$$o$:$+$J(B | |
496 $B%9%/%j%W%H$r=q$/$3$H$G4JC1$K$3$NLdBj$r2sHr$9$k$3$H$,$G$-$k!%<B:]$K;H$o$l(B | |
497 $B$F$$$k%9%/%j%W%HNc$H$7$F$O!$(B\hgext{mq}$B3HD%$H(B\command{interdiff}$B%3%^%s%I$N(B | |
498 $B4V$N$b$N$,$"$k!%$3$l$K$D$$$F$O(B\ref{mq-collab:tips:interdiff}$B$r;2>H$5$l$?(B | |
499 $B$$!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
500 |
355 | 501 %\subsection{Defining command aliases} |
502 \subsection{$B%3%^%s%I$N%(%$%j%"%9$r:n$k(B} | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
503 |
359 | 504 %It can be cumbersome to remember the options to both the |
505 %\hgxcmd{extdiff}{extdiff} command and the diff viewer you want to use, | |
506 %so the \hgext{extdiff} extension lets you define \emph{new} commands | |
507 %that will invoke your diff viewer with exactly the right options. | |
508 | |
509 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$H(Bdiff$B%S%e!<%"APJ}$N%*%W%7%g%s$r3P$($F$*(B | |
510 $B$/$N$OLq2p$J$?$a!$(B\hgext{extdiff}$B3HD%$G(Bdiff$B%S%e!<%"$r@5$7$$%*%W%7%g%s$G5/(B | |
511 $BF0$9$k(B\emph{$B?7$7$$(B}$B%3%^%s%I$rDj5A$9$k$3$H$,$G$-$k!%(B | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
512 |
359 | 513 %All you need to do is edit your \hgrc, and add a section named |
514 %\rcsection{extdiff}. Inside this section, you can define multiple | |
515 %commands. Here's how to add a \texttt{kdiff3} command. Once you've | |
516 %defined this, you can type ``\texttt{hg kdiff3}'' and the | |
517 %\hgext{extdiff} extension will run \command{kdiff3} for you. | |
518 | |
519 $B$3$N$?$a$K$O(B\hgrc $B$rJT=8$7(B\rcsection{extdiff}$B$H$$$&L>A0$N?7$7$$%;%/%7%g%s(B | |
520 $B$rDI2C$9$l$P$h$$!%$3$N%;%/%7%g%sFb$G$OJ#?t$N%3%^%s%I$rDj5A$9$k$3$H$,$G$-(B | |
521 $B$k!%(B\texttt{kdiff3}$B%3%^%s%I$rDI2C$9$kJ}K!$rNc$H$7$F<($9!%0lEYDj5A$r9T$((B | |
522 $B$P!$(B``\texttt{hg kdiff3}''$B$H%?%$%W$9$k$3$H$G(B\hgext{extdiff}$B3HD%$,(B | |
523 \command{kdiff3}$B$r<B9T$9$k!%(B | |
524 | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
525 \begin{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
526 [extdiff] |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
527 cmd.kdiff3 = |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
528 \end{codesample2} |
359 | 529 |
530 %If you leave the right hand side of the definition empty, as above, | |
531 %the \hgext{extdiff} extension uses the name of the command you defined | |
532 %as the name of the external program to run. But these names don't | |
533 %have to be the same. Here, we define a command named ``\texttt{hg | |
534 % wibble}'', which runs \command{kdiff3}. | |
535 | |
536 $B>e$NNc$N$h$&$K1&JU$r6u$K$7$F$*$/$H!$(B\hgext{extdiff}$B3HD%$O30It$G5/F0$9$Y$-(B | |
537 $B%3%^%s%IL>$H$7$FDj5A$rMQ$$$k!%$3$NL>A0$O=EJ#$7$F$O$J$i$J$$!%$3$3$G$O(B | |
538 ``\texttt{hg wibble}''$B$H$$$&L>A0$G%3%^%s%I(B\command{kdiff3}$B$r8F$S=P$9$rDj(B | |
539 $B5A$7$F$$$k!%(B | |
540 | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
541 \begin{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
542 [extdiff] |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
543 cmd.wibble = kdiff3 |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
544 \end{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
545 |
359 | 546 %You can also specify the default options that you want to invoke your |
547 %diff viewing program with. The prefix to use is ``\texttt{opts.}'', | |
548 %followed by the name of the command to which the options apply. This | |
549 %example defines a ``\texttt{hg vimdiff}'' command that runs the | |
550 %\command{vim} editor's \texttt{DirDiff} extension. | |
551 | |
552 diff$B%S%e!<%"$r5/F0$9$k:]$N%G%U%)%k%H%*%W%7%g%s$bDj5A$G$-$k!%Dj5A$G$O%*%W(B | |
553 $B%7%g%s$rDj5A$7$?$$%3%^%s%I$NA0$K(B``\texttt{opts.}''$B$H$$$&@\F,<-$rIU$1$k!%(B | |
554 $B$3$NNc$G$O(B\command{vim}$B%(%G%#%?$r(B\texttt{DirDiff}$B%*%W%7%g%sIU$-$G5/F0$9$k(B | |
555 ``\texttt{hg vimdiff}''$B%3%^%s%I$rDj5A$7$F$$$k!%(B | |
556 | |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
557 \begin{codesample2} |
355 | 558 [extdiff] |
226
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
559 cmd.vimdiff = vim |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
560 opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)' |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
561 \end{codesample2} |
eef2171243e8
Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
224
diff
changeset
|
562 |
355 | 563 %\section{Cherrypicking changes with the \hgext{transplant} extension} |
564 \section{\hgext{transplant}$B3HD%$rMQ$$$?%A%'%j!<%T%C%-%s%099?7(B} | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
565 \label{sec:hgext:transplant} |
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
566 |
355 | 567 %Need to have a long chat with Brendan about this. |
568 $B!J(BBrendan$B$H$h$/OC$r$9$kI,MW$,$"$k!%!K(B | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
569 |
355 | 570 %\section{Send changes via email with the \hgext{patchbomb} extension} |
571 \section{\hgext{patchbomb}$B3HD%$K$h$C$FJQ99$r%a!<%k$9$k(B} | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
572 \label{sec:hgext:patchbomb} |
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
573 |
359 | 574 %Many projects have a culture of ``change review'', in which people |
575 %send their modifications to a mailing list for others to read and | |
576 %comment on before they commit the final version to a shared | |
577 %repository. Some projects have people who act as gatekeepers; they | |
578 %apply changes from other people to a repository to which those others | |
579 %don't have access. | |
580 | |
581 $BB?$/$N%W%m%8%'%/%H$,(B``$B99?7$N%l%S%e!<(B''$B$NJ82=$r;}$C$F$$$k!%3+H/<T$?$A$O:G(B | |
582 $B=*%P!<%8%g%s$r6&M-%j%]%8%H%j$K%3%_%C%H$9$kA0$K!$%Q%C%A$r::FI<TC#$,$$$k%a!<(B | |
583 $B%j%s%0%j%9%H$XJQ99$rAw$j!$%A%'%C%/$d<u$1$?$j%3%a%s%H$rLc$C$?$j$9$k!%$$$/(B | |
584 $B$D$+$N%W%m%8%'%/%H$G$OLgHV$N$h$&$J?M!9$r;}$C$F$$$?$j$5$($9$k!%H`$i$N;E;v(B | |
585 $B$O!$?M!9$+$iAw$i$l$?JQ99$r!$H`$i0J30$K%"%/%;%98"$N$J$$%j%]%8%H%j$XE,MQ$9(B | |
586 $B$k$3$H$G$"$k!%(B | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
587 |
359 | 588 %Mercurial makes it easy to send changes over email for review or |
589 %application, via its \hgext{patchbomb} extension. The extension is so | |
590 %namd because changes are formatted as patches, and it's usual to send | |
591 %one changeset per email message. Sending a long series of changes by | |
592 %email is thus much like ``bombing'' the recipient's inbox, hence | |
593 %``patchbomb''. | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
594 |
359 | 595 Mercurial$B$G$O(B\hgext{patchbomb}$B3HD%$rMQ$$$k$H%l%S%e!<$dE,MQ$N$?$a$KJQ99$r(B |
596 $B%a!<%k$GAw?.$9$k$3$H$,MF0W$K$J$k!%$3$N3HD%$NL>A0$OJQ99$r%Q%C%A$H$7$F%U%)!<(B | |
597 $B%^%C%H$7!$(B1$B$D$N%A%'%s%8%;%C%HKh$K%a!<%k(B1$BDL$rAw?.$9$k$3$H$KM3Mh$9$k!%(B | |
598 $B0lO"$NJQ99$rO"B3$7$F%a!<%k$GAw?.$9$k$3$H$r(B``$BGz7b(B''$B$K8+N)$F$F$$$k!%=>$C$F(B | |
599 $B<u?.<T$,<u$1<h$k$N$O(B``$B%Q%C%AGzCF(B''$B$G$"$k!%(B | |
600 | |
601 %As usual, the basic configuration of the \hgext{patchbomb} extension | |
602 %takes just one or two lines in your \hgrc. | |
603 $BDL>o!$(B\hgext{patchbomb}$B3HD%$N4pK\@_Dj$O(B\hgrc $B$NCf$G(B1$B!$(B2$B9T$[$I$G$"$k!%(B | |
604 | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
605 \begin{codesample2} |
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
606 [extensions] |
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
607 patchbomb = |
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
608 \end{codesample2} |
359 | 609 %Once you've enabled the extension, you will have a new command |
610 %available, named \hgxcmd{patchbomb}{email}. | |
611 | |
612 $B3HD%$rM-8z$K$9$k$H!$(B\hgxcmd{patchbomb}{email}$B%3%^%s%I$,;H$($k$h$&$K$J$k!%(B | |
613 | |
614 %The safest and best way to invoke the \hgxcmd{patchbomb}{email} | |
615 %command is to \emph{always} run it first with the | |
616 %\hgxopt{patchbomb}{email}{-n} option. This will show you what the | |
617 %command \emph{would} send, without actually sending anything. Once | |
618 %you've had a quick glance over the changes and verified that you are | |
619 %sending the right ones, you can rerun the same command, with the | |
620 %\hgxopt{patchbomb}{email}{-n} option removed. | |
232
2469608b4a08
Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
231
diff
changeset
|
621 |
359 | 622 \hgxcmd{patchbomb}{email}$B$r5/F0$9$k$N$K:G$b0BA4$GNI$$J}K!$O!$$^$::G=i$K(B |
623 \hgxopt{patchbomb}{email}{-n}$B%*%W%7%g%s$rIU$1$F<B9T$7$F$_$k$3$H$@!%(B | |
624 $B$3$l$K$h$j!$<B:]$NAw?.$O9T$o$:$K2?$,5/$-$k$N$+$r8+$k$3$H$,$G$-$k!%JQ99$K(B | |
625 $BL\$rDL$7$F@5$7$$JQ99$rAw?.$9$k$3$H$r3NG'$G$-$?$i!$F1$8%3%^%s%I$r(B | |
626 \hgxopt{patchbomb}{email}{-n}$B%*%W%7%g%s$J$7$G<B9T$9$k!%(B | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
627 |
359 | 628 %The \hgxcmd{patchbomb}{email} command accepts the same kind of |
629 %revision syntax as every other Mercurial command. For example, this | |
630 %command will send every revision between 7 and \texttt{tip}, | |
631 %inclusive. | |
632 | |
633 \hgxcmd{patchbomb}{email}$B%3%^%s%I$OB>$N(BMercurial$B%3%^%s%I$HF1MM$N%j%S%8%g(B | |
634 $B%s;XDj9=J8$r<u$1IU$1$k!%Nc$($P%j%S%8%g%s(B7$B$+$i(Btip$B$^$G$r4^$`JQ99$rAw?.$9$k(B | |
635 $B$J$I$N$h$&$K;XDj$,2DG=$G$"$k!%(B | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
636 \begin{codesample2} |
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
637 hg email -n 7:tip |
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
638 \end{codesample2} |
359 | 639 |
640 %You can also specify a \emph{repository} to compare with. If you | |
641 %provide a repository but no revisions, the \hgxcmd{patchbomb}{email} | |
642 %command will send all revisions in the local repository that are not | |
643 | |
644 %present in the remote repository. If you additionally specify | |
645 %revisions or a branch name (the latter using the | |
646 %\hgxopt{patchbomb}{email}{-b} option), this will constrain the | |
647 %revisions sent. | |
648 | |
649 $BHf3SBP>]$H$7$F(B\emph{$B%j%]%8%H%j(B}$B$r;XDj$9$k$3$H$b$G$-$k!%%j%]%8%H%j$r;XDj(B | |
650 $B$7!$%j%S%8%g%s$r;XDj$7$J$$>l9g!$(B\hgxcmd{patchbomb}{email}$B$O%m!<%+%k%j%]%8(B | |
651 $B%H%j$K$"$C$F%j%b!<%H%j%]%8%H%j$K$J$$A4$F$N%P!<%8%g%s$rAw?.$9$k!%%j%S%8%g(B | |
652 $B%s$^$?$O%V%i%s%AL>$r;XDj$9$k$H!J8e<T$O(B\hgxopt{patchbomb}{email}{-b}$B$rMQ$$(B | |
653 $B$k!K!$Aw?.$5$l$k%j%S%8%g%s$K@)8B$,2C$o$k!%(B | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
654 |
359 | 655 %It's perfectly safe to run the \hgxcmd{patchbomb}{email} command |
656 %without the names of the people you want to send to: if you do this, | |
657 %it will just prompt you for those values interactively. (If you're | |
658 %using a Linux or Unix-like system, you should have enhanced | |
659 %\texttt{readline}-style editing capabilities when entering those | |
660 %headers, too, which is useful.) | |
661 | |
662 $BAw?.$7$?$$?MC#$NL>A0$r;XDj$;$:$K(B\hgxcmd{patchbomb}{email}$B%3%^%s%I$r;H$C$F(B | |
663 $B$bA4$/0BA4$G$"$k!%$3$N>l9g!$BPOCE*$KF~NO$r5a$a$k!%(BLinux$B$^$?$O(BUnix$B7O$N%7%9(B | |
664 $B%F%`$r;H$C$F$$$l$P!$%X%C%@$NF~NO$K;H$$$d$9$$(B\texttt{readline}$B%9%?%$%k$NJT(B | |
665 $B=85!G=$rMxMQ$G$-$k(B | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
666 |
359 | 667 %When you are sending just one revision, the \hgxcmd{patchbomb}{email} |
668 %command will by default use the first line of the changeset | |
669 %description as the subject of the single email message it sends. | |
670 | |
671 $B$?$@(B1$B$D$N%j%S%8%g%s$rAw$k>l9g!$(B\hgxcmd{patchbomb}{email}$B%3%^%s%I$O%G%U%)(B | |
672 $B%k%H$G%A%'%s%8%;%C%H$N@bL@$N:G=i$N9T$r%a!<%k$N7oL>$H$7$FMQ$$$k!%(B | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
673 |
359 | 674 %If you send multiple revisions, the \hgxcmd{patchbomb}{email} command |
675 %will usually send one message per changeset. It will preface the | |
676 %series with an introductory message, in which you should describe the | |
677 %purpose of the series of changes you're sending. | |
678 | |
679 $BJ#?t$N%j%S%8%g%s$rAw$k>l9g!$(B\hgxcmd{patchbomb}{email}$B%3%^%s%I$O(B1$B$D$N%A%'(B | |
680 $B%s%8%;%C%HKh$K(B1$BDL$N%a!<%k$rAw?.$9$k!%3+;O$N%a!<%k$K$O0lO"$NJQ99$NL\E*$r5-(B | |
681 $B=R$9$k@bL@J8$rIU$1$k!%(B | |
682 | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
683 |
355 | 684 %\subsection{Changing the behaviour of patchbombs} |
685 \subsection{patchbombs$B$N5sF0$rJQ99$9$k(B} | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
686 |
359 | 687 %Not every project has exactly the same conventions for sending changes |
688 %in email; the \hgext{patchbomb} extension tries to accommodate a | |
689 %number of variations through command line options. | |
690 | |
691 $BA4$F$N%W%m%8%'%/%H$,F1$8$h$&$J%a!<%k$K$h$kJQ99$NAwIU$N=,47$r;}$C$F$$$k$o(B | |
692 $B$1$G$O$J$$!%(B\hgext{patchbomb}$B3HD%$O%3%^%s%I%i%$%s%*%W%7%g%s$GMM!9$JJ}K!(B | |
693 $B$KBP1~$G$-$k$h$&$K$J$C$F$$$k!%(B | |
694 | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
695 \begin{itemize} |
359 | 696 %\item You can write a subject for the introductory message on the |
697 % command line using the \hgxopt{patchbomb}{email}{-s} option. This | |
698 % takes one argument, the text of the subject to use. | |
699 \item $B%3%^%s%I%i%$%s$+$i(B\hgxopt{patchbomb}{email}{-s}$B%*%W%7%g%s$r;H$C(B | |
700 $B$F!$@bL@J8$K$J$k7oL>$rF~NO$9$k$3$H$,$G$-$k!%$3$N%*%W%7%g%s$O7oL>$H(B | |
701 $B$7$F;H$o$l$k%F%-%9%H$r0z?t$H$7$F<h$k!%(B | |
702 | |
703 %\item To change the email address from which the messages originate, | |
704 % use the \hgxopt{patchbomb}{email}{-f} option. This takes one | |
705 % argument, the email address to use. | |
706 \item $B%a%C%;!<%8$NAw?.85$N%"%I%l%9$rJQ99$9$k$K$O(B | |
707 \hgxopt{patchbomb}{email}{-f}$B%*%W%7%g%s$rMQ$$$k!%$3$N%*%W%7%g%s$O(B | |
708 $B%a!<%k%"%I%l%9$r0z?t$H$7$F<h$k!%(B | |
709 | |
710 %\item The default behaviour is to send unified diffs (see | |
711 % section~\ref{sec:mq:patch} for a description of the format), one per | |
712 % message. You can send a binary bundle instead with the | |
713 % \hgxopt{patchbomb}{email}{-b} option. | |
714 \item $B%G%U%)%k%H$G$O(B1$B%a%C%;!<%8Kh$K(Bunified$B7A<0(Bdiff$B$rAw?.$9$k!%!J$3$N%U%)!<(B | |
715 $B%^%C%H$K$D$$$F$O(B\ref{sec:mq:patch}$B$r;2(B | |
716 $B>H!%!K(B\hgxopt{patchbomb}{email}{-b}$B%*%W%7%g%s$r;H$($P!$%P%$%J%j7A(B | |
717 $B<0$N%G!<%?$rE:IU$9$k$3$H$b$G$-$k!%(B | |
718 | |
719 %\item Unified diffs are normally prefaced with a metadata header. You | |
720 % can omit this, and send unadorned diffs, with the | |
721 % \hgxopt{patchbomb}{email}{--plain} option. | |
722 \item unified$B7A<0(Bdiff$B$ODL>o%a%?%G!<%?$N%X%C%@$r;}(B | |
723 $B$D!%(B\hgxopt{patchbomb}{email}{--plain}$B%*%W%7%g%s$r;H$&$3$H$G$3$l(B | |
724 $B$r3d0&$9$k$3$H$,$G$-$k!%(B | |
725 | |
726 %\item Diffs are normally sent ``inline'', in the same body part as the | |
727 % description of a patch. This makes it easiest for the largest | |
728 % number of readers to quote and respond to parts of a diff, as some | |
729 % mail clients will only quote the first MIME body part in a message. | |
730 % If you'd prefer to send the description and the diff in separate | |
731 % body parts, use the \hgxopt{patchbomb}{email}{-a} option. | |
732 \item $BDL>o!$:9J,$O%Q%C%A$N@bL@$HF1$8%\%G%#$NCf$K(B``$B%$%s%i%$%s(B''$B$G=q$-9~$^(B | |
733 $B$l$k!%$$$/$D$+$N%a!<%k%/%i%$%"%s%H$G$O:G=i$N(BMIME$B%Q!<%H$N$_$+$i0zMQ(B | |
734 $B$,2DG=$J$?$a!$$3$&$9$k$3$H$,:G$bB?$/$N?M$K$H$C$F%Q%C%A$NFCDj$NItJ,(B | |
735 $B$K%3%a%s%H$7$?$j$9$k$N$K9%ET9g$G$"$k!%@bL@J8$H(Bdiff$B$rJL$N%\%G%#%Q!<(B | |
736 $B%H$K$7$FAw?.$7$?$$>l9g$O(B\hgxopt{patchbomb}{email}{-a}$B%*%W%7%g%s$r(B | |
737 $B;H$&!%(B | |
738 | |
739 %\item Instead of sending mail messages, you can write them to an | |
740 % \texttt{mbox}-format mail folder using the | |
741 % \hgxopt{patchbomb}{email}{-m} option. That option takes one | |
742 % argument, the name of the file to write to. | |
743 \item $B%a!<%k$G%a%C%;!<%8$rAw?.$9$kJQ$o$j(B | |
744 $B$K!$(B\hgxopt{patchbomb}{email}{-m}$B%*%W%7%g%s$r;H$C$F(B | |
745 \texttt{mbox}$B%U%)!<%^%C%H$G=PNO$5$;$k$3$H$b2DG=$@!%(B | |
746 $B$3$N%*%W%7%g%s$O=PNO%U%!%$%kL>$r0l$D%*%W%7%g%s$H$7$F<h$k!%(B | |
747 | |
748 %\item If you would like to add a \command{diffstat}-format summary to | |
749 % each patch, and one to the introductory message, use the | |
750 % \hgxopt{patchbomb}{email}{-d} option. The \command{diffstat} | |
751 % command displays a table containing the name of each file patched, | |
752 % the number of lines affected, and a histogram showing how much each | |
753 % file is modified. This gives readers a qualitative glance at how | |
754 % complex a patch is. | |
755 \item \command{diffstat}$B%U%)!<%^%C%H$N%5%^%j$r3F!9$N%Q%C%A$KIU$1!$@bL@J8(B | |
756 $B$rIU$1$?$$>l9g$O!$(B\hgxopt{patchbomb}{email}{-d}$B%*%W%7%g%s$r;H$&$H(B | |
757 $BNI$$!%(B\command{diffstat}$B%3%^%s%I$O%Q%C%A$5$l$?3F!9$N%U%!%$%kL>!$1F(B | |
758 $B6A$r<u$1$?9T?t!$3F%U%!%$%k$,$I$l$@$1JQ99$5$l$?$+$r<($9%R%9%H%0%i%`(B | |
759 $B$r$r4^$`%F!<%V%k$rI=<($9$k!%$3$N>pJs$O!$%Q%C%A$NJ#;($5$K$D$$$FDj@-(B | |
760 $BE*$JM}2r$rF@$k$N$KLrN)$D!%(B | |
761 | |
243
7df934d3dcb5
Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
241
diff
changeset
|
762 \end{itemize} |
231
28ddbf9f3729
Use new \hgxcmd and \hgxopt commands in a few places.
Bryan O'Sullivan <bos@serpentine.com>
parents:
226
diff
changeset
|
763 |
355 | 764 %%% Local Variables: |
293
3b1291f24c0d
- replaved latex-mode to yatex-mode
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
290
diff
changeset
|
765 %%% mode: yatex |
223
4c9b9416cd23
Skeleton for chapter on extensions.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
766 %%% TeX-master: "00book" |
355 | 767 %%% End: |