# HG changeset patch # User Yoshiki Yazawa # Date 1215888487 -32400 # Node ID cea705a646496de226d67ddf5ed4b844561a66f0 # Parent f3f56da2e650b676d87e9d20d918cbae387e433d more mq.tex diff -r f3f56da2e650 -r cea705a64649 ja/mq.tex --- a/ja/mq.tex Sun Jul 13 01:01:02 2008 +0900 +++ b/ja/mq.tex Sun Jul 13 03:48:07 2008 +0900 @@ -1156,71 +1156,144 @@ \section{対象コードの変化に合わせてパッチを更新する} \label{sec:mq:merge} -It's common to have a stack of patches on top of an underlying -repository that you don't modify directly. If you're working on -changes to third-party code, or on a feature that is taking longer to -develop than the rate of change of the code beneath, you will often -need to sync up with the underlying code, and fix up any hunks in your -patches that no longer apply. This is called \emph{rebasing} your -patch series. +%It's common to have a stack of patches on top of an underlying +%repository that you don't modify directly. If you're working on +%changes to third-party code, or on a feature that is taking longer to +%develop than the rate of change of the code beneath, you will often +%need to sync up with the underlying code, and fix up any hunks in your +%patches that no longer apply. This is called \emph{rebasing} your +%patch series. + +直接変更しないリポジトリの上にパッチのスタックを管理することはよく行われ +る.サードパーティのコードを変更する作業をしている場合や,元になるコード +の変更頻度に比べて長い時間がかかる機能を開発している場合,しばしば元のコー +ドの同期を行い,パッチの中のもはや適用できなくなったhunkを修正することに +なるだろう.これはパッチの\emph{rebasing}と呼ばれる. + +%The simplest way to do this is to \hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a}} +%your patches, then \hgcmd{pull} changes into the underlying +%repository, and finally \hgcmdargs{qpush}{\hgxopt{mq}{qpop}{-a}} your +%patches again. MQ will stop pushing any time it runs across a patch +%that fails to apply during conflicts, allowing you to fix your +%conflicts, \hgxcmd{mq}{qrefresh} the affected patch, and continue pushing +%until you have fixed your entire stack. -The simplest way to do this is to \hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a}} -your patches, then \hgcmd{pull} changes into the underlying -repository, and finally \hgcmdargs{qpush}{\hgxopt{mq}{qpop}{-a}} your -patches again. MQ will stop pushing any time it runs across a patch -that fails to apply during conflicts, allowing you to fix your -conflicts, \hgxcmd{mq}{qrefresh} the affected patch, and continue pushing -until you have fixed your entire stack. +これを行う最も簡単な方法は,パッチに対して +\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a}}を行い,下位のリポジトリに +\hgcmd{pull}を行う.そして最後にパッチに再び +\hgcmdargs{qpush}{\hgxopt{mq}{qpop}{-a}}を行う. MQはパッチ適用中にコンフ +リクトがあると,いつでもプッシュを停止し,\hgxcmd{mq}{qrefresh}によってコ +ンフリクトを修正する機会を与える.その後にすべてのパッチスタックを適用す +るまでプッシュを続ける. + +%This approach is easy to use and works well if you don't expect +%changes to the underlying code to affect how well your patches apply. +%If your patch stack touches code that is modified frequently or +%invasively in the underlying repository, however, fixing up rejected +%hunks by hand quickly becomes tiresome. -This approach is easy to use and works well if you don't expect -changes to the underlying code to affect how well your patches apply. -If your patch stack touches code that is modified frequently or -invasively in the underlying repository, however, fixing up rejected -hunks by hand quickly becomes tiresome. +このアプローチは簡単で,パッチの適用される下位のコードへの変更がなければ +うまく働く.しかし,パッチスタックが,頻繁に更新されたり,下位リポジトリ +へ侵入的に更新されたりするコードに触れている場合はリジェクトされたコード +の修正は面倒なものになる. + +%It's possible to partially automate the rebasing process. If your +%patches apply cleanly against some revision of the underlying repo, MQ +%can use this information to help you to resolve conflicts between your +%patches and a different revision. + +rebaseプロセスを部分的に自動化することは可能である.パッチが下位のリポジ +トリのいずれかのバージョンにクリーンに適用できるのであれば,MQはこの情報 +を使ってパッチとその他のリビジョンとの間のコンフリクトを解消するのを援助 +する. -It's possible to partially automate the rebasing process. If your -patches apply cleanly against some revision of the underlying repo, MQ -can use this information to help you to resolve conflicts between your -patches and a different revision. - -The process is a little involved. +%The process is a little involved. +このプロセスはやや込み入っている. \begin{enumerate} -\item To begin, \hgcmdargs{qpush}{-a} all of your patches on top of - the revision where you know that they apply cleanly. -\item Save a backup copy of your patch directory using - \hgcmdargs{qsave}{\hgxopt{mq}{qsave}{-e} \hgxopt{mq}{qsave}{-c}}. This prints - the name of the directory that it has saved the patches in. It will - save the patches to a directory called - \sdirname{.hg/patches.\emph{N}}, where \texttt{\emph{N}} is a small - integer. It also commits a ``save changeset'' on top of your - applied patches; this is for internal book-keeping, and records the - states of the \sfilename{series} and \sfilename{status} files. -\item Use \hgcmd{pull} to bring new changes into the underlying - repository. (Don't run \hgcmdargs{pull}{-u}; see below for why.) -\item Update to the new tip revision, using - \hgcmdargs{update}{\hgopt{update}{-C}} to override the patches you - have pushed. -\item Merge all patches using \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m} - \hgxopt{mq}{qpush}{-a}}. The \hgxopt{mq}{qpush}{-m} option to \hgxcmd{mq}{qpush} - tells MQ to perform a three-way merge if the patch fails to apply. +%\item To begin, \hgcmdargs{qpush}{-a} all of your patches on top of +% the revision where you know that they apply cleanly. +\item 最初に,パッチがクリーンに適用できるリビジョンの上で,すべてのパッ + チに対して\hgcmdargs{qpush}{-a}を行う. + +%\item Save a backup copy of your patch directory using +% \hgcmdargs{qsave}{\hgxopt{mq}{qsave}{-e} \hgxopt{mq}{qsave}{-c}}. +% This prints +% the name of the directory that it has saved the patches in. It will +% save the patches to a directory called +% \sdirname{.hg/patches.\emph{N}}, where \texttt{\emph{N}} is a small +% integer. It also commits a ``save changeset'' on top of your + +% applied patches; this is for internal book-keeping, and records the +% states of the \sfilename{series} and \sfilename{status} files. + +\item パッチディレクトリをセーブを + \hgcmdargs{qsave}{\hgxopt{mq}{qsave}{-e} \hgxopt{mq}{qsave}{-c}}を + 用いて行う.パッチをセーブしたディレクトリ名が表示される.このコマ + ンドは,\sdirname{.hg/patches.\emph{N}}というディレクトリにセーブを + 行う.ここで\texttt{\emph{N}}は小さい整数である.このコマンドは``セー + ブチェンジセット''を適用されたパッチの上にコミットする.これは内部 + 的な管理と,\sfilename{series}ファイル及び\sfilename{status}ファイ + ルの状態を記録するためである. + +%\item Use \hgcmd{pull} to bring new changes into the underlying +% repository. (Don't run \hgcmdargs{pull}{-u}; see below for why.) + +\item \hgcmd{pull}コマンドを使って新たな変更を下位のリポジトリに取り込 + む.(\hgcmdargs{pull}{-u}を実行してはいけない.理由については下記 + を参照.) + +%\item Update to the new tip revision, using +% \hgcmdargs{update}{\hgopt{update}{-C}} to override the patches you +% have pushed. + +\item \hgcmdargs{update}{\hgopt{update}{-C}}を用いて,pushしたパッチをオー + バライドして新たなtipリビジョンへのアップデートを行う. + +%\item Merge all patches using \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m} +% \hgxopt{mq}{qpush}{-a}}. The \hgxopt{mq}{qpush}{-m} option to \hgxcmd{mq}{qpush} +% tells MQ to perform a three-way merge if the patch fails to apply. + +\item \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m} \hgxopt{mq}{qpush}{-a}}を + 用いてすべてのパッチのマージを行う.\hgxopt{mq}{qpush}{-m}オプショ + ンを\hgxcmd{mq}{qpush}に付けると,MQはパッチの適用に失敗した場 + 合,3ウェイマージを行う. + \end{enumerate} -During the \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m}}, each patch in the -\sfilename{series} file is applied normally. If a patch applies with -fuzz or rejects, MQ looks at the queue you \hgxcmd{mq}{qsave}d, and -performs a three-way merge with the corresponding changeset. This -merge uses Mercurial's normal merge machinery, so it may pop up a GUI -merge tool to help you to resolve problems. +%During the \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m}}, each patch in the +%\sfilename{series} file is applied normally. If a patch applies with +%fuzz or rejects, MQ looks at the queue you \hgxcmd{mq}{qsave}d, and +%performs a three-way merge with the corresponding changeset. This +%merge uses Mercurial's normal merge machinery, so it may pop up a GUI +%merge tool to help you to resolve problems. + +\hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m}}コマンドの実行 +中,\sfilename{series}内のパッチは通常通り適用される.もしパッチがfuzzや +rejectを出した場合,MQは\hgxcmd{mq}{qsave}したキューを参照し,対応するチェ +ンジセットとの間で3ウェイマージを行う.マージはMercurialの通常の機構を使っ +て行われるため,設定によって問題を解決するためのGUIマージツールなどが起動 +する. + +%When you finish resolving the effects of a patch, MQ refreshes your +%patch based on the result of the merge. -When you finish resolving the effects of a patch, MQ refreshes your -patch based on the result of the merge. +パッチの影響の解決を終えた時,MQはマージの結果を踏まえてパッチのリフレッ +シュを行う. + +%At the end of this process, your repository will have one extra head +%from the old patch queue, and a copy of the old patch queue will be in +%\sdirname{.hg/patches.\emph{N}}. You can remove the extra head using -At the end of this process, your repository will have one extra head -from the old patch queue, and a copy of the old patch queue will be in -\sdirname{.hg/patches.\emph{N}}. You can remove the extra head using -\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a} \hgxopt{mq}{qpop}{-n} patches.\emph{N}} -or \hgcmd{strip}. You can delete \sdirname{.hg/patches.\emph{N}} once -you are sure that you no longer need it as a backup. +%\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a} \hgxopt{mq}{qpop}{-n} patches.\emph{N}} +%or \hgcmd{strip}. You can delete \sdirname{.hg/patches.\emph{N}} once +%you are sure that you no longer need it as a backup. + +このプロセスの最後にリポジトリには古いパッチキューに由来する一つ余分な +headができ,古いパッチキューが\sdirname{.hg/patches.\emph{N}}にコピーされ +る.このheadは\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a} +\hgxopt{mq}{qpop}{-n} patches.\emph{N}}または\hgcmd{strip}によって消去で +きる.バックアップが不要なことが分かれば,\sdirname{.hg/patches.\emph{N}}を +消去しても構わない. %\section{Identifying patches} \section{パッチの識別}