# HG changeset patch # User Yoshiki Yazawa # Date 1206815673 -32400 # Node ID d520107e32e7dc3ccd7322462a6e1201cf8eac78 # Parent 8bdd9bc948d4b17db51c95571370c8f4fdfa5399 more mq.tex diff -r 8bdd9bc948d4 -r d520107e32e7 ja/mq.tex --- a/ja/mq.tex Sun Mar 30 00:16:13 2008 +0900 +++ b/ja/mq.tex Sun Mar 30 03:34:33 2008 +0900 @@ -88,16 +88,26 @@ -Maintaining a single patch against an upstream tree is a little -tedious and error-prone, but not difficult. However, the complexity -of the problem grows rapidly as the number of patches you have to -maintain increases. With more than a tiny number of patches in hand, -understanding which ones you have applied and maintaining them moves -from messy to overwhelming. +%Maintaining a single patch against an upstream tree is a little +%tedious and error-prone, but not difficult. However, the complexity +%of the problem grows rapidly as the number of patches you have to +%maintain increases.With more than a tiny number of patches in hand, +%understanding which ones you have applied and maintaining them moves +%from messy to overwhelming. -Fortunately, Mercurial includes a powerful extension, Mercurial Queues -(or simply ``MQ''), that massively simplifies the patch management -problem. +単一のパッチをアップストリームのツリーに対してメンテナンスすることはやや +面倒で,間違いの元になりがちであるが,難しくはない.しかし,メンテナンス +するパッチの数が増えるに従って問題の複雑さが急速に増していく.パッチの数 +がある程度以上多くなると,どのパッチを適用したか,どのパッチを管理してい +るのかの理解が,厄介という状態から圧倒されるている状態になる. + +%Fortunately, Mercurial includes a powerful extension, Mercurial Queues +%(or simply ``MQ''), that massively simplifies the patch management +%problem. + +幸いにも,MercurialはMercurial Queues(あるいは単にMQ)という強力なエクス +テンションをもっており,パッチ管理の問題を大幅に単純化する. + %\section{The prehistory of Mercurial Queues} \section{Mercurial Queues前史} @@ -311,45 +321,72 @@ \label{ex:mq:diff} \end{figure} -The type of file that \command{diff} generates (and \command{patch} -takes as input) is called a ``patch'' or a ``diff''; there is no -difference between a patch and a diff. (We'll use the term ``patch'', -since it's more commonly used.) +%The type of file that \command{diff} generates (and \command{patch} +%takes as input) is called a ``patch'' or a ``diff''; there is no +%difference between a patch and a diff. (We'll use the term ``patch'', +%since it's more commonly used.) +\command{diff}が生成する(また\command{patch}が入力に取る)ファイルの種 +類は``patch''または``diff''と呼ばれ,これらの間には違いはない.(以下で +は,より多く使われている``patch''という言葉を使うことにする.) +%A patch file can start with arbitrary text; the \command{patch} +%command ignores this text, but MQ uses it as the commit message when +%creating changesets. To find the beginning of the patch content, +%\command{patch} searches for the first line that starts with the +%string ``\texttt{diff~-}''. +パッチファイルは任意のテキストで始まる.\command{patch}コマンドはこのテ +キストを無視するが,MQはチェンジセットを作る際のコミットメッセージとして +利用する.パッチ内容の先頭を見つけるために\command{patch}は +``\texttt{diff~-}''で始まる最初の行をサーチする. -A patch file can start with arbitrary text; the \command{patch} -command ignores this text, but MQ uses it as the commit message when -creating changesets. To find the beginning of the patch content, -\command{patch} searches for the first line that starts with the -string ``\texttt{diff~-}''. +%MQ works with \emph{unified} diffs (\command{patch} can accept several +%other diff formats, but MQ doesn't). A unified diff contains two +%kinds of header. The \emph{file header} describes the file being +%modified; it contains the name of the file to modify. When +%\command{patch} sees a new file header, it looks for a file with that +%name to start modifying. + +MQ\emph{unified} diffs形式を使う.(\command{patch}コマンドはこれ以外に何 +種類かのdiffフォーマットを受け付けるが,MQでは利用できない.)unified +diffは2種類のヘッダを持つ.\emph{file ヘッダ}は変更されているファイルを記 +述する.\command{patch}コマンドは,新しいファイルヘッダを見つけると,そこ +に記述されているファイル名を持つファイルを探す. -MQ works with \emph{unified} diffs (\command{patch} can accept several -other diff formats, but MQ doesn't). A unified diff contains two -kinds of header. The \emph{file header} describes the file being -modified; it contains the name of the file to modify. When -\command{patch} sees a new file header, it looks for a file with that -name to start modifying. +%After the file header comes a series of \emph{hunks}. Each hunk starts +%with a header; this identifies the range of line numbers within the file +%that the hunk should modify. Following the header, a hunk starts and +%ends with a few (usually three) lines of text from the unmodified file; +%these are called the \emph{context} for the hunk.If +%there's only a small amount of context between successive hunks, +%\command{diff} doesn't print a new hunk header; it just runs the hunks +%together, with a few lines of context between modifications. + +ファイルヘッダの後には一連の\emph{hunks}が続く.各々のhunkはヘッダで始ま +る.このヘッダはファイル内でhunkが改変すべき行番号の範囲を識別するのに使 +われる.ヘッダに続き,hunkは数行(通常3)の改変されていないファイルからの +行がある.これらはhunkの\emph{コンテキスト}と呼ばれる.もし連続するhunkの +間にコンテキストが少ししかなければ,\command{diff}は新たなhunkヘッダを出 +力せず,各々のhunkと間のコンテキストを合わせて出力する. -After the file header comes a series of \emph{hunks}. Each hunk -starts with a header; this identifies the range of line numbers within -the file that the hunk should modify. Following the header, a hunk -starts and ends with a few (usually three) lines of text from the -unmodified file; these are called the \emph{context} for the hunk. If -there's only a small amount of context between successive hunks, -\command{diff} doesn't print a new hunk header; it just runs the hunks -together, with a few lines of context between modifications. +%Each line of context begins with a space character. Within the hunk, +%a line that begins with ``\texttt{-}'' means ``remove this line,'' +%while a line that begins with ``\texttt{+}'' means ``insert this +%line.'' For example, a line that is modified is represented by one +%deletion and one insertion. -Each line of context begins with a space character. Within the hunk, -a line that begins with ``\texttt{-}'' means ``remove this line,'' -while a line that begins with ``\texttt{+}'' means ``insert this -line.'' For example, a line that is modified is represented by one -deletion and one insertion. +コンテキストの各行は,空白文字で始まる.hunk内では行は``\texttt{-}''で始 +まる.これは``この行を削除せよ''を意味する. +一方,``\texttt{+}''で始まる行は,``この行を挿入せよ''を意味する.例を挙 +げると,変更された行は1つの削除と1つの挿入で表される. -We will return to some of the more subtle aspects of patches later (in -section~\ref{sec:mq:adv-patch}), but you should have enough information -now to use MQ. +%We will return to some of the more subtle aspects of patches later (in +%section~\ref{sec:mq:adv-patch}), but you should have enough information +%now to use MQ. + +パッチの些細な点については後で(~\ref{sec:mq:adv-patch})また触れるが, +これまでで,MQを使うのに十分な情報は述べた. %\section{Getting started with Mercurial Queues} \section{Mercurial Queuesを使ってみる}