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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
355
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
1 %\chapter{Adding functionality with extensions}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
5 %While the core of Mercurial is quite complete from a functionality
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
6 %standpoint, it's deliberately shorn of fancy features. This approach
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
7 %of preserving simplicity keeps the software easy to deal with for both
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
8 %maintainers and users.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
9
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
10 $B5!G=$N4QE@$+$i8+$k$H(BMercurial$B$O$+$J$j40Hw$7$F$$$k$,!$GI<j$J5!G=$K$D$$$F$O(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
14 %However, Mercurial doesn't box you in with an inflexible command set:
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
15 %you can add features to it as \emph{extensions} (sometimes known as
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
16 %\emph{plugins}). We've already discussed a few of these extensions in
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
17 %earlier chapters.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
18
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
22 $B$$$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
23
224
34943a3d50d6 Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents: 223
diff changeset
24 \begin{itemize}
355
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
25 %\item Section~\ref{sec:tour-merge:fetch} covers the \hgext{fetch}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
26 % extension; this combines pulling new changes and merging them with
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
27 % local changes into a single command, \hgxcmd{fetch}{fetch}.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
29 $B$r%+%P!<$7$F$$$k!%$3$l$O?7$7$$JQ99$r(Bpull$B$7!$%m!<%+%k$JJQ99$H%^!<%8(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
30 $B$rC10l$N%3%^%s%I(B\hgxcmd{fetch}{fetch}$B$G<B9T$9$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
31 %\item In chapter~\ref{chap:hook}, we covered several extensions that
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
32 % are useful for hook-related functionality: \hgext{acl} adds access
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
33 % control lists; \hgext{bugzilla} adds integration with the Bugzilla
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
34 % bug tracking system; and \hgext{notify} sends notification emails on
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
35 % new changes.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
36 \item \ref{chap:hook}$B$G$O!$%U%C%/$K4XO"$7$?$$$/$D$+$N3HD%$K$D$$$F07$&!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
37 \hgext{acl}$B$O%"%/%;%9@)8f%j%9%H$rDI2C$9$k!%(B\hgext{bugzilla}$B$O(BBugzilla$B5!G=(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
38 $B$NE}9g5!G=$rDs6!$9$k!%(B\hgext{notify}$B$O!$?7$?$JJQ99$N:]$KDLCNEE;R%a!<%k$r(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
39 $BAw$k5!G=$rDs6!$9$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
40 %\item The Mercurial Queues patch management extension is so invaluable
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
41 % that it merits two chapters and an appendix all to itself.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
42 % Chapter~\ref{chap:mq} covers the basics;
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
43 % chapter~\ref{chap:mq-collab} discusses advanced topics; and
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
44 % appendix~\ref{chap:mqref} goes into detail on each command.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
45 \item Mercurial Queue$B$H$$$&%Q%C%A%^%M!<%8%a%s%H3HD%$O!$Hs>o$K=EMW$J$N$G(B2
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
46 $B>O$HIUO?(B1$B>O$rHq$d$7$F@bL@$9$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
47 Chapter~\ref{chap:mq}$B$O4pK\E*$J5!G=$r@bL@$9$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
48 chapter~\ref{chap:mq-collab}$B$G$O9bEY$J5!G=$K$D$$$F@bL@$7!$(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
52 %In this chapter, we'll cover some of the other extensions that are
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
53 %available for Mercurial, and briefly touch on some of the machinery
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
54 %you'll need to know about if you want to write an extension of your
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
55 %own.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
56 $B$3$N>O$G$O(BMercurial$B$GMxMQ2DG=$J$=$NB>$N3HD%$K$D$$$F<h$j07$$!$$^$?<+J,$G(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
59 %\item In section~\ref{sec:hgext:inotify}, we'll discuss the
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
60 % possibility of \emph{huge} performance improvements using the
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
61 % \hgext{inotify} extension.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
62 \item \ref{sec:hgext:inotify}$B@a$G$O(B\hgext{inotify}$B3HD%$rMQ$$$k$3$H$GF@$i(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
66 %\section{Improve performance with the \hgext{inotify} extension}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
70 %Are you interested in having some of the most common Mercurial
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
71 %operations run as much as a hundred times faster? Read on!
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
72 Mercurial$B$N:G$bB?MQ$5$l$k%3%^%s%I$N$$$/$D$+$,?tI4G\B.$/$J$k$3$H$K6=L#$,$"(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
73 $B$k$J$i$P$<$RFI$s$GM_$7$$!*(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
74
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
75 %Mercurial has great performance under normal circumstances. For
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
76 %example, when you run the \hgcmd{status} command, Mercurial has to
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
77 %scan almost every directory and file in your repository so that it can
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
78 %display file status. Many other Mercurial commands need to do the
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
79 %same work behind the scenes; for example, the \hgcmd{diff} command
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
80 %uses the status machinery to avoid doing an expensive comparison
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
83 $BDL>o$N>r7o2<$G(BMercurial$B$O9b$$@-G=$r;}$C$F$$$k$,!$(B \hgcmd{status}$B%3%^%s%I(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
87 $B$l$F$$$J$$%U%!%$%k$NHf3S$rHr$1$F$$$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
88
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
89 %Because obtaining file status is crucial to good performance, the
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
90 %authors of Mercurial have optimised this code to within an inch of its
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
91 %life. However, there's no avoiding the fact that when you run
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
92 %\hgcmd{status}, Mercurial is going to have to perform at least one
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
93 %expensive system call for each managed file to determine whether it's
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
94 %changed since the last time Mercurial checked. For a sufficiently
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
97 $BNI$$@-G=$rF@$k$?$a$K$O!$%U%!%$%k%9%F!<%?%9$N<hF@$,=EMW$J4X?4;v$H$J$k$?(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
99 \hgcmd{status}$B%3%^%s%I$G$O$3$l$rHr$1$k<jN)$F$,$J$$!%(B Mercurial$B$O!$4IM}$7(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
100 $B$F$$$k%U%!%$%k$,:G8e$K%A%'%C%/$7$?;~$+$iJQ99$5$l$F$$$k$+D4$Y$k$?$a$K!$>/(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
101 $B$J$/$H$b0l$D$N9b2A$J%7%9%F%`%3!<%k$r$9$kI,MW$,$"$k!%$"$kDxEY0J>eBg$-$J%j(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
102 $B%]%8%H%j$G$O!$$3$NA`:n$K$OD9$$;~4V$rMW$9$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
103
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
104 %To put a number on the magnitude of this effect, I created a
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
105 %repository containing 150,000 managed files. I timed \hgcmd{status}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
106 %as taking ten seconds to run, even when \emph{none} of those files had
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
107 %been modified.
224
34943a3d50d6 Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents: 223
diff changeset
108
355
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
110 $B$?!%(B\emph{$B$^$C$?$/(B}$BJQ99$,$J$$>l9g$G$b(B\hgcmd{status}$B%3%^%s%I$N<B9T$K$O(B10
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
113 %Many modern operating systems contain a file notification facility.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
114 %If a program signs up to an appropriate service, the operating system
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
115 %will notify it every time a file of interest is created, modified, or
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
116 %deleted. On Linux systems, the kernel component that does this is
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
117 %called \texttt{inotify}.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
118
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
119 $B6aG/$N%*%Z%l!<%F%#%s%0%7%9%F%`$O!$%U%!%$%kDLCN$N5!9=$rHw$($F$$$k!%%W%m%0(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
124 %Mercurial's \hgext{inotify} extension talks to the kernel's
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
125 %\texttt{inotify} component to optimise \hgcmd{status} commands. The
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
126 %extension has two components. A daemon sits in the background and
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
127 %receives notifications from the \texttt{inotify} subsystem. It also
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
128 %listens for connections from a regular Mercurial command. The
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
129 %extension modifies Mercurial's behaviour so that instead of scanning
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
130 %the filesystem, it queries the daemon. Since the daemon has perfect
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
131 %information about the state of the repository, it can respond with a
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
132 %result instantaneously, avoiding the need to scan every directory and
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
135 Mercurial$B$N(B\hgext{inotify}$B3HD%$O!$(B\hgcmd{status}$B%3%^%s%I$r:GE,2=$9$k$?$a(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
139 $B%^%s%I$+$i$N@\B3$b<u$1IU$1$k!%$3$N3HD%$O(BMercurial$B$N5sF0$rJQ99$7!$%U%!%$%k(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
143 $B$k$3$H$,$G$-$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
144
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
145 %Recall the ten seconds that I measured plain Mercurial as taking to
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
146 %run \hgcmd{status} on a 150,000 file repository. With the
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
147 %\hgext{inotify} extension enabled, the time dropped to 0.1~seconds, a
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
148 %factor of \emph{one hundred} faster.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
149
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
151 $B%j$KBP$7$F(B10$BIC$rMW$7$F$$$?$3$H$r;W$$=P$7$FM_$7$$!#(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
152 \hgext{inotify}$B3HD%$r;H$C$?>l9g!"=jMW;~4V$O(B0.1$BIC$K2<$,$j!$(B\emph{100}$BG\B.(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
155 %Before we continue, please pay attention to some caveats.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
158 %\item The \hgext{inotify} extension is Linux-specific. Because it
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
159 % interfaces directly to the Linux kernel's \texttt{inotify}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
160 % subsystem, it does not work on other operating systems.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
161 \item \hgext{inotify}$B3HD%$O(BLinux$BFCM-$N$b$N$G$"$k!%$3$N5!G=3HD%$O(BLinux$B$N(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
162 \texttt{inotify}$B%5%V%7%9%F%`$KD>@\%"%/%;%9$9$k$?$a!$B>$N%*%Z%l!<(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
163 $B%F%#%s%0%7%9%F%`$G$OF0:n$7$J$$!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
164
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
165 %\item It should work on any Linux distribution that was released after
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
166 % early~2005. Older distributions are likely to have a kernel that
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
167 % lacks \texttt{inotify}, or a version of \texttt{glibc} that does not
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
168 % have the necessary interfacing support.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
170 $B%s$G$bF0:n$9$k$O$:$@$,!$8E$$%G%#%9%H%j%S%e!<%7%g%s$G$O(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
171 \texttt{inotify}$B$r7g$$$F$$$?$j!$I,MW$J%$%s%?!<%U%'!<%9%5%]!<%H$r(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
172 \texttt{glibc}$B$,Ds6!$7$F$$$J$+$C$?$j$9$k2DG=@-$,$"$k!%(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
173
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
174 %\item Not all filesystems are suitable for use with the
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
175 % \hgext{inotify} extension. Network filesystems such as NFS are a
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
176 % non-starter, for example, particularly if you're running Mercurial
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
177
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
178 % on several systems, all mounting the same network filesystem. The
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
179 % kernel's \texttt{inotify} system has no way of knowing about changes
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
180 % made on another system. Most local filesystems (e.g.~ext3, XFS,
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
181 % ReiserFS) should work fine.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
182 \item $BA4$F$N%U%!%$%k%7%9%F%`$,(B\hgext{inotify}$B3HD%$GMxMQ2DG=$J$o$1$G$O$J(B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
183 $B$$!%Nc$((B
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
189 %The \hgext{inotify} extension is not yet shipped with Mercurial as of
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
190 %May~2007, so it's a little more involved to set up than other
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
191 %extensions. But the performance improvement is worth it!
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
192
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
193 2007$BG/(B5$B7n$^$G$O(B\hgext{inotify}$B3HD%$O(BMercurial$B$KF1:-$5$l$F$$$J$+$C$?!%$=$N(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
197 %The extension currently comes in two parts: a set of patches to the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
198 %Mercurial source code, and a library of Python bindings to the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
199 %\texttt{inotify} subsystem.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
200
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
203
224
34943a3d50d6 Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents: 223
diff changeset
204 \begin{note}
357
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
205 % There are \emph{two} Python \texttt{inotify} binding libraries. One
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
206 % of them is called \texttt{pyinotify}, and is packaged by some Linux
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
207 % distributions as \texttt{python-inotify}. This is \emph{not} the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
208 % one you'll need, as it is too buggy and inefficient to be practical.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
209
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
211 \texttt{pyinotify}$B$G$"$j!$$$$/$D$+$N(BLinux$B%G%#%9%H%j%S%e!<%7%g%s$G$O(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
215
357
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
216 %To get going, it's best to already have a functioning copy of
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
217 %Mercurial installed.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
219 $BK>$^$7$$!%(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
220
224
34943a3d50d6 Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents: 223
diff changeset
221 \begin{note}
357
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
222 % If you follow the instructions below, you'll be \emph{replacing} and
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
223 % overwriting any existing installation of Mercurial that you might
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
224 % already have, using the latest ``bleeding edge'' Mercurial code.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
225 % Don't say you weren't warned!
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
226 $B0J2<$N;X<($K=>$C$F%$%s%9%H!<%k$7$?(BMercurial$B$r!$:G?7$N(BMercurial$B%3!<%I$G(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
227 \emph{$BCV$-49$($k(B}$B$3$H$,$G$-$k!%!J7Y9p$5$l$J$+$C$?$H$O8@$o$J$$$3$H!K(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
231 %\item Clone the Python \texttt{inotify} binding repository. Build and
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
232 % install it.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
233 \item Python \texttt{inotify}$B%P%$%s%G%#%s%0$N%j%]%8%H%j$r%/%m!<%s$7!$%S(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
241 %\item Clone the \dirname{crew} Mercurial repository. Clone the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
242 % \hgext{inotify} patch repository so that Mercurial Queues will be
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
243 % able to apply patches to your cope of the \dirname{crew} repository.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
244 \item Merecurial$B$N(B\dirname{crew}$B%j%]%8%H%j$r%/%m!<%s$9(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
245 $B$k!%(B\hgext{inotify}$B%Q%C%A%j%]%8%H%j$r%/%m!<%s$7!$(BMercurial Queues
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
252 %\item Make sure that you have the Mercurial Queues extension,
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
253 % \hgext{mq}, enabled. If you've never used MQ, read
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
254 % section~\ref{sec:mq:start} to get started quickly.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
255
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
256 \item Mercurial Queues$B3HD%!J(B\hgext{mq}$B!K$,M-8z$K$J$C$F$$$k$3$H$r3NG'$9(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
258 $B$9$9$a$9$k!%(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
259
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
260 %\item Go into the \dirname{inotify} repo, and apply all of the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
261 % \hgext{inotify} patches using the \hgxopt{mq}{qpush}{-a} option to
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
262 % the \hgxcmd{mq}{qpush} command.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
263 \item \dirname{inotify}$B%j%]%8%H%j$X9T$-!$(B\hgxcmd{mq}{qpush}$B%3%^%s%I$K(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
265 $B$Y$FE,MQ$9$k!%(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
271 % If you get an error message from \hgxcmd{mq}{qpush}, you should not
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
272 % continue. Instead, ask for help.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
273
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
274 \hgxcmd{mq}{qpush}$B$G%(%i!<$,5/$-$?>l9g!$@h$X?J$^$:$K=u8@$r5a$a$FM_$7$$!%(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
275
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
276 %\item Build and install the patched version of Mercurial.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
283 %Once you've build a suitably patched version of Mercurial, all you
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
284 %need to do to enable the \hgext{inotify} extension is add an entry to
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
285 %your \hgrc.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
286
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
288 $BMQ$9$k$h$&$K(B\hgrc $B$r@_Dj$9$k$@$1$G$"$k!%(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
294 %When the \hgext{inotify} extension is enabled, Mercurial will
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
295 %automatically and transparently start the status daemon the first time
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
296 %you run a command that needs status in a repository. It runs one
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
297 %status daemon per repository.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
298
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
299 \hgext{inotify}$B$,M-8z$K$J$C$F$$$k$H!$(BMercurial$B$O%j%]%8%H%jFb$G%3%^%s%I$,(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
303 %The status daemon is started silently, and runs in the background. If
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
304 %you look at a list of running processes after you've enabled the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
305 %\hgext{inotify} extension and run a few commands in different
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
306 %repositories, you'll thus see a few \texttt{hg} processes sitting
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
307 %around, waiting for updates from the kernel and queries from
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
308 %Mercurial.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
309
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
310 $B%9%F!<%?%9%G!<%b%s$O2?$b=PNO$r9T$o$:!$%P%C%/%0%i%&%s%I$GF0:n$9(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
311 $B$k!%(B\hgext{inotify}$B3HD%$rM-8z$K$7$?8e$GJL$N%j%]%8%H%jFb$G$$$/$D$+%3%^%s%I(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
313 $B$,%+!<%M%k$+$i$N%"%C%W%G!<%H$H(BMercurial$B$+$i$NLd$$9g$o$;$rBT$C$F$$$k$N$,(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
316 %The first time you run a Mercurial command in a repository when you
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
317 %have the \hgext{inotify} extension enabled, it will run with about the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
318 %same performance as a normal Mercurial command. This is because the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
319 %status daemon needs to perform a normal status scan so that it has a
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
320 %baseline against which to apply later updates from the kernel.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
321 %However, \emph{every} subsequent command that does any kind of status
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
322 %check should be noticeably faster on repositories of even fairly
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
323 %modest size. Better yet, the bigger your repository is, the greater a
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
324 %performance advantage you'll see. The \hgext{inotify} daemon makes
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
325 %status operations almost instantaneous on repositories of all sizes!
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
326
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
327 \hgext{inotify}$B3HD%$rM-8z$K$7!$%j%]%8%H%jFb$G(BMercurial$B%3%^%s%I$r:G=i$K<B(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
328 $B9T$7$?;~$ODL>o$N(BMercurial$B%3%^%s%I$HF1MM$N@-G=$GF0$/!%%9%F!<%?%9%G!<%b%s$O(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
329 $BDL>o$N%9%F!<%?%9%9%-%c%s$r9T$$!$%+!<%M%k$+$i99?7$NDLCN$r<u$1$k$?$a$N%Y!<(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
336 %If you like, you can manually start a status daemon using the
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
337 %\hgxcmd{inotify}{inserve} command. This gives you slightly finer
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
338 %control over how the daemon ought to run. This command will of course
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
339 %only be available when the \hgext{inotify} extension is enabled.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
340
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
341 \hgxcmd{inotify}{inserve}$B%3%^%s%I$r;H$C$F%9%F!<%?%9%G!<%b%s$r<jF0$G<B9T$9(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
343 $B$+$/%3%s%H%m!<%k$9$k$3$H$,$G$-$k!%EvA3$J$,$i!$$3$N%3%^%s%I$O(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
344 \hgext{inotify}$B$,M-8z$N>l9g$N$_MxMQ2DG=$G$"$k!%(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
345
224
34943a3d50d6 Start writing up extensions. Begin with inotify.
Bryan O'Sullivan <bos@serpentine.com>
parents: 223
diff changeset
346
357
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
347 %When you're using the \hgext{inotify} extension, you should notice
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
348 %\emph{no difference at all} in Mercurial's behaviour, with the sole
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
349 %exception of status-related commands running a whole lot faster than
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
350 %they used to. You should specifically expect that commands will not
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
351 %print different output; neither should they give different results.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
352 %If either of these situations occurs, please report a bug.
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
353
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
354 \hgext{inotify}$B3HD%$r;H$C$F$$$k;~$O(BMercurial$B$N(B\emph{$BA4$/JQ2=$J$7(B}$B$H$$$&F0(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
355 $B:n$K5$IU$/$@$m$&!%%9%F!<%?%9$K4X78$9$k%3%^%s%I$O0JA0$h$j$:$C$H9bB.$K$J$C(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
356 $B$F$$$k$H$$$&0l$D$NNc30$r=|$$$F%3%^%s%I$OFCJL$N=PNO$b7k2L$b=PNO$7$J$$$3$H(B
ef197f25f11e more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 355
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
359 %\section{Flexible diff support with the \hgext{extdiff} extension}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
363 %Mercurial's built-in \hgcmd{diff} command outputs plaintext unified
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
364 %diffs.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
365 %\interaction{extdiff.diff}
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
366 %If you would like to use an external tool to display modifications,
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
367 %you'll want to use the \hgext{extdiff} extension. This will let you
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
368 %use, for example, a graphical diff tool.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
369
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
373 $BJQ99$r30It%D!<%k$r;H$C$FI=<($7$?$$$J$i$P!$(B\hgext{extdiff}$B3HD%$r;H$&$HNI(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
376 %The \hgext{extdiff} extension is bundled with Mercurial, so it's easy
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
377 %to set up. In the \rcsection{extensions} section of your \hgrc,
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
378 %simply add a one-line entry to enable the extension.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
379
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
380 \hgext{extdiff}$B3HD%$O(BMercurial$B$KF1:-$5$l$F$$$k$N$G!$%;%C%H%"%C%W$OMF0W$G(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
381 $B$"$k!%(B\hgrc $B$NCf$N(B\rcsection{extensions}$B%;%/%7%g%s$K(B1$B9T$N@_Dj$rDI2C$9$k(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
387
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
388 %This introduces a command named \hgxcmd{extdiff}{extdiff}, which by
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
389 %default uses your system's \command{diff} command to generate a
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
390 %unified diff in the same form as the built-in \hgcmd{diff} command.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
391 %\interaction{extdiff.extdiff}
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
392 %The result won't be exactly the same as with the built-in \hgcmd{diff}
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
393 %variations, because the output of \command{diff} varies from one
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
394 %system to another, even when passed the same options.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
395
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
396 $B$3$N3HD%$G(B\hgxcmd{extdiff}{extdiff}$B$H$$$&%3%^%s%I$,;H$($k$h$&$K$J$k!%(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
404 %As the ``\texttt{making snapshot}'' lines of output above imply, the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
405 %\hgxcmd{extdiff}{extdiff} command works by creating two snapshots of
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
406 %your source tree. The first snapshot is of the source revision; the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
407 %second, of the target revision or working directory. The
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
408 %\hgxcmd{extdiff}{extdiff} command generates these snapshots in a
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
409 %temporary directory, passes the name of each directory to an external
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
410 %diff viewer, then deletes the temporary directory. For efficiency, it
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
411 %only snapshots the directories and files that have changed between the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
412 %two revisions.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
413
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
414 $B=PNO$N(B``\texttt{making snapshot}''$B9T$,<gD%$9$k$h$&(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
417 $B%o!<%-%s%0%G%#%l%/%H%j$N%?!<%2%C%H%j%S%8%g%s$G$"$k!%(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
422
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
423 %Snapshot directory names have the same base name as your repository.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
424 %If your repository path is \dirname{/quux/bar/foo}, then \dirname{foo}
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
425 %will be the name of each snapshot directory. Each snapshot directory
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
426 %name has its changeset ID appended, if appropriate. If a snapshot is
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
427 %of revision \texttt{a631aca1083f}, the directory will be named
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
428 %\dirname{foo.a631aca1083f}. A snapshot of the working directory won't
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
429 %have a changeset ID appended, so it would just be \dirname{foo} in
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
430
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
431 %this example. To see what this looks like in practice, look again at
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
432 %the \hgxcmd{extdiff}{extdiff} example above. Notice that the diff has
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
443 $B$KN10U$5$l$?$$!%(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
444
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
445 %The \hgxcmd{extdiff}{extdiff} command accepts two important options.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
446 %The \hgxopt{extdiff}{extdiff}{-p} option lets you choose a program to
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
447 %view differences with, instead of \command{diff}. With the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
448 %\hgxopt{extdiff}{extdiff}{-o} option, you can change the options that
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
449 %\hgxcmd{extdiff}{extdiff} passes to the program (by default, these
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
450 %options are ``\texttt{-Npru}'', which only make sense if you're
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
451 %running \command{diff}). In other respects, the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
452 %\hgxcmd{extdiff}{extdiff} command acts similarly to the built-in
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
453 %\hgcmd{diff} command: you use the same option names, syntax, and
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
454 %arguments to specify the revisions you want, the files you want, and
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
455 %so on.
226
eef2171243e8 Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 224
diff changeset
456
358
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
457 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$K$O=EMW$J%*%W%7%g%s$,(B2$B$D$"$k!%(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
458 \hgxopt{extdiff}{extdiff}{-p}$B%*%W%7%g%s$G:9J,$r<h$k%3%^%s%I$H$7$F(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
459 \command{diff}$B0J30$N%3%^%s%I$r;XDj$G$-$k!%(B \hgxopt{extdiff}{extdiff}{-o}
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
462 \command{diff}$B$,5/F0$5$l$k;~$N$_0UL#$r;}$D!%!K$=$NB>$NE@$G$O(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
463 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$O%S%k%H%$%s$N(B\hgcmd{diff}$B$HF1MM$NF0:n$r(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
465 $B<0$J$I$r;}$D!%(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
466
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
467 %As an example, here's how to run the normal system \command{diff}
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
470 %\cmdopt{diff}{-c} option) instead of unified diffs, and five lines of
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
471 %context instead of the default three (passing \texttt{5} as the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
472 %argument to the \cmdopt{diff}{-C} option).
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
473 %\interaction{extdiff.extdiff-ctx}
226
eef2171243e8 Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 224
diff changeset
474
358
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
479 $B$h$&$K$9$k!%(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
480
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
481 %Launching a visual diff tool is just as easy. Here's how to launch
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
482 %the \command{kdiff3} viewer.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
489 %If your diff viewing command can't deal with directories, you can
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
490 %easily work around this with a little scripting. For an example of
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
491 %such scripting in action with the \hgext{mq} extension and the
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
492 %\command{interdiff} command, see
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
493 %section~\ref{mq-collab:tips:interdiff}.
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
494
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
495 $BMxMQ$7$h$&$H$9$k(Bdiff$B%S%e!<%3%^%s%I$,%G%#%l%/%H%j$r07$($J$$>l9g!$$o$:$+$J(B
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
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
1348ce7d2d77 more hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 357
diff changeset
499 $B$$!%(B
226
eef2171243e8 Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 224
diff changeset
500
355
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
501 %\subsection{Defining command aliases}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
504 %It can be cumbersome to remember the options to both the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
505 %\hgxcmd{extdiff}{extdiff} command and the diff viewer you want to use,
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
506 %so the \hgext{extdiff} extension lets you define \emph{new} commands
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
507 %that will invoke your diff viewer with exactly the right options.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
508
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
509 \hgxcmd{extdiff}{extdiff}$B%3%^%s%I$H(Bdiff$B%S%e!<%"APJ}$N%*%W%7%g%s$r3P$($F$*(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
510 $B$/$N$OLq2p$J$?$a!$(B\hgext{extdiff}$B3HD%$G(Bdiff$B%S%e!<%"$r@5$7$$%*%W%7%g%s$G5/(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
513 %All you need to do is edit your \hgrc, and add a section named
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
514 %\rcsection{extdiff}. Inside this section, you can define multiple
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
515 %commands. Here's how to add a \texttt{kdiff3} command. Once you've
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
516 %defined this, you can type ``\texttt{hg kdiff3}'' and the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
517 %\hgext{extdiff} extension will run \command{kdiff3} for you.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
518
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
521 $B$k!%(B\texttt{kdiff3}$B%3%^%s%I$rDI2C$9$kJ}K!$rNc$H$7$F<($9!%0lEYDj5A$r9T$((B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
522 $B$P!$(B``\texttt{hg kdiff3}''$B$H%?%$%W$9$k$3$H$G(B\hgext{extdiff}$B3HD%$,(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
523 \command{kdiff3}$B$r<B9T$9$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
529
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
530 %If you leave the right hand side of the definition empty, as above,
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
531 %the \hgext{extdiff} extension uses the name of the command you defined
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
532 %as the name of the external program to run. But these names don't
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
533 %have to be the same. Here, we define a command named ``\texttt{hg
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
534 % wibble}'', which runs \command{kdiff3}.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
535
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
536 $B>e$NNc$N$h$&$K1&JU$r6u$K$7$F$*$/$H!$(B\hgext{extdiff}$B3HD%$O30It$G5/F0$9$Y$-(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
538 ``\texttt{hg wibble}''$B$H$$$&L>A0$G%3%^%s%I(B\command{kdiff3}$B$r8F$S=P$9$rDj(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
539 $B5A$7$F$$$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
546 %You can also specify the default options that you want to invoke your
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
547 %diff viewing program with. The prefix to use is ``\texttt{opts.}'',
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
548 %followed by the name of the command to which the options apply. This
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
549 %example defines a ``\texttt{hg vimdiff}'' command that runs the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
550 %\command{vim} editor's \texttt{DirDiff} extension.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
551
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
553 $B%7%g%s$rDj5A$7$?$$%3%^%s%I$NA0$K(B``\texttt{opts.}''$B$H$$$&@\F,<-$rIU$1$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
555 ``\texttt{hg vimdiff}''$B%3%^%s%I$rDj5A$7$F$$$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
556
226
eef2171243e8 Document the extdiff extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 224
diff changeset
557 \begin{codesample2}
355
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
563 %\section{Cherrypicking changes with the \hgext{transplant} extension}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
567 %Need to have a long chat with Brendan about this.
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
570 %\section{Send changes via email with the \hgext{patchbomb} extension}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
574 %Many projects have a culture of ``change review'', in which people
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
575 %send their modifications to a mailing list for others to read and
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
576 %comment on before they commit the final version to a shared
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
577 %repository. Some projects have people who act as gatekeepers; they
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
578 %apply changes from other people to a repository to which those others
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
579 %don't have access.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
580
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
585 $B$O!$?M!9$+$iAw$i$l$?JQ99$r!$H`$i0J30$K%"%/%;%98"$N$J$$%j%]%8%H%j$XE,MQ$9(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
588 %Mercurial makes it easy to send changes over email for review or
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
589 %application, via its \hgext{patchbomb} extension. The extension is so
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
590 %namd because changes are formatted as patches, and it's usual to send
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
591 %one changeset per email message. Sending a long series of changes by
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
592 %email is thus much like ``bombing'' the recipient's inbox, hence
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
593 %``patchbomb''.
232
2469608b4a08 Start writing up the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 231
diff changeset
594
359
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
595 Mercurial$B$G$O(B\hgext{patchbomb}$B3HD%$rMQ$$$k$H%l%S%e!<$dE,MQ$N$?$a$KJQ99$r(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
599 $B<u?.<T$,<u$1<h$k$N$O(B``$B%Q%C%AGzCF(B''$B$G$"$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
600
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
601 %As usual, the basic configuration of the \hgext{patchbomb} extension
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
602 %takes just one or two lines in your \hgrc.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
603 $BDL>o!$(B\hgext{patchbomb}$B3HD%$N4pK\@_Dj$O(B\hgrc $B$NCf$G(B1$B!$(B2$B9T$[$I$G$"$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
609 %Once you've enabled the extension, you will have a new command
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
610 %available, named \hgxcmd{patchbomb}{email}.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
611
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
612 $B3HD%$rM-8z$K$9$k$H!$(B\hgxcmd{patchbomb}{email}$B%3%^%s%I$,;H$($k$h$&$K$J$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
613
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
614 %The safest and best way to invoke the \hgxcmd{patchbomb}{email}
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
615 %command is to \emph{always} run it first with the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
616 %\hgxopt{patchbomb}{email}{-n} option. This will show you what the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
617 %command \emph{would} send, without actually sending anything. Once
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
618 %you've had a quick glance over the changes and verified that you are
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
619 %sending the right ones, you can rerun the same command, with the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
622 \hgxcmd{patchbomb}{email}$B$r5/F0$9$k$N$K:G$b0BA4$GNI$$J}K!$O!$$^$::G=i$K(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
623 \hgxopt{patchbomb}{email}{-n}$B%*%W%7%g%s$rIU$1$F<B9T$7$F$_$k$3$H$@!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
624 $B$3$l$K$h$j!$<B:]$NAw?.$O9T$o$:$K2?$,5/$-$k$N$+$r8+$k$3$H$,$G$-$k!%JQ99$K(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
625 $BL\$rDL$7$F@5$7$$JQ99$rAw?.$9$k$3$H$r3NG'$G$-$?$i!$F1$8%3%^%s%I$r(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
628 %The \hgxcmd{patchbomb}{email} command accepts the same kind of
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
629 %revision syntax as every other Mercurial command. For example, this
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
630 %command will send every revision between 7 and \texttt{tip},
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
631 %inclusive.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
632
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
633 \hgxcmd{patchbomb}{email}$B%3%^%s%I$OB>$N(BMercurial$B%3%^%s%I$HF1MM$N%j%S%8%g(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
639
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
640 %You can also specify a \emph{repository} to compare with. If you
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
641 %provide a repository but no revisions, the \hgxcmd{patchbomb}{email}
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
642 %command will send all revisions in the local repository that are not
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
643
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
644 %present in the remote repository. If you additionally specify
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
645 %revisions or a branch name (the latter using the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
646 %\hgxopt{patchbomb}{email}{-b} option), this will constrain the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
647 %revisions sent.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
648
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
650 $B$7!$%j%S%8%g%s$r;XDj$7$J$$>l9g!$(B\hgxcmd{patchbomb}{email}$B$O%m!<%+%k%j%]%8(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
652 $B%s$^$?$O%V%i%s%AL>$r;XDj$9$k$H!J8e<T$O(B\hgxopt{patchbomb}{email}{-b}$B$rMQ$$(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
655 %It's perfectly safe to run the \hgxcmd{patchbomb}{email} command
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
656 %without the names of the people you want to send to: if you do this,
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
657 %it will just prompt you for those values interactively. (If you're
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
658 %using a Linux or Unix-like system, you should have enhanced
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
659 %\texttt{readline}-style editing capabilities when entering those
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
660 %headers, too, which is useful.)
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
661
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
662 $BAw?.$7$?$$?MC#$NL>A0$r;XDj$;$:$K(B\hgxcmd{patchbomb}{email}$B%3%^%s%I$r;H$C$F(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
663 $B$bA4$/0BA4$G$"$k!%$3$N>l9g!$BPOCE*$KF~NO$r5a$a$k!%(BLinux$B$^$?$O(BUnix$B7O$N%7%9(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
667 %When you are sending just one revision, the \hgxcmd{patchbomb}{email}
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
668 %command will by default use the first line of the changeset
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
669 %description as the subject of the single email message it sends.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
670
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
674 %If you send multiple revisions, the \hgxcmd{patchbomb}{email} command
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
675 %will usually send one message per changeset. It will preface the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
676 %series with an introductory message, in which you should describe the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
677 %purpose of the series of changes you're sending.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
678
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
681 $B=R$9$k@bL@J8$rIU$1$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
682
243
7df934d3dcb5 Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 241
diff changeset
683
355
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
684 %\subsection{Changing the behaviour of patchbombs}
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
687 %Not every project has exactly the same conventions for sending changes
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
688 %in email; the \hgext{patchbomb} extension tries to accommodate a
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
689 %number of variations through command line options.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
690
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
693 $B$KBP1~$G$-$k$h$&$K$J$C$F$$$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
694
243
7df934d3dcb5 Further document the patchbomb extension.
Bryan O'Sullivan <bos@serpentine.com>
parents: 241
diff changeset
695 \begin{itemize}
359
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
696 %\item You can write a subject for the introductory message on the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
697 % command line using the \hgxopt{patchbomb}{email}{-s} option. This
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
698 % takes one argument, the text of the subject to use.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
699 \item $B%3%^%s%I%i%$%s$+$i(B\hgxopt{patchbomb}{email}{-s}$B%*%W%7%g%s$r;H$C(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
701 $B$7$F;H$o$l$k%F%-%9%H$r0z?t$H$7$F<h$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
702
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
703 %\item To change the email address from which the messages originate,
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
704 % use the \hgxopt{patchbomb}{email}{-f} option. This takes one
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
705 % argument, the email address to use.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
706 \item $B%a%C%;!<%8$NAw?.85$N%"%I%l%9$rJQ99$9$k$K$O(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
707 \hgxopt{patchbomb}{email}{-f}$B%*%W%7%g%s$rMQ$$$k!%$3$N%*%W%7%g%s$O(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
708 $B%a!<%k%"%I%l%9$r0z?t$H$7$F<h$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
709
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
710 %\item The default behaviour is to send unified diffs (see
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
711 % section~\ref{sec:mq:patch} for a description of the format), one per
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
712 % message. You can send a binary bundle instead with the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
713 % \hgxopt{patchbomb}{email}{-b} option.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
715 $B%^%C%H$K$D$$$F$O(B\ref{sec:mq:patch}$B$r;2(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
716 $B>H!%!K(B\hgxopt{patchbomb}{email}{-b}$B%*%W%7%g%s$r;H$($P!$%P%$%J%j7A(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
717 $B<0$N%G!<%?$rE:IU$9$k$3$H$b$G$-$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
718
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
719 %\item Unified diffs are normally prefaced with a metadata header. You
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
720 % can omit this, and send unadorned diffs, with the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
721 % \hgxopt{patchbomb}{email}{--plain} option.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
722 \item unified$B7A<0(Bdiff$B$ODL>o%a%?%G!<%?$N%X%C%@$r;}(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
723 $B$D!%(B\hgxopt{patchbomb}{email}{--plain}$B%*%W%7%g%s$r;H$&$3$H$G$3$l(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
724 $B$r3d0&$9$k$3$H$,$G$-$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
725
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
726 %\item Diffs are normally sent ``inline'', in the same body part as the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
727 % description of a patch. This makes it easiest for the largest
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
728 % number of readers to quote and respond to parts of a diff, as some
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
729 % mail clients will only quote the first MIME body part in a message.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
730 % If you'd prefer to send the description and the diff in separate
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
731 % body parts, use the \hgxopt{patchbomb}{email}{-a} option.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
733 $B$l$k!%$$$/$D$+$N%a!<%k%/%i%$%"%s%H$G$O:G=i$N(BMIME$B%Q!<%H$N$_$+$i0zMQ(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
734 $B$,2DG=$J$?$a!$$3$&$9$k$3$H$,:G$bB?$/$N?M$K$H$C$F%Q%C%A$NFCDj$NItJ,(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
736 $B%H$K$7$FAw?.$7$?$$>l9g$O(B\hgxopt{patchbomb}{email}{-a}$B%*%W%7%g%s$r(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
737 $B;H$&!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
738
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
739 %\item Instead of sending mail messages, you can write them to an
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
740 % \texttt{mbox}-format mail folder using the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
741 % \hgxopt{patchbomb}{email}{-m} option. That option takes one
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
742 % argument, the name of the file to write to.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
743 \item $B%a!<%k$G%a%C%;!<%8$rAw?.$9$kJQ$o$j(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
744 $B$K!$(B\hgxopt{patchbomb}{email}{-m}$B%*%W%7%g%s$r;H$C$F(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
745 \texttt{mbox}$B%U%)!<%^%C%H$G=PNO$5$;$k$3$H$b2DG=$@!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
746 $B$3$N%*%W%7%g%s$O=PNO%U%!%$%kL>$r0l$D%*%W%7%g%s$H$7$F<h$k!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
747
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
748 %\item If you would like to add a \command{diffstat}-format summary to
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
749 % each patch, and one to the introductory message, use the
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
750 % \hgxopt{patchbomb}{email}{-d} option. The \command{diffstat}
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
751 % command displays a table containing the name of each file patched,
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
752 % the number of lines affected, and a histogram showing how much each
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
753 % file is modified. This gives readers a qualitative glance at how
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
754 % complex a patch is.
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
755 \item \command{diffstat}$B%U%)!<%^%C%H$N%5%^%j$r3F!9$N%Q%C%A$KIU$1!$@bL@J8(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
756 $B$rIU$1$?$$>l9g$O!$(B\hgxopt{patchbomb}{email}{-d}$B%*%W%7%g%s$r;H$&$H(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
757 $BNI$$!%(B\command{diffstat}$B%3%^%s%I$O%Q%C%A$5$l$?3F!9$N%U%!%$%kL>!$1F(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
758 $B6A$r<u$1$?9T?t!$3F%U%!%$%k$,$I$l$@$1JQ99$5$l$?$+$r<($9%R%9%H%0%i%`(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
759 $B$r$r4^$`%F!<%V%k$rI=<($9$k!%$3$N>pJs$O!$%Q%C%A$NJ#;($5$K$D$$$FDj@-(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
760 $BE*$JM}2r$rF@$k$N$KLrN)$D!%(B
81116699a510 finished hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 358
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
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
65aec2b27f64 - started hgext.tex
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 293
diff changeset
767 %%% End: