# HG changeset patch # User Yoshiki Yazawa # Date 1217574579 -32400 # Node ID b3e736000aef793036853711bf8b96502a86aff8 # Parent 0b99bf82b573f833f9250f7c04b39ea14b0548a7 completed mq.tex. diff -r 0b99bf82b573 -r b3e736000aef ja/mq.tex --- a/ja/mq.tex Fri Aug 01 12:38:25 2008 +0900 +++ b/ja/mq.tex Fri Aug 01 16:09:39 2008 +0900 @@ -1301,7 +1301,7 @@ %MQ commands that work with patches let you refer to a patch either by %using its name or by a number. By name is obvious enough; pass the %name \filename{foo.patch} to \hgxcmd{mq}{qpush}, for example, and it will -%push patches until \filename{foo.patch} is applied. +%push patches until \filename{foo.patch} is applied. パッチを扱うMQコマンドは,パッチをパッチ名または番号で参照する.名前の場 合は例えばファイル名\filename{foo.patch}を\hgxcmd{mq}{qpush}に渡す.この @@ -1583,69 +1583,109 @@ %histogram of the modifications made to each file in a patch. It %provides a good way to ``get a sense of'' a patch---which files it %affects, and how much change it introduces to each file and as a - %whole. (I find that it's a good idea to use \command{diffstat}'s %\cmdopt{diffstat}{-p} option as a matter of course, as otherwise it %will try to do clever things with prefixes of file names that %inevitably confuse at least me.) \command{diffstat}コマンド~\cite{web:diffstat}はパッチ内のそれぞれのファ -イルへの変更のヒストグラムを生成する. - -これは,パッチが影響を及ぼすファイルを把握したり,全体でそれぞれのファイ -ルへどの程度変更を加えるのか把握するのに役立つ. -(\command{diffstat}コマンドの\cmdopt{diffstat}{-p}オプションが - - -) +イルへの変更のヒストグラムを生成する.これは,パッチが影響を及ぼすファイ +ルを把握したり,全体でそれぞれのファイルへどの程度変更を加えるのか把握す +るのに役立つ. (\command{diffstat}コマンドの\cmdopt{diffstat}{-p}オプショ +ンを用いるのは勿論良い考えである.さもなければコマンドはファイル名の +prefixに対して``賢い''ことをしでかすため,少なくとも筆者は混乱を避けられ +なかった.) \begin{figure}[ht] \interaction{mq.tools.tools} - \caption{The \command{diffstat}, \command{filterdiff}, and \command{lsdiff} commands} +% \caption{The \command{diffstat}, \command{filterdiff}, and + % \command{lsdiff} commands} + \caption{\command{diffstat}, \command{filterdiff}, および + \command{lsdiff} コマンド} \label{ex:mq:tools} \end{figure} -The \package{patchutils} package~\cite{web:patchutils} is invaluable. -It provides a set of small utilities that follow the ``Unix -philosophy;'' each does one useful thing with a patch. The -\package{patchutils} command I use most is \command{filterdiff}, which -extracts subsets from a patch file. For example, given a patch that -modifies hundreds of files across dozens of directories, a single -invocation of \command{filterdiff} can generate a smaller patch that -only touches files whose names match a particular glob pattern. See -section~\ref{mq-collab:tips:interdiff} for another example. +%The \package{patchutils} package~\cite{web:patchutils} is invaluable. +%It provides a set of small utilities that follow the ``Unix +%philosophy;'' each does one useful thing with a patch. The +%\package{patchutils} command I use most is \command{filterdiff}, which +%extracts subsets from a patch file. For example, given a patch that + +%modifies hundreds of files across dozens of directories, a single +%invocation of \command{filterdiff} can generate a smaller patch that +%only touches files whose names match a particular glob pattern. See +%section~\ref{mq-collab:tips:interdiff} for another example. + +\package{patchutils}パッケージ~\cite{web:patchutils}は非常に有用である. +このパッケージは``UNIX哲学''に従った小さなユーティリティからなり,各々の +ユーティリティはパッチに対して有用な単機能を提供す +る.\package{patchutils}の中で筆者が最も良く使うコマンドは +\command{filterdiff}で,これはパッチファイルからパッチの部分集合を取り出 +す.例えば,10以上のディレクトリに跨って数百のファイルに変更を行うような +パッチがあるとして,ただ一回の\command{filterdiff}の実行で特定のパターン +にマッチしたファイルのみを変更するより小さなパッチを生成することができ +る.そのほかの例は\ref{mq-collab:tips:interdiff}を見よ. + %\section{Good ways to work with patches} \section{好ましいパッチ取り扱い方法} -Whether you are working on a patch series to submit to a free software -or open source project, or a series that you intend to treat as a -sequence of regular changesets when you're done, you can use some -simple techniques to keep your work well organised. +%Whether you are working on a patch series to submit to a free software +%or open source project, or a series that you intend to treat as a +%sequence of regular changesets when you're done, you can use some +%simple techniques to keep your work well organised. + +フリーソフトやオープンソースプロジェクトに提出するためのパッチシリーズに +対して作業しているときや,作業が終ったときに通常のチェンジセットとして取 +り込まれる予定のパッチシリーズに対してだ行しているときは,作業をうまく系 +統づけるための単純なテクニックがある. -Give your patches descriptive names. A good name for a patch might be -\filename{rework-device-alloc.patch}, because it will immediately give -you a hint what the purpose of the patch is. Long names shouldn't be -a problem; you won't be typing the names often, but you \emph{will} be -running commands like \hgxcmd{mq}{qapplied} and \hgxcmd{mq}{qtop} over and over. -Good naming becomes especially important when you have a number of -patches to work with, or if you are juggling a number of different -tasks and your patches only get a fraction of your attention. +%Give your patches descriptive names. A good name for a patch might be +%\filename{rework-device-alloc.patch}, because it will immediately give +%you a hint what the purpose of the patch is. Long names shouldn't be a +%problem; you won't be typing the names often, but you \emph{will} be +%running commands like \hgxcmd{mq}{qapplied} and \hgxcmd{mq}{qtop} over +%and over. Good naming becomes especially important when you have a +%number of patches to work with, or if you are juggling a number of +%different tasks and your patches only get a fraction of your attention. + +パッチに記述的な名前を与える.パッチに与えるべき良い名前は +\filename{rework-device-alloc.patch}のようなものである.理由は即座にパッ +チの目的のヒントを与えるからである.長い名前は問題にはならない.なぜなら +名前をタイプすることは滅多になく,代わりに\hgxcmd{mq}{qapplied}や +\hgxcmd{mq}{qtop}のようなコマンドを繰り返し実行することになるからである. +多数のパッチに対して作業をしているときは,良い名前を付けることは特に重要 +となる.そうしないと,もしあなたがたくさんの別のタスクを抱えているなら +ば,パッチの区別はつかなくなってしまう. -Be aware of what patch you're working on. Use the \hgxcmd{mq}{qtop} -command and skim over the text of your patches frequently---for -example, using \hgcmdargs{tip}{\hgopt{tip}{-p}})---to be sure of where -you stand. I have several times worked on and \hgxcmd{mq}{qrefresh}ed a -patch other than the one I intended, and it's often tricky to migrate -changes into the right patch after making them in the wrong one. +%Be aware of what patch you're working on. Use the \hgxcmd{mq}{qtop} +%command and skim over the text of your patches frequently---for +%example, using \hgcmdargs{tip}{\hgopt{tip}{-p}}---to be sure of where +%you stand. I have several times worked on and \hgxcmd{mq}{qrefresh}ed a +%patch other than the one I intended, and it's often tricky to migrate +%changes into the right patch after making them in the wrong one. + +どのパッチについて作業しているのか把握しておくべきであ +る.\hgxcmd{mq}{qtop}コマンドを使い,パッチを頻繁にチェックすべきである. +また,例えば\hgcmdargs{tip}{\hgopt{tip}{-p}}を使って,いまどこにいるのか +を調べることも必要である.意図しているパッチ以外のパッチについて +\hgxcmd{mq}{qrefresh}を行い,間違ったパッチに加えられた変更を正しいパッチ +に移動させた. -For this reason, it is very much worth investing a little time to -learn how to use some of the third-party tools I described in -section~\ref{sec:mq:tools}, particularly \command{diffstat} and -\command{filterdiff}. The former will give you a quick idea of what -changes your patch is making, while the latter makes it easy to splice -hunks selectively out of one patch and into another. +%For this reason, it is very much worth investing a little time to +%learn how to use some of the third-party tools I described in +%section~\ref{sec:mq:tools}, particularly \command{diffstat} and +%\command{filterdiff}. The former will give you a quick idea of what +%changes your patch is making, while the latter makes it easy to splice +%hunks selectively out of one patch and into another. + +このため,セクション~\ref{sec:mq:tools}で述べたサードパーティ製のいくつか +のツール,特に\command{diffstat}と\command{filterdiff}の使い方を学ぶのは +とても意味がある.前者は,あなたのパッチがどのような変更を加えるのか即座 +に知ることができ,一方で後者はパッチの中のhunkを別のパッチへ挿入するのを +容易にする. + %\section{MQ cookbook} \section{MQクックブック} @@ -1673,7 +1713,7 @@ %Continue by creating a patch stack and making your changes. %\interaction{mq.tarball.qinit} -パッチスタックを作り変更を行う. +新たなパッチスタックを作り,変更を行う. \interaction{mq.tarball.qinit} %Let's say a few weeks or months pass, and your package author releases @@ -1816,7 +1856,7 @@ \hgcmd{add}と\hgcmd{remove}が対応する.また,quiltの\texttt{edit}コマンド に対応するMQコマンドはない. -%%% Local Variables: +%%% Local Variables: %%% mode: yatex %%% TeX-master: "00book" -%%% End: +%%% End: