# HG changeset patch # User Yoshiki Yazawa # Date 1202465649 -32400 # Node ID e5d4fca73f97dba36daee857cad1dc3a723516bf # Parent 5f6ebc8f4e74c8d186fd03fc6866fe2737490a9e more undo.tex diff -r 5f6ebc8f4e74 -r e5d4fca73f97 ja/undo.tex --- a/ja/undo.tex Fri Feb 08 14:44:14 2008 +0900 +++ b/ja/undo.tex Fri Feb 08 19:14:09 2008 +0900 @@ -404,88 +404,148 @@ %\subsection{Backing out a changeset} \subsection{チェンジセットのバックアウト} -The \hgcmd{backout} command lets you ``undo'' the effects of an entire -changeset in an automated fashion. Because Mercurial's history is -immutable, this command \emph{does not} get rid of the changeset you -want to undo. Instead, it creates a new changeset that -\emph{reverses} the effect of the to-be-undone changeset. +%The \hgcmd{backout} command lets you ``undo'' the effects of an entire +%changeset in an automated fashion. Because Mercurial's history is +%immutable, this command \emph{does not} get rid of the changeset you +%want to undo. Instead, it creates a new changeset that +%\emph{reverses} the effect of the to-be-undone changeset. -The operation of the \hgcmd{backout} command is a little intricate, so -let's illustrate it with some examples. First, we'll create a -repository with some simple changes. +\hgcmd{backout}コマンドはチェンジセット全体の作用を打ち消す.Mercurialの +履歴は不変なので,このコマンドは取り消したいチェンジセットを取り除くもの +では\emph{ない}.その代わり,取り除きたいチェンジセットの\emph{逆}の働き +の新たなチェンジセットをを生成する. + +%The operation of the \hgcmd{backout} command is a little intricate, so +%let's illustrate it with some examples. First, we'll create a +%repository with some simple changes. +%\interaction{backout.init} + +\hgcmd{backout}コマンドの動作はやや複雑なので,例を挙げて説明することに +する.まずいくつかの単純な変更のあるリポジトリを考える. \interaction{backout.init} -The \hgcmd{backout} command takes a single changeset ID as its -argument; this is the changeset to back out. Normally, -\hgcmd{backout} will drop you into a text editor to write a commit -message, so you can record why you're backing the change out. In this -example, we provide a commit message on the command line using the -\hgopt{backout}{-m} option. +%The \hgcmd{backout} command takes a single changeset ID as its +%argument; this is the changeset to back out. Normally, +%\hgcmd{backout} will drop you into a text editor to write a commit +%message, so you can record why you're backing the change out. In this +%example, we provide a commit message on the command line using the +%\hgopt{backout}{-m} option. -\subsection{Backing out the tip changeset} +\hgcmd{backout}コマンドはバックアウトすべきチェンジセットのIDを一つ引数に +取る.\hgcmd{backout}はデフォルトでコミットメッセージ入力のためにテキスト +エディタを起動するので.バックアウトの理由を記録しておく.この例では +\hgopt{backout}{-m}オプションを使ってコミットメッセージを記録している. + + +%\subsection{Backing out the tip changeset} +\subsection{tipチェンジセットをバックアウトする} -We're going to start by backing out the last changeset we committed. +%We're going to start by backing out the last changeset we committed. +%\interaction{backout.simple} +%You can see that the second line from \filename{myfile} is no longer +%present. Taking a look at the output of \hgcmd{log} gives us an idea +%of what the \hgcmd{backout} command has done. +%\interaction{backout.simple.log} +%Notice that the new changeset that \hgcmd{backout} has created is a +%child of the changeset we backed out. It's easier to see this in +%figure~\ref{fig:undo:backout}, which presents a graphical view of the +%change history. As you can see, the history is nice and linear. + +最後にコミットしたチェンジセットをバックアウトすることから始める. \interaction{backout.simple} -You can see that the second line from \filename{myfile} is no longer -present. Taking a look at the output of \hgcmd{log} gives us an idea -of what the \hgcmd{backout} command has done. +\filename{myfile}の2行目がなくなっているのが分かると思う.\hgcmd{log}を +見てみると,\hgcmd{backout}が何をしたのかが分かる. \interaction{backout.simple.log} -Notice that the new changeset that \hgcmd{backout} has created is a -child of the changeset we backed out. It's easier to see this in -figure~\ref{fig:undo:backout}, which presents a graphical view of the -change history. As you can see, the history is nice and linear. +\hgcmd{backout}が生成した新しいチェンジセットは,バックアウトしたチェン +ジセットの子になっている.\ref{fig:undo:backout}は更新履歴を図示したもの +で,理解の助けになるはずだ.図から分かるように履歴は線形で整合が取れている. \begin{figure}[htb] \centering \grafix{undo-simple} - \caption{Backing out a change using the \hgcmd{backout} command} +% \caption{Backing out a change using the \hgcmd{backout} command} + \caption{\hgcmd{backout}コマンドを使って更新をバックアウト} \label{fig:undo:backout} \end{figure} -\subsection{Backing out a non-tip change} +%\subsection{Backing out a non-tip change} +\subsection{tipでない変更をバックアウトする} -If you want to back out a change other than the last one you -committed, pass the \hgopt{backout}{--merge} option to the -\hgcmd{backout} command. +%If you want to back out a change other than the last one you +%committed, pass the \hgopt{backout}{--merge} option to the +%\hgcmd{backout} command. +%\interaction{backout.non-tip.clone} +%This makes backing out any changeset a ``one-shot'' operation that's +%usually simple and fast. +%\interaction{backout.non-tip.backout} + +最後のコミット以外の変更をバックアウトしたい時は, +\hgcmd{backout}に\hgopt{backout}{--merge}オプションを付ける. \interaction{backout.non-tip.clone} -This makes backing out any changeset a ``one-shot'' operation that's -usually simple and fast. +このオプションはどんなチェンジセットでも一回の動作で行なうことができ,手 +早く簡単である. \interaction{backout.non-tip.backout} -If you take a look at the contents of \filename{myfile} after the -backout finishes, you'll see that the first and third changes are -present, but not the second. +%If you take a look at the contents of \filename{myfile} after the +%backout finishes, you'll see that the first and third changes are +%present, but not the second. +%\interaction{backout.non-tip.cat} + +バックアウトが終ったあとで\filename{myfile}の中身を見ると,1番目と3番目 +の変更だけが残っており,2番目の変更が消えていることがわかる. \interaction{backout.non-tip.cat} -As the graphical history in figure~\ref{fig:undo:backout-non-tip} -illustrates, Mercurial actually commits \emph{two} changes in this -kind of situation (the box-shaped nodes are the ones that Mercurial -commits automatically). Before Mercurial begins the backout process, -it first remembers what the current parent of the working directory -is. It then backs out the target changeset, and commits that as a -changeset. Finally, it merges back to the previous parent of the -working directory, and commits the result of the merge. +%As the graphical history in figure~\ref{fig:undo:backout-non-tip} +%illustrates, Mercurial actually commits \emph{two} changes in this +%kind of situation (the box-shaped nodes are the ones that Mercurial +%commits automatically). Before Mercurial begins the backout process, +%it first remembers what the current parent of the working directory +%is. It then backs out the target changeset, and commits that as a +%changeset. Finally, it merges back to the previous parent of the +%working directory, and commits the result of the merge. + +図\ref{fig:undo:backout-non-tip}で示された履歴で,Mercurialは2つのコミッ +トを行なっている.(図中で箱で示された節点はMercurialが自動的にコミットし +た変更である.)バックアウトプロセスの前にMercurialは,現在のワーキングディ +レクトリの親が何であるかを記憶する.そしてターゲットのチェンジセットを取 +り除き,これをチェンジセットとしてコミットする.最後にワーキングディレク +トリの前の親へマージを行ない,マージの結果をコミットする. \begin{figure}[htb] \centering \grafix{undo-non-tip} - \caption{Automated backout of a non-tip change using the \hgcmd{backout} command} +% \caption{Automated backout of a non-tip change using the + % \hgcmd{backout} command} + \caption{tipでない変更を\hgcmd{backout}コマンドで自動的にバックアウトする} \label{fig:undo:backout-non-tip} \end{figure} -The result is that you end up ``back where you were'', only with some -extra history that undoes the effect of the changeset you wanted to -back out. +%The result is that you end up ``back where you were'', only with some +%extra history that undoes the effect of the changeset you wanted to +%back out. -\subsubsection{Always use the \hgopt{backout}{--merge} option} +最終的に,いくらかの余計な履歴を残しつつ,取り除きたかったチェンジセット +の影響を除去して,望む状態に戻すことができている. + + +%\subsubsection{Always use the \hgopt{backout}{--merge} option} +\subsubsection{常に\hgopt{backout}{--merge}オプションを使う} -In fact, since the \hgopt{backout}{--merge} option will do the ``right -thing'' whether or not the changeset you're backing out is the tip -(i.e.~it won't try to merge if it's backing out the tip, since there's -no need), you should \emph{always} use this option when you run the -\hgcmd{backout} command. +%In fact, since the \hgopt{backout}{--merge} option will do the ``right +%thing'' whether or not the changeset you're backing out is the tip +%(i.e.~it won't try to merge if it's backing out the tip, since there's +%no need), you should \emph{always} use this option when you run the +%\hgcmd{backout} command. -\subsection{Gaining more control of the backout process} +バックアウトしようとするチェンジセットがチップかチップでないかにか変わら +ず,\hgcmd{backout}コマンドを使おうとする時は\emph{常に} +\hgopt{backout}{--merge}オプションを使うべきである.対象がチップである場 +合は不要なマージを試みることはないため,常にこのオプションを指定して問題 +ない. + + +%\subsection{Gaining more control of the backout process} +\subsection{バックアウトプロセスをより細かく制御する} While I've recommended that you always use the \hgopt{backout}{--merge} option when backing out a change, the