diff ja/hgext.tex @ 355:65aec2b27f64

- started hgext.tex - a bit more todo.txt
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 01 Sep 2008 17:57:18 +0900
parents 3b1291f24c0d
children ef197f25f11e
line wrap: on
line diff
--- a/ja/hgext.tex	Sun Aug 31 04:00:40 2008 +0900
+++ b/ja/hgext.tex	Mon Sep 01 17:57:18 2008 +0900
@@ -1,106 +1,189 @@
-\chapter{Adding functionality with extensions}
+%\chapter{Adding functionality with extensions}
+\chapter{$B3HD%$K$h$k5!G=$NDI2C(B}
 \label{chap:hgext}
 
-While the core of Mercurial is quite complete from a functionality
-standpoint, it's deliberately shorn of fancy features.  This approach
-of preserving simplicity keeps the software easy to deal with for both
-maintainers and users.
+%While the core of Mercurial is quite complete from a functionality
+%standpoint, it's deliberately shorn of fancy features.  This approach
+%of preserving simplicity keeps the software easy to deal with for both
+%maintainers and users.
+
+$B5!G=$N4QE@$+$i8+$k$H(BMercurial$B$O$+$J$j40Hw$7$F$$$k$,!$GI<j$J5!G=$K$D$$$F$O(B
+$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
+$B$D$?$a$K$3$N%"%W%m!<%A$r<h$C$F$$$k!%(B
 
-However, Mercurial doesn't box you in with an inflexible command set:
-you can add features to it as \emph{extensions} (sometimes known as
-\emph{plugins}).  We've already discussed a few of these extensions in
-earlier chapters.
+%However, Mercurial doesn't box you in with an inflexible command set:
+%you can add features to it as \emph{extensions} (sometimes known as
+%\emph{plugins}).  We've already discussed a few of these extensions in
+%earlier chapters.
+
+$B$7$+$7$J$,$i!$(BMercurial$B$OM;DL$NMx$+$J$$%3%^%s%I%;%C%H$rDs6!$7$F$$$k$N$G$O(B
+$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
+$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
+$B$$$k!%(B
+
 \begin{itemize}
-\item Section~\ref{sec:tour-merge:fetch} covers the \hgext{fetch}
-  extension; this combines pulling new changes and merging them with
-  local changes into a single command, \hgxcmd{fetch}{fetch}.
-\item In chapter~\ref{chap:hook}, we covered several extensions that
-  are useful for hook-related functionality: \hgext{acl} adds access
-  control lists; \hgext{bugzilla} adds integration with the Bugzilla
-  bug tracking system; and \hgext{notify} sends notification emails on
-  new changes.
-\item The Mercurial Queues patch management extension is so invaluable
-  that it merits two chapters and an appendix all to itself.
-  Chapter~\ref{chap:mq} covers the basics;
-  chapter~\ref{chap:mq-collab} discusses advanced topics; and
-  appendix~\ref{chap:mqref} goes into detail on each command.
+%\item Section~\ref{sec:tour-merge:fetch} covers the \hgext{fetch}
+%  extension; this combines pulling new changes and merging them with
+%  local changes into a single command, \hgxcmd{fetch}{fetch}.
+\item $B%;%/%7%g%s(B\ref{sec:tour-merge:fetch}$B$O(B\hgext{fetch}$B%(%/%9%F%s%7%g%s(B
+       $B$r%+%P!<$7$F$$$k!%$3$l$O?7$7$$JQ99$r(Bpull$B$7!$%m!<%+%k$JJQ99$H%^!<%8(B
+       $B$rC10l$N%3%^%s%I(B\hgxcmd{fetch}{fetch}$B$G<B9T$9$k!%(B
+%\item In chapter~\ref{chap:hook}, we covered several extensions that
+%  are useful for hook-related functionality: \hgext{acl} adds access
+%  control lists; \hgext{bugzilla} adds integration with the Bugzilla
+%  bug tracking system; and \hgext{notify} sends notification emails on
+%  new changes.
+\item \ref{chap:hook}$B$G$O!$%U%C%/$K4XO"$7$?$$$/$D$+$N3HD%$K$D$$$F07$&!%(B
+\hgext{acl}$B$O%"%/%;%9@)8f%j%9%H$rDI2C$9$k!%(B\hgext{bugzilla}$B$O(BBugzilla$B5!G=(B
+$B$NE}9g5!G=$rDs6!$9$k!%(B\hgext{notify}$B$O!$?7$?$JJQ99$N:]$KDLCNEE;R%a!<%k$r(B
+$BAw$k5!G=$rDs6!$9$k!%(B
+%\item The Mercurial Queues patch management extension is so invaluable
+%  that it merits two chapters and an appendix all to itself.
+%  Chapter~\ref{chap:mq} covers the basics;
+%  chapter~\ref{chap:mq-collab} discusses advanced topics; and
+%  appendix~\ref{chap:mqref} goes into detail on each command.
+\item Mercurial Queue$B$H$$$&%Q%C%A%^%M!<%8%a%s%H3HD%$O!$Hs>o$K=EMW$J$N$G(B2
+      $B>O$HIUO?(B1$B>O$rHq$d$7$F@bL@$9$k!%(B
+  Chapter~\ref{chap:mq}$B$O4pK\E*$J5!G=$r@bL@$9$k!%(B
+  chapter~\ref{chap:mq-collab}$B$G$O9bEY$J5!G=$K$D$$$F@bL@$7!$(B
+  appendix~\ref{chap:mqref}$B$G$O3F%3%^%s%I$N>\:Y$r@bL@$9$k!%(B
 \end{itemize}
 
-In this chapter, we'll cover some of the other extensions that are
-available for Mercurial, and briefly touch on some of the machinery
-you'll need to know about if you want to write an extension of your
-own.
+%In this chapter, we'll cover some of the other extensions that are
+%available for Mercurial, and briefly touch on some of the machinery
+%you'll need to know about if you want to write an extension of your
+%own.
+$B$3$N>O$G$O(BMercurial$B$GMxMQ2DG=$J$=$NB>$N3HD%$K$D$$$F<h$j07$$!$$^$?<+J,$G(B
+Mercurial$B3HD%$r=q$/;~$KLrN)$DFbIt$N5!9=$K$D$$$F$b@bL@$9$k!%(B
 \begin{itemize}
-\item In section~\ref{sec:hgext:inotify}, we'll discuss the
-  possibility of \emph{huge} performance improvements using the
-  \hgext{inotify} extension.
+%\item In section~\ref{sec:hgext:inotify}, we'll discuss the
+%  possibility of \emph{huge} performance improvements using the
+%  \hgext{inotify} extension.
+\item \ref{sec:hgext:inotify}$B@a$G$O(B\hgext{inotify}$B3HD%$rMQ$$$k$3$H$GF@$i(B
+      $B$l$k(B\emph{$BBg$-$J(B}$B@-G=8~>e$K$D$$$F=R$Y$k!%(B
 \end{itemize}
 
-\section{Improve performance with the \hgext{inotify} extension}
+%\section{Improve performance with the \hgext{inotify} extension}
+\section{\hgext{inotify}$B3HD%$K$h$k@-G=8~>e(B}
 \label{sec:hgext:inotify}
 
-Are you interested in having some of the most common Mercurial
-operations run as much as a hundred times faster?  Read on!
+%Are you interested in having some of the most common Mercurial
+%operations run as much as a hundred times faster?  Read on!
+Mercurial$B$N:G$bB?MQ$5$l$k%3%^%s%I$N$$$/$D$+$,?tI4G\B.$/$J$k$3$H$K6=L#$,$"(B
+$B$k$J$i$P$<$RFI$s$GM_$7$$!*(B
+
+%Mercurial has great performance under normal circumstances.  For
+%example, when you run the \hgcmd{status} command, Mercurial has to
+%scan almost every directory and file in your repository so that it can
+%display file status.  Many other Mercurial commands need to do the
+%same work behind the scenes; for example, the \hgcmd{diff} command
+%uses the status machinery to avoid doing an expensive comparison
+%operation on files that obviously haven't changed.
 
-Mercurial has great performance under normal circumstances.  For
-example, when you run the \hgcmd{status} command, Mercurial has to
-scan almost every directory and file in your repository so that it can
-display file status.  Many other Mercurial commands need to do the
-same work behind the scenes; for example, the \hgcmd{diff} command
-uses the status machinery to avoid doing an expensive comparison
-operation on files that obviously haven't changed.
+$BDL>o$N>r7o2<$G(BMercurial$B$O9b$$@-G=$r;}$C$F$$$k$,!$(B \hgcmd{status}$B%3%^%s%I(B
+$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
+$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
+$B$K$J$C$F$$$k!%Nc$($P(B\hgcmd{diff}$B$O%9%F!<%?%95!9=$rMQ$$$F!$L@$i$+$KJQ99$5(B
+$B$l$F$$$J$$%U%!%$%k$NHf3S$rHr$1$F$$$k!%(B
+
+%Because obtaining file status is crucial to good performance, the
+%authors of Mercurial have optimised this code to within an inch of its
+%life.  However, there's no avoiding the fact that when you run
+%\hgcmd{status}, Mercurial is going to have to perform at least one
+%expensive system call for each managed file to determine whether it's
+%changed since the last time Mercurial checked.  For a sufficiently
+%large repository, this can take a long time.
 
-Because obtaining file status is crucial to good performance, the
-authors of Mercurial have optimised this code to within an inch of its
-life.  However, there's no avoiding the fact that when you run
-\hgcmd{status}, Mercurial is going to have to perform at least one
-expensive system call for each managed file to determine whether it's
-changed since the last time Mercurial checked.  For a sufficiently
-large repository, this can take a long time.
+$BNI$$@-G=$rF@$k$?$a$K$O!$%U%!%$%k%9%F!<%?%9$N<hF@$,=EMW$J4X?4;v$H$J$k$?(B
+$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
+\hgcmd{status}$B%3%^%s%I$G$O$3$l$rHr$1$k<jN)$F$,$J$$!%(B Mercurial$B$O!$4IM}$7(B
+$B$F$$$k%U%!%$%k$,:G8e$K%A%'%C%/$7$?;~$+$iJQ99$5$l$F$$$k$+D4$Y$k$?$a$K!$>/(B
+$B$J$/$H$b0l$D$N9b2A$J%7%9%F%`%3!<%k$r$9$kI,MW$,$"$k!%$"$kDxEY0J>eBg$-$J%j(B
+$B%]%8%H%j$G$O!$$3$NA`:n$K$OD9$$;~4V$rMW$9$k!%(B
+
+%To put a number on the magnitude of this effect, I created a
+%repository containing 150,000 managed files.  I timed \hgcmd{status}
+%as taking ten seconds to run, even when \emph{none} of those files had
+%been modified.
 
-To put a number on the magnitude of this effect, I created a
-repository containing 150,000 managed files.  I timed \hgcmd{status}
-as taking ten seconds to run, even when \emph{none} of those files had
-been modified.
+$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
+$B$?!%(B\emph{$B$^$C$?$/(B}$BJQ99$,$J$$>l9g$G$b(B\hgcmd{status}$B%3%^%s%I$N<B9T$K$O(B10
+$BIC$rMW$7$?!%(B
 
-Many modern operating systems contain a file notification facility.
-If a program signs up to an appropriate service, the operating system
-will notify it every time a file of interest is created, modified, or
-deleted.  On Linux systems, the kernel component that does this is
-called \texttt{inotify}.
+%Many modern operating systems contain a file notification facility.
+%If a program signs up to an appropriate service, the operating system
+%will notify it every time a file of interest is created, modified, or
+%deleted.  On Linux systems, the kernel component that does this is
+%called \texttt{inotify}.
+
+$B6aG/$N%*%Z%l!<%F%#%s%0%7%9%F%`$O!$%U%!%$%kDLCN$N5!9=$rHw$($F$$$k!%%W%m%0(B
+$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
+$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
+$B$&%+!<%M%k%3%s%]!<%M%s%H$O(B\texttt{inotify}$B$H8F$P$l$k!%(B
 
-Mercurial's \hgext{inotify} extension talks to the kernel's
-\texttt{inotify} component to optimise \hgcmd{status} commands.  The
-extension has two components.  A daemon sits in the background and
-receives notifications from the \texttt{inotify} subsystem.  It also
-listens for connections from a regular Mercurial command.  The
-extension modifies Mercurial's behaviour so that instead of scanning
-the filesystem, it queries the daemon.  Since the daemon has perfect
-information about the state of the repository, it can respond with a
-result instantaneously, avoiding the need to scan every directory and
-file in the repository.
+%Mercurial's \hgext{inotify} extension talks to the kernel's
+%\texttt{inotify} component to optimise \hgcmd{status} commands.  The
+%extension has two components.  A daemon sits in the background and
+%receives notifications from the \texttt{inotify} subsystem.  It also
+%listens for connections from a regular Mercurial command.  The
+%extension modifies Mercurial's behaviour so that instead of scanning
+%the filesystem, it queries the daemon.  Since the daemon has perfect
+%information about the state of the repository, it can respond with a
+%result instantaneously, avoiding the need to scan every directory and
+%file in the repository.
 
-Recall the ten seconds that I measured plain Mercurial as taking to
-run \hgcmd{status} on a 150,000 file repository.  With the
-\hgext{inotify} extension enabled, the time dropped to 0.1~seconds, a
-factor of \emph{one hundred} faster.
+Mercurial$B$N(B\hgext{inotify}$B3HD%$O!$(B\hgcmd{status}$B%3%^%s%I$r:GE,2=$9$k$?$a(B
+$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
+$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
+$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
+$B%^%s%I$+$i$N@\B3$b<u$1IU$1$k!%$3$N3HD%$O(BMercurial$B$N5sF0$rJQ99$7!$%U%!%$%k(B
+$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
+$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
+$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
+$B$k$3$H$,$G$-$k!%(B
+
+%Recall the ten seconds that I measured plain Mercurial as taking to
+%run \hgcmd{status} on a 150,000 file repository.  With the
+%\hgext{inotify} extension enabled, the time dropped to 0.1~seconds, a
+%factor of \emph{one hundred} faster.
+
+$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
+$B%j$KBP$7$F(B10$BIC$rMW$7$F$$$?$3$H$r;W$$=P$7$FM_$7$$!#(B
+\hgext{inotify}$B3HD%$r;H$C$?>l9g!"=jMW;~4V$O(B0.1$BIC$K2<$,$j!$(B\emph{100}$BG\B.(B
+$B$/$J$C$F$$$k$3$H$,J,$+$k!%(B
 
-Before we continue, please pay attention to some caveats.
+%Before we continue, please pay attention to some caveats.
+$B$5$i$K?J$`A0$K!$Cm0UE@$r5s$2$k!%(B
 \begin{itemize}
-\item The \hgext{inotify} extension is Linux-specific.  Because it
-  interfaces directly to the Linux kernel's \texttt{inotify}
-  subsystem, it does not work on other operating systems.
-\item It should work on any Linux distribution that was released after
-  early~2005.  Older distributions are likely to have a kernel that
-  lacks \texttt{inotify}, or a version of \texttt{glibc} that does not
-  have the necessary interfacing support.
-\item Not all filesystems are suitable for use with the
-  \hgext{inotify} extension.  Network filesystems such as NFS are a
-  non-starter, for example, particularly if you're running Mercurial
-  on several systems, all mounting the same network filesystem.  The
-  kernel's \texttt{inotify} system has no way of knowing about changes
-  made on another system.  Most local filesystems (e.g.~ext3, XFS,
-  ReiserFS) should work fine.
+%\item The \hgext{inotify} extension is Linux-specific.  Because it
+%  interfaces directly to the Linux kernel's \texttt{inotify}
+%  subsystem, it does not work on other operating systems.
+ \item \hgext{inotify}$B3HD%$O(BLinux$BFCM-$N$b$N$G$"$k!%$3$N5!G=3HD%$O(BLinux$B$N(B
+       \texttt{inotify}$B%5%V%7%9%F%`$KD>@\%"%/%;%9$9$k$?$a!$B>$N%*%Z%l!<(B
+       $B%F%#%s%0%7%9%F%`$G$OF0:n$7$J$$!%(B
+
+%\item It should work on any Linux distribution that was released after
+%  early~2005.  Older distributions are likely to have a kernel that
+%  lacks \texttt{inotify}, or a version of \texttt{glibc} that does not
+%  have the necessary interfacing support.
+ \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
+       $B%s$G$bF0:n$9$k$O$:$@$,!$8E$$%G%#%9%H%j%S%e!<%7%g%s$G$O(B
+       \texttt{inotify}$B$r7g$$$F$$$?$j!$I,MW$J%$%s%?!<%U%'!<%9%5%]!<%H$r(B
+       \texttt{glibc}$B$,Ds6!$7$F$$$J$+$C$?$j$9$k2DG=@-$,$"$k!%(B
+
+%\item Not all filesystems are suitable for use with the
+%  \hgext{inotify} extension.  Network filesystems such as NFS are a
+%  non-starter, for example, particularly if you're running Mercurial
+
+%  on several systems, all mounting the same network filesystem.  The
+%  kernel's \texttt{inotify} system has no way of knowing about changes
+%  made on another system.  Most local filesystems (e.g.~ext3, XFS,
+%  ReiserFS) should work fine.
+ \item $BA4$F$N%U%!%$%k%7%9%F%`$,(B\hgext{inotify}$B3HD%$GMxMQ2DG=$J$o$1$G$O$J(B
+       $B$$!%Nc$((B
+$B$P(BMercurial$B$r$$$/$D$+$N%7%9%F%`$GF0:n$5$;$F$$$k>l9g!$F10l$N%M%C%H%o!<%/%U%!(B
+$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
+$B%H%o!<%/%U%!%$%k%7%9%F%`$O9MN8$5$l$F$$$J$$!%(B
 \end{itemize}
 
 The \hgext{inotify} extension is not yet shipped with Mercurial as of
@@ -201,7 +284,8 @@
 print different output; neither should they give different results.
 If either of these situations occurs, please report a bug.
 
-\section{Flexible diff support with the \hgext{extdiff} extension}
+%\section{Flexible diff support with the \hgext{extdiff} extension}
+\section{\hgext{extdiff}$B3HD%$K$h$k=@Fp$J(Bdiff$B%5%]!<%H(B}
 \label{sec:hgext:extdiff}
 
 Mercurial's built-in \hgcmd{diff} command outputs plaintext unified
@@ -278,7 +362,8 @@
 \command{interdiff} command, see
 section~\ref{mq-collab:tips:interdiff}.
 
-\subsection{Defining command aliases}
+%\subsection{Defining command aliases}
+\subsection{$B%3%^%s%I$N%(%$%j%"%9$r:n$k(B}
 
 It can be cumbersome to remember the options to both the
 \hgxcmd{extdiff}{extdiff} command and the diff viewer you want to use,
@@ -310,17 +395,20 @@
 example defines a ``\texttt{hg vimdiff}'' command that runs the
 \command{vim} editor's \texttt{DirDiff} extension.
 \begin{codesample2}
-  [extdiff]  
+  [extdiff]
   cmd.vimdiff = vim
   opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'
 \end{codesample2}
 
-\section{Cherrypicking changes with the \hgext{transplant} extension}
+%\section{Cherrypicking changes with the \hgext{transplant} extension}
+\section{\hgext{transplant}$B3HD%$rMQ$$$?%A%'%j!<%T%C%-%s%099?7(B}
 \label{sec:hgext:transplant}
 
-Need to have a long chat with Brendan about this.
+%Need to have a long chat with Brendan about this.
+$B!J(BBrendan$B$H$h$/OC$r$9$kI,MW$,$"$k!%!K(B
 
-\section{Send changes via email with the \hgext{patchbomb} extension}
+%\section{Send changes via email with the \hgext{patchbomb} extension}
+\section{\hgext{patchbomb}$B3HD%$K$h$C$FJQ99$r%a!<%k$9$k(B}
 \label{sec:hgext:patchbomb}
 
 Many projects have a culture of ``change review'', in which people
@@ -385,7 +473,8 @@
 series with an introductory message, in which you should describe the
 purpose of the series of changes you're sending.
 
-\subsection{Changing the behaviour of patchbombs}
+%\subsection{Changing the behaviour of patchbombs}
+\subsection{patchbombs$B$N5sF0$rJQ99$9$k(B}
 
 Not every project has exactly the same conventions for sending changes
 in email; the \hgext{patchbomb} extension tries to accommodate a
@@ -423,7 +512,7 @@
   complex a patch is.
 \end{itemize}
 
-%%% Local Variables: 
+%%% Local Variables:
 %%% mode: yatex
 %%% TeX-master: "00book"
-%%% End: 
+%%% End: