Mercurial > hgbook
changeset 299:5f6ebc8f4e74
more undo.tex
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Fri, 08 Feb 2008 14:44:14 +0900 |
parents | 91dda054ead0 |
children | e5d4fca73f97 |
files | ja/undo.tex |
diffstat | 1 files changed, 79 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- 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} +$BF1MM$K!$(B\hgcmd{remove}$B%3%^%s%I$G%U%!%$%k$r>C5n$7$?;~!$(B\hgcmd{revert}$B%3%^(B +$B%s%I$G%o!<%-%s%0%G%#%l%/%H%j$N?F$NFbMF$K%U%!%$%k$rI|85$9$k$3$H$,$G$-$k!%(B +\interaction{daily.revert.remove} +$B$^$?(BMercurial$B$r;H$o$:$K<j$G>C$7$?%U%!%$%k$K$D$$$FF1$8A`:n$GI|85$9$k$3$H(B +$B$,$G$-$k!%!J(BMercurial$B$NMQ8l$G$3$l$r(Bmissing$B$H8F$s$G$$$?$3$H$r;W$$=P$7$FM_(B +$B$7$$!%!K(B +\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}$B%3%^%s%I$r<h$j>C$7$?>l9g!$%3%T!<@h$N%U%!%$%k$O%o!<%-%s%0%G%#(B +$B%l%/%H%j$K;D$k$,(BMercurial$B$+$i$O4IM}$5$l$J$$!%%3%T!<A`:n<+BN%3%T!<85%U%!%$(B +$B%k$K1F6A$rM?$($J$$$?$a!$<h$j>C$7$K$h$C$F%3%T!<85%U%!%$%k$,1F6A$r<u$1$k$3(B +$B$H$b$J$$!%(B -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{$B$d$dFC<l$J%1!<%9!'%j%M!<%`$N<h$j>C$7(B} -\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}$B$7$?8e$G$O!$>/$7N10U$7$F$*$/$Y$-E@$,$"$k!%%j%M!<%`8e$K(B +\hgcmd{revert}$B$7$?>l9g!$$3$3$G@bL@$9$k$h$&$K!$%j%M!<%`$7$?%U%!%$%k$NL>A0(B +$B$r;XDj$9$k$@$1$G$OIT==J,$G$"$k!%(B \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}$B$N=PNO$+$iJ,$+$k$h$&$K!$%j%M!<%`@h$N%U%!%$%k$O$b$O$d(Badd$B$5(B +$B$l$?07$$$K$J$C$F$$$J$$!%$7$+$7%j%M!<%`(B\emph{$B85(B}$B$N%U%!%$%k$O$^$@>C5n$5$l(B +$B$?$^$^$K$J$C$F$$$k!%$3$l$O!J>/$J$/$H$bI.<T$K$H$C$F!KHsD>46E*$@$,!$<h$j07(B +$B$$$O4JC1$G$"$k!%(B \interaction{daily.revert.rename-orig} -So remember, to revert a \hgcmd{rename}, you must provide \emph{both} -the source and destination names. +\hgcmd{rename}$B$r<h$j>C$9:]$K$O!$85$N%U%!%$%k$H%j%M!<%`8e$N%U%!%$%k(B +\emph{$BN>J}(B}$B$r;XDj$9$kI,MW$,$"$k!%(B + +%(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.) +$B!J0lJ}!$%j%M!<%`$7$?8e$K%j%M!<%`@h$N%U%!%$%k$rJT=8$7!$%j%M!<%`$NA08e$N%U%!(B +$B%$%kL>$r;XDj$7$F<h$j>C$7$r9T$J$$!$(BMercurial$B$,%j%M!<%`$N:]$K>C5n$5$l$?%U%!(B +$B%$%k$r=$I|$9$k$H!$$3$N%U%!%$%k$OJT=8A0$N>uBV$K$J$C$F$$$k!%%j%M!<%`8e$N%U%!(B +$B%$%k$X$NJQ99$,%j%M!<%`A0$N%U%!%$%k$K;D$k$h$&$K$9$k$K$O!$%3%T!<$r:n$C$F$*(B +$B$/I,MW$,$"$k!%!K(B -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} +$B%j%M!<%`$rI|85$9$k;~$K5/$3$kLq2p$4$H$O$*$=$i$/(BMercurial$B$N%P%0$H8@$($k$+(B +$B$b$7$l$J$$!%(B + + +%\section{Dealing with committed changes} +\section{$B%3%_%C%H$5$l$?JQ99$N07$$(B} -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$r%3%_%C%H$7$?8e$GJL$N(B$b$$B$r%3%_%C%H$7!$$3$3$G(B$a$$B$O8m$j$G$"$k$3$H$K5$$E(B +$B$/$$$?>l9g$r9M$($k!%(BMercurial$B$O%A%'%s%8%;%C%HA4BN$H%A%'%s%8%;%C%H$N0lItJ,(B +$B$r<j$G%P%C%/%"%&%H$9$k$h$&$KB%$9!%(B -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} +$B$3$N@a$rFI$`A0$K!$(B\hgcmd{backout}$B%3%^%s%I$OMzNr$K(B\emph{$BDI2C(B}$B$9$k$3$H$G<h(B +$B$j>C$7A`:n$r9T$J$&$3$H$r3P$($F$*$$$FM_$7$$!%JQ99$d>C5n$G$O$J$$!%%P%0$N=$(B +$B@5$N$?$a$KLrN)$D%D!<%k$@$,!$JQ99$N<h$j>C$7$N$?$a$KMQ$$$k$HGKLGE*$J7k2L$r(B +$B$b$?$i$9!%8e<T$NL\E*$N$?$a$K$O(B\ref{sec:undo:aaaiiieee}$B$r;2>H$N$3$H!%(B + +%\subsection{Backing out a changeset} +\subsection{$B%A%'%s%8%;%C%H$N%P%C%/%"%&%H(B} The \hgcmd{backout} command lets you ``undo'' the effects of an entire changeset in an automated fashion. Because Mercurial's history is