# HG changeset patch # User Yoshiki Yazawa # Date 1220259438 -32400 # Node ID 65aec2b27f643ff3beb36e31181404d184f70dd7 # Parent 4991d84ba9d6d742e35c2def2810515e396e4fa9 - started hgext.tex - a bit more todo.txt diff -r 4991d84ba9d6 -r 65aec2b27f64 ja/hgext.tex --- 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{拡張による機能の追加} \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. + +機能の観点から見るとMercurialはかなり完備しているが,派手な機能については +意図的に排除している.Mercurialのメンテナとユーザの双方にとって単純さを保 +つためにこのアプローチを取っている. -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. + +しかしながら,Mercurialは融通の利かないコマンドセットを提供しているのでは +ない.\emph{extensions}(あるいは\emph{plugins}と呼ばれることもある)によっ +て機能を追加することができる.これらのいくつかについては,以前の章で見て +いる. + \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 セクション\ref{sec:tour-merge:fetch}は\hgext{fetch}エクステンション + をカバーしている.これは新しい変更をpullし,ローカルな変更とマージ + を単一のコマンド\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 \ref{chap:hook}では,フックに関連したいくつかの拡張について扱う. +\hgext{acl}はアクセス制御リストを追加する.\hgext{bugzilla}はBugzilla機能 +の統合機能を提供する.\hgext{notify}は,新たな変更の際に通知電子メールを +送る機能を提供する. +%\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というパッチマネージメント拡張は,非常に重要なので2 + 章と付録1章を費やして説明する. + Chapter~\ref{chap:mq}は基本的な機能を説明する. + chapter~\ref{chap:mq-collab}では高度な機能について説明し, + appendix~\ref{chap:mqref}では各コマンドの詳細を説明する. \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. +この章ではMercurialで利用可能なその他の拡張について取り扱い,また自分で +Mercurial拡張を書く時に役立つ内部の機構についても説明する. \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}節では\hgext{inotify}拡張を用いることで得ら + れる\emph{大きな}性能向上について述べる. \end{itemize} -\section{Improve performance with the \hgext{inotify} extension} +%\section{Improve performance with the \hgext{inotify} extension} +\section{\hgext{inotify}拡張による性能向上} \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の最も多用されるコマンドのいくつかが数百倍速くなることに興味があ +るならばぜひ読んで欲しい! + +%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. +通常の条件下でMercurialは高い性能を持っているが, \hgcmd{status}コマンド +を実行した時,Mercurialはほぼ全てのディレクトリとファイルをスキャンするこ +とになる.他の多くのMercurialコマンドは,このような操作を意識させないよう +になっている.例えば\hgcmd{diff}はステータス機構を用いて,明らかに変更さ +れていないファイルの比較を避けている. + +%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. +良い性能を得るためには,ファイルステータスの取得が重要な関心事となるた +め,Mercurialの作者たちはこれをぎりぎりのところまで最適化している.しかし +\hgcmd{status}コマンドではこれを避ける手立てがない. Mercurialは,管理し +ているファイルが最後にチェックした時から変更されているか調べるために,少 +なくとも一つの高価なシステムコールをする必要がある.ある程度以上大きなリ +ポジトリでは,この操作には長い時間を要する. + +%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. +この影響について調べるために150,000のファイルを擁するリポジトリを作成し +た.\emph{まったく}変更がない場合でも\hgcmd{status}コマンドの実行には10 +秒を要した. -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}. + +近年のオペレーティングシステムは,ファイル通知の機構を備えている.プログ +ラムが適切なサービスに登録すると,オペレーティングシステムは対象となるファ +イルの作成,変更,削除をプログラムに通知する. Linuxシステムではこれを行 +うカーネルコンポーネントは\texttt{inotify}と呼ばれる. -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の\hgext{inotify}拡張は,\hgcmd{status}コマンドを最適化するため +に,カーネルの\texttt{inotify}コンポーネントへアクセスする.この拡張は2つ +のコンポーネントからなる. \texttt{inotify}サブシステムから通知を受け取る +ためのデーモンがバックグランドで動作する.このデーモンはMercurialの他のコ +マンドからの接続も受け付ける.この拡張はMercurialの挙動を変更し,ファイル +システムをスキャンするのではなく,デーモンへの問い合わせを行うようにす +る.デーモンはリポジトリの状態を完全に把握しているので,直ちに問い合わせ +に返答することができ,リポジトリのディレクトリとファイルのスキャンを避け +ることができる. + +%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では\hgcmd{status}コマンドが150,000ファイルのリポジト +リに対して10秒を要していたことを思い出して欲しい。 +\hgext{inotify}拡張を使った場合、所要時間は0.1秒に下がり,\emph{100}倍速 +くなっていることが分かる. -Before we continue, please pay attention to some caveats. +%Before we continue, please pay attention to some caveats. +さらに進む前に,注意点を挙げる. \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}拡張はLinux特有のものである.この機能拡張はLinuxの + \texttt{inotify}サブシステムに直接アクセスするため,他のオペレー + ティングシステムでは動作しない. + +%\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年初め以降にリリースされたどのようなLinuxディストリビューショ + ンでも動作するはずだが,古いディストリビューションでは + \texttt{inotify}を欠いていたり,必要なインターフェースサポートを + \texttt{glibc}が提供していなかったりする可能性がある. + +%\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 全てのファイルシステムが\hgext{inotify}拡張で利用可能なわけではな + い.例え +ばMercurialをいくつかのシステムで動作させている場合,同一のネットワークファ +イルシステムを各々のシステムでマウントしていることが多いが, NFSなどのネッ +トワークファイルシステムは考慮されていない. \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}拡張による柔軟なdiffサポート} \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{コマンドのエイリアスを作る} 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}拡張を用いたチェリーピッキング更新} \label{sec:hgext:transplant} -Need to have a long chat with Brendan about this. +%Need to have a long chat with Brendan about this. +(Brendanとよく話をする必要がある.) -\section{Send changes via email with the \hgext{patchbomb} extension} +%\section{Send changes via email with the \hgext{patchbomb} extension} +\section{\hgext{patchbomb}拡張によって変更をメールする} \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の挙動を変更する} 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: diff -r 4991d84ba9d6 -r 65aec2b27f64 ja/todo.txt --- a/ja/todo.txt Sun Aug 31 04:00:40 2008 +0900 +++ b/ja/todo.txt Mon Sep 01 17:57:18 2008 +0900 @@ -1,14 +1,15 @@ + translate proofread branch.tex 100% collab.tex concepts.tex daily.tex filenames.tex -hg_id.tex +hg_id.tex noneed hgext.tex hook.tex intro.tex license.tex -mq-collab.tex 2% +mq-collab.tex 100% mq-ref.tex 100% mq.tex 100% preface.tex 100%