# HG changeset patch # User Yoshiki Yazawa # Date 1202449454 -32400 # Node ID 5f6ebc8f4e74c8d186fd03fc6866fe2737490a9e # Parent 91dda054ead0b69b60ce2298712525148797f47d more undo.tex diff -r 91dda054ead0 -r 5f6ebc8f4e74 ja/undo.tex --- a/ja/undo.tex Fri Feb 08 02:48:57 2008 +0900 +++ b/ja/undo.tex Fri Feb 08 14:44:14 2008 +0900 @@ -311,55 +311,98 @@ %file is called ``missing''). %\interaction{daily.revert.missing} +同様に,\hgcmd{remove}コマンドでファイルを消去した時,\hgcmd{revert}コマ +ンドでワーキングディレクトリの親の内容にファイルを復元することができる. +\interaction{daily.revert.remove} +またMercurialを使わずに手で消したファイルについて同じ操作で復元すること +ができる.(Mercurialの用語でこれをmissingと呼んでいたことを思い出して欲 +しい.) +\interaction{daily.revert.missing} +%If you revert a \hgcmd{copy}, the copied-to file remains in your +%working directory afterwards, untracked. Since a copy doesn't affect +%the copied-from file in any way, Mercurial doesn't do anything with +%the copied-from file. +%\interaction{daily.revert.copy} + +\hgcmd{copy}コマンドを取り消した場合,コピー先のファイルはワーキングディ +レクトリに残るがMercurialからは管理されない.コピー操作自体コピー元ファイ +ルに影響を与えないため,取り消しによってコピー元ファイルが影響を受けるこ +ともない. -If you revert a \hgcmd{copy}, the copied-to file remains in your -working directory afterwards, untracked. Since a copy doesn't affect -the copied-from file in any way, Mercurial doesn't do anything with -the copied-from file. -\interaction{daily.revert.copy} +%\subsubsection{A slightly special case: reverting a rename} +\subsubsection{やや特殊なケース:リネームの取り消し} -\subsubsection{A slightly special case: reverting a rename} +%If you \hgcmd{rename} a file, there is one small detail that +%you should remember. When you \hgcmd{revert} a rename, it's not +%enough to provide the name of the renamed-to file, as you can see +%here. +%As you can see from the output of \hgcmd{status}, the renamed-to file +%is no longer identified as added, but the renamed-\emph{from} file is +%still removed! This is counter-intuitive (at least to me), but at +%least it's easy to deal with. +%So remember, to revert a \hgcmd{rename}, you must provide \emph{both} +%the source and destination names. -If you \hgcmd{rename} a file, there is one small detail that -you should remember. When you \hgcmd{revert} a rename, it's not -enough to provide the name of the renamed-to file, as you can see -here. +\hgcmd{rename}した後では,少し留意しておくべき点がある.リネーム後に +\hgcmd{revert}した場合,ここで説明するように,リネームしたファイルの名前 +を指定するだけでは不十分である. \interaction{daily.revert.rename} -As you can see from the output of \hgcmd{status}, the renamed-to file -is no longer identified as added, but the renamed-\emph{from} file is -still removed! This is counter-intuitive (at least to me), but at -least it's easy to deal with. +\hgcmd{status}の出力から分かるように,リネーム先のファイルはもはやaddさ +れた扱いになっていない.しかしリネーム\emph{元}のファイルはまだ消去され +たままになっている.これは(少なくとも筆者にとって)非直感的だが,取り扱 +いは簡単である. \interaction{daily.revert.rename-orig} -So remember, to revert a \hgcmd{rename}, you must provide \emph{both} -the source and destination names. +\hgcmd{rename}を取り消す際には,元のファイルとリネーム後のファイル +\emph{両方}を指定する必要がある. + +%(By the way, if you rename a file, then modify the renamed-to file, +%then revert both components of the rename, when Mercurial restores the +%file that was removed as part of the rename, it will be unmodified. +%If you need the modifications in the renamed-to file to show up in the +%renamed-from file, don't forget to copy them over.) -(By the way, if you rename a file, then modify the renamed-to file, -then revert both components of the rename, when Mercurial restores the -file that was removed as part of the rename, it will be unmodified. -If you need the modifications in the renamed-to file to show up in the -renamed-from file, don't forget to copy them over.) +(一方,リネームした後にリネーム先のファイルを編集し,リネームの前後のファ +イル名を指定して取り消しを行ない,Mercurialがリネームの際に消去されたファ +イルを修復すると,このファイルは編集前の状態になっている.リネーム後のファ +イルへの変更がリネーム前のファイルに残るようにするには,コピーを作ってお +く必要がある.) -These fiddly aspects of reverting a rename arguably constitute a small -bug in Mercurial. +%These fiddly aspects of reverting a rename arguably constitute a small +%bug in Mercurial. -\section{Dealing with committed changes} +リネームを復元する時に起こる厄介ごとはおそらくMercurialのバグと言えるか +もしれない. + + +%\section{Dealing with committed changes} +\section{コミットされた変更の扱い} -Consider a case where you have committed a change $a$, and another -change $b$ on top of it; you then realise that change $a$ was -incorrect. Mercurial lets you ``back out'' an entire changeset -automatically, and building blocks that let you reverse part of a -changeset by hand. +%Consider a case where you have committed a change $a$, and another +%change $b$ on top of it; you then realise that change $a$ was +%incorrect. Mercurial lets you ``back out'' an entire changeset +%automatically, and building blocks that let you reverse part of a +%changeset by hand. + +$a$をコミットした後で別の$b$をコミットし,ここで$a$は誤りであることに気づ +くいた場合を考える.Mercurialはチェンジセット全体とチェンジセットの一部分 +を手でバックアウトするように促す. -Before you read this section, here's something to keep in mind: the -\hgcmd{backout} command undoes changes by \emph{adding} history, not -by modifying or erasing it. It's the right tool to use if you're -fixing bugs, but not if you're trying to undo some change that has -catastrophic consequences. To deal with those, see -section~\ref{sec:undo:aaaiiieee}. +%Before you read this section, here's something to keep in mind: the +%\hgcmd{backout} command undoes changes by \emph{adding} history, not +%by modifying or erasing it. It's the right tool to use if you're +%fixing bugs, but not if you're trying to undo some change that has +%catastrophic consequences. To deal with those, see +%section~\ref{sec:undo:aaaiiieee}. -\subsection{Backing out a changeset} +この節を読む前に,\hgcmd{backout}コマンドは履歴に\emph{追加}することで取 +り消し操作を行なうことを覚えておいて欲しい.変更や消去ではない.バグの修 +正のために役立つツールだが,変更の取り消しのために用いると破滅的な結果を +もたらす.後者の目的のためには\ref{sec:undo:aaaiiieee}を参照のこと. + +%\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