Mercurial > hgbook
changeset 297:b8105146706f
more undo.tex
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Fri, 08 Feb 2008 02:14:00 +0900 |
parents | 89db0aaf6a29 |
children | 91dda054ead0 |
files | ja/undo.tex |
diffstat | 1 files changed, 58 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/ja/undo.tex Fri Feb 08 01:56:29 2008 +0900 +++ b/ja/undo.tex Fri Feb 08 02:14:00 2008 +0900 @@ -214,40 +214,72 @@ %\section{Reverting the mistaken change} \section{$B4V0c$C$?JQ99$r85$KLa$9(B} -If you make a modification to a file, and decide that you really -didn't want to change the file at all, and you haven't yet committed -your changes, the \hgcmd{revert} command is the one you'll need. It -looks at the changeset that's the parent of the working directory, and -restores the contents of the file to their state as of that changeset. -(That's a long-winded way of saying that, in the normal case, it -undoes your modifications.) +%If you make a modification to a file, and decide that you really +%didn't want to change the file at all, and you haven't yet committed +%your changes, the \hgcmd{revert} command is the one you'll need. It +%looks at the changeset that's the parent of the working directory, and +%restores the contents of the file to their state as of that changeset. +%(That's a long-winded way of saying that, in the normal case, it +%undoes your modifications.) + +$B%U%!%$%k$KJQ99$r2C$($?8e$G!$JQ99$,I,MW$G$J$$$HJ,$+$j!$$^$@%3%_%C%H$5$l$F(B +$B$$$J$$;~$O(B\hgcmd{revert}$B%3%^%s%I$r;H$&$3$H$,$G$-$k!%$3$N%3%^%s%I$O%o!<%-(B +$B%s%0%G%#%l%/%H%j$N?F%A%'%s%8%;%C%H$r;2>H$7!$%U%!%$%k$NFbMF$r%A%'%s%8%;%C(B +$B%H$N>uBV$KLa$9!%!J$3$l$O$"$J$?$,2C$($?JQ99$r$/$I$/$I$7$/=R$Y$?$b$N$G$"(B +$B$k!%!K(B -Let's illustrate how the \hgcmd{revert} command works with yet another -small example. We'll begin by modifying a file that Mercurial is -already tracking. +%Let's illustrate how the \hgcmd{revert} command works with yet another +%small example. We'll begin by modifying a file that Mercurial is +%already tracking. +%\interaction{daily.revert.modify} +%If we don't want that change, we can simply \hgcmd{revert} the file. +%\interaction{daily.revert.unmodify} +%The \hgcmd{revert} command provides us with an extra degree of safety +%by saving our modified file with a \filename{.orig} extension. +%\interaction{daily.revert.status} + +\hgcmd{revert}$B%3%^%s%I$,$I$N$h$&$KF0:n$9$k$+!$JL$N>.$5$JNc$G@bL@$9$k!%(B +$B$9$G$K(BMercurial$B$,4IM}$7$F$$$k%U%!%$%k$rJQ99$7$?$H$3$m$+$i;O$a$k!%(B \interaction{daily.revert.modify} -If we don't want that change, we can simply \hgcmd{revert} the file. +$B$3$NJQ99$,I,MW$G$J$$>l9g!$C1$K%U%!%$%k$K(B\hgcmd{revert}$B$r<B9T$9$l$P$h$$!%(B \interaction{daily.revert.unmodify} -The \hgcmd{revert} command provides us with an extra degree of safety -by saving our modified file with a \filename{.orig} extension. +\hgcmd{revert}$B%3%^%s%I$O0BA4$N$?$a(B\filename{.orig}$B$H$$$&%U%!%$%kL>$GJQ99(B +$B$r%;!<%V$9$k!%(B \interaction{daily.revert.status} -Here is a summary of the cases that the \hgcmd{revert} command can -deal with. We will describe each of these in more detail in the -section that follows. +%Here is a summary of the cases that the \hgcmd{revert} command can +%deal with. We will describe each of these in more detail in the +%section that follows. +%\begin{itemize} +%\item If you modify a file, it will restore the file to its unmodified +% state. +%\item If you \hgcmd{add} a file, it will undo the ``added'' state of +% the file, but leave the file itself untouched. +%\item If you delete a file without telling Mercurial, it will restore +% the file to its unmodified contents. +%\item If you use the \hgcmd{remove} command to remove a file, it will +% undo the ``removed'' state of the file, and restore the file to its +% unmodified contents. +%\end{itemize} + +\hgcmd{revert}$B%3%^%s%I$,07$($k%1!<%9$K$D$$$F$^$H$a$k!%$h$j>\$7$$@bL@$O!$(B +$B8e$N@a$G9T$J$&!%(B + \begin{itemize} -\item If you modify a file, it will restore the file to its unmodified - state. -\item If you \hgcmd{add} a file, it will undo the ``added'' state of - the file, but leave the file itself untouched. -\item If you delete a file without telling Mercurial, it will restore - the file to its unmodified contents. -\item If you use the \hgcmd{remove} command to remove a file, it will - undo the ``removed'' state of the file, and restore the file to its - unmodified contents. +\item $B%U%!%$%k$rJQ99$7$?>l9g!$(B\hgcmd{revert}$B$O%U%!%$%k$rJQ99$5$l$kA0$N>u(B + $BBV$KLa$9!%(B + +\item \hgcmd{add}$B$r<B9T$7$?>l9g!$(B\hgcmd{revert}$B$O(Badd$B$r<h$j>C$9$,!$%U%!%$(B + $B%k<+BN$O$=$N$^$^<j$r?($l$:$K;D$9!%(B +\item Mercurial$B$rA`:n$;$:$K%U%!%$%k$r>C5n$7$F$$$?>l9g!$(B\hgcmd{revert}$B$O(B + $B%U%!%$%k$rJQ99A0$N>uBV$GI|85$9$k(B +\item \hgcmd{remove}$B%3%^%s%I$G%U%!%$%k$r>C5n$7$F$$$?>l9g!$JQ99A0$N>uBV$G(B + $B%U%!%$%k$rI|85$9$k!%(B \end{itemize} -\subsection{File management errors} + +%\subsection{File management errors} +\subsection{$B%U%!%$%k4IM}$N%_%9(B} \label{sec:undo:mgmt} The \hgcmd{revert} command is useful for more than just modified