
foozy@708: \chapter{Finding and fixing your mistakes}
foozy@708: \label{chap:undo}
foozy@708: 
foozy@708: $B?M$O4V0c$($k$b$N$G$9$,!"$=$N7k2L$r$h$j>e<j$K07$C$F$3$=!"(B
foozy@708: $BM%$l$?9=@.4IM}%7%9%F%`$H8@$($^$9!#(B
foozy@708: $B$3$N>O$G$O!"(B
foozy@708: $B%W%m%8%'%/%H$KG&$S9~$s$@LdBj$rH/8+$7$?:]$K!"(B
foozy@708: $B;H$($k<jK!$K$D$$$F@bL@$7$^$9!#(B
foozy@708: Mercurial $B$O!"(B
foozy@708: $BLdBj$N85$r3VN%$7E,@Z$K=hM}$9$k$?$a$NM%$l$?5!G=$r;}$C$F$$$^$9!#(B
foozy@708: 
foozy@708: \section{Erasing local history}
foozy@708: 
foozy@708: \subsection{The accidental commit}
foozy@708: 
foozy@708: $BI.<T$O!";~$H$7$F9M$($k$h$j$b@h$KF~NO$7$F$7$^$&!"(B
foozy@708: $B$H$$$&:,?<$$LdBj$rJz$($F$$$k$?$a!"(B
foozy@708: $BIT40A4$G$"$C$?$j!"(B
foozy@708: $BC1=c$K4V0c$C$?FbMF$N%A%'%s%8%;%C%H$r%3%_%C%H$7$F$7$^$&$3$H$,$"$j$^$9!#(B
foozy@708: $BI.<T$N>l9g!"(B
foozy@708: $BIT40A4$J%A%'%s%8%;%C%H$r%3%_%C%H$7$F$7$^$&$N$O!"(B
foozy@708: $B?7$7$$%=!<%9%U%!%$%k$r:n@.$7$?$N$K(B
foozy@708: \hgcmd{add} $B$N<B9T$rK:$l$F$$$k>l9g$,KX$I$G$9!#(B
foozy@708: ``$BC1=c$K4V0c$C$F$$$k(B''$B%A%'%s%8%;%C%H$r%3%_%C%H$7$F$7$^$&%1!<%9$K$O!"(B
foozy@708: $BFC$K6&DLE@$O$"$j$^$;$s$,!"(Bbut $BHs>o$KLBOG(B(no less annoying) XXXXX$B!#(B
foozy@708: 
foozy@708: \subsection{Rolling back a transaction}
foozy@708: \label{sec:undo:rollback}
foozy@708: 
foozy@708: Mercurial $B$,!"(B
foozy@708: $B%j%]%8%H%j$X$N8D!9$NJQ99$r(B\emph{$B%H%i%s%6%/%7%g%s(B}$B$H$7$F07$C$F$$$k$3$H$r(B
foozy@708: \ref{sec:concepts:txn} $B@a$G=R$Y$^$7$?!#(B
foozy@708: $B%A%'%s%8%;%C%H$r%3%_%C%H$7$?$j!"(B
foozy@708: $BB>$N%j%]%8%H%j$+$iJQ99$r(B pull $B$9$k:]$K!"(B
foozy@708: Mercurial $B$O>o$K=hM}$7$?$3$H$r5-O?$7$F$$$^$9!#(B
foozy@708: \hgcmd{rollback} $B%3%^%s%I$r;HMQ$9$k$3$H$G!"(B
foozy@708: $B$-$C$A$j0l2sJ,$N=hM}$r85$KLa$9!"(B
foozy@708: $BJL$J8@$$J}$r$9$k$J$i!"(B\emph{$B4,$-La$9(B}$B$3$H$,$G$-$^$9(B
foozy@708: $B!J$3$N%3%^%s%I$r;HMQ$9$k:]$N=EMW$JCm0U$,=R$Y$i$l$F$$$^$9$N$G!"(B
foozy@708: \ref{sec:undo:rollback-after-push} $B@a$r;2>H$7$F$/$@$5$$!K!#(B
foozy@708: 
foozy@708: $B?7$7$/%U%!%$%k$r:n@.$7$?$N$K!"(B
foozy@708: $B$=$N%U%!%$%k$KBP$7$F(B \hgcmd{add} 
foozy@708: $B%3%^%s%I$r<B9T$9$k$N$rK:$l$F%3%_%C%H$7$F$7$^$&!"(B
foozy@708: $B$H$$$&I.<T$N$h$/$d$k4V0c$$$O!"0J2<$N$h$&$J$b$N$G$9!#(B
foozy@708: 
foozy@708: \interaction{rollback.commit}
foozy@708: 
foozy@708: $B%3%_%C%H8e$N(B \hgcmd{status} $B=PNO$r8+$l$P!"(B
foozy@708: $B$9$0$5$^4V0c$$$r3N>Z$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{rollback.status}
foozy@708: 
foozy@708: $B@h$N%3%_%C%H$O!"(B
foozy@708: \filename{a} $B$NJQ99$OB*$($F$$$^$9$,!"(B
foozy@708: $B?75,$N%U%!%$%k(B \filename{b} $B$OGD0.$7$F$$$^$;$s!#(B
foozy@708: $BF1N=$H6&M-$7$F$$$k%j%]%8%H%j$K!"(B
foozy@708: $B$3$N%A%'%s%8%;%C%H$rH?1G$7$F$7$^$C$?$i!"(B
foozy@708: $BF1N=$,$3$N%A%'%s%8%;%C%H$r<h$j9~$s$@:]$K!"(B
foozy@708: \filename{a} $BCf$N2?$+$,!"(B
foozy@708: $BF1N=$N%j%]%8%H%j$K$OB8:_$7$J$$(B \filename{b} $B$r;2>H$7$F$7$^$$$^$9!#(B
foozy@708: $B$=$&$J$l$P!";d$OF1N=$NJ0$j$NBP>]$K$J$C$F$7$^$&$G$7$g$&!#(B
foozy@708: 
foozy@708: $B$7$+$7!"9,$$$J$3$H$K!"(B
foozy@708: $B%A%'%s%8%;%C%H$r6&M-%j%]%8%H%j$X$HH?1G$9$kA0$K!"(B
foozy@708: $B<+J,$N4V0c$$$r8+$D$1$F$$$^$9!#(B
foozy@708: \hgcmd{rollback} $B%3%^%s%I$r;H$&$3$H$G!"(B
foozy@708: Mercurial $B$O:G8e$N%A%'%s%8%;%C%H$r>C$7$F$/$l$^$9!#(B
foozy@708: 
foozy@708: \interaction{rollback.rollback}
foozy@708: 
foozy@708: $B%j%]%8%H%j$NMzNr>e!":GAa:GA0$N%A%'%s%8%;%C%H$OB8:_$7$^$;$s$N$G!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$O!"(B
foozy@708: $B:F$S(B \filename{a} $B%U%!%$%k$,JQ99$5$l$F$$$k>uBV$@$H$_$J$5$l$^$9!#(B
foozy@708: $B%3%_%C%H8e$N%m!<%k%P%C%/$O!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$r%3%_%C%HA0$N>uBV$=$N$^$^$KLa$7!"(B
foozy@708: $B%A%'%s%8%;%C%H$O40A4$K>C5n$5$l$^$9!#(B
foozy@708: $B$=$&$J$C$?$J$i!"(B
foozy@708: $B0BA4$K(B \filename{b} $B%U%!%$%k$r(B \hgcmd{add} $B$7!"(B
foozy@708: $B:FEY%3%_%C%H$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{rollback.add}
foozy@708: 
foozy@708: \subsection{The erroneous pull}
foozy@708: 
foozy@708: $B#1$D$N(B $B%W%m%8%'%/%H$G!"(B
foozy@708: $BJL!9$K3+H/$N?J$s$G$$$k%V%i%s%A$r(B Mercurial $B$GJ]<i$9$k>l9g!"(B
foozy@708: $B$=$l$>$l0[$J$k%j%]%8%H%j$GJ]<i$9$k$3$H$,0lHLE*$J47=,$H$J$C$F$$$^$9!#(B
foozy@708: $B3+H/%A!<%`$O!"(B
foozy@708: $B%W%m%8%'%/%H$N(B ``0.9'' $B%j%j!<%9MQ$K6&M-%j%]%8%H%j$r;}$D0lJ}$G!"(B
foozy@708: $B0[$J$kJQ99MzNr$r;}$D(B ``1.0'' $B%j%j!<%9MQ$N%j%]%8%H%j$rJLES;}$D$+$b$7$l$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N>l9g!"(B
foozy@708: $B%m!<%+%k$J(B ``0.9'' $B%j%]%8%H%j$,$"$C$F!"(B
foozy@708: $B$=$3$K6vA3(B ``1.0'' $BMQ6&M-%j%]%8%H%j$N@.2L$r<h$j9~$s$@>l9g!"(B
foozy@708: $BLLE]$J;vBV$K$J$k$3$H$,A[A|$G$-$^$9!#(B
foozy@708: $B:G0-$N>l9g!"(B
foozy@708: $B==J,$JCm0U$rJ'$o$J$$$?$a$K!"(B
foozy@708: ``1.0'' $B$N%j%]%8%H%j$+$i<h$j9~$s$@JQ99$r(B
foozy@708: ``0.9'' $B$N6&MQ%j%]%8%H%j$X$HH?1G$7$F$7$^$C$?(B
foozy@708: $B%A!<%`A4BN$r:.Mp$5$;$F$7$^$&$G$7$g$&(B
foozy@708: $B!J$3$N62$m$7$$%1!<%9$K4X$7$F$O!"(B
foozy@708: $B8e$[$I2r7hJ}K!$r<($7$^$9$N$G8f0B?4$r!#!K!#(B
foozy@708: $B$7$+$7!"(B
foozy@708: Mercurial $B$O@.2L<h$j9~$_@h$N(B URL $B$rI=<($9$k$+!"(B
foozy@708: Mercurial 
foozy@708: $B$,2x$7$2$JBgNL$NJQ99$r%j%]%8%H%j$K<h$j9~$s$@$3$H$,I=<($5$l$^$9$+$i!"(B
foozy@708: $B$9$0$K5$IU$/J}$,$"$jF@$^$9(B
foozy@708: \footnote{$BLuCm(B: ``display the URL it's pulling from''
foozy@708: $B$N4X78$,$h$/$o$+$i$J$$(B}$B!#(B
foozy@708: 
foozy@708: \hgcmd{rollback} $B%3%^%s%I$O!"(B
foozy@708: $B:#$^$5$K<h$j9~$s$@A4$F$N%A%'%s%8%;%C%H$r!"(B
foozy@708: $B$-$A$s$He:No$K$7$^$9!#(B
foozy@708: Mercurial $B$O!"0l2s$N(B \hgcmd{pull} $B5/F0$K$h$j<h$j9~$^$l$k%A%'%s%8%;%C%HA4BN$r!"(B
foozy@708: $BC10l$N%H%i%s%6%/%7%g%s$KJ,N`$9$k$N$G!"(B
foozy@708: $B0l2s$N(B \hgcmd{rollback} $B5/F0$G$3$N<:GT$r<h$j>C$9$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \subsection{Rolling back is useless once you've pushed}
foozy@708: \label{sec:undo:rollback-after-push}
foozy@708: 
foozy@708: \hgcmd{rollback} $B$O!"(B
foozy@708: $B0lC6B>$N%j%]%8%H%j$KH?1G$7$?JQ99$G$b!"(B
foozy@708: $B!J<j85$N%j%]%8%H%j$K$*$$$F$O!KL5$+$C$?$3$H$K$G$-$^$9!#(B
foozy@708: $B<h$j>C$7$K$h$jJQ99$O40A4$K>C$5$l$^$9$,!"(B
foozy@708: $B$=$l$,$G$-$k$N$O!"(B
foozy@708: \hgcmd{rollback}  $B$r<B;\$7$?%j%]%8%H%j$K$*$1$k<h$j>C$7(B\emph{$B$N$_(B}$B$G$9!#(B
foozy@708: $B<h$j>C$7$OMzNr$r:o=|$7$^$9$N$G!"(B
foozy@708: $BJQ99$N<h$j>C$7$r%j%]%8%H%j4V$GEAGE$9$k<jCJ$,L5$$$N$G$9!#(B
foozy@708: 
foozy@708: $BJQ99$rB>$N%j%]%8%H%j(B--$BE57?E*$JNc$G$O6&M-%j%]%8%H%j(B--$B$KH?1G$7$?>l9g!"(B
foozy@708: $BK\<AE*$K$O!"$=$NJQ99$O(B``$BLn@8$KF($2=P$7(B''$B$F$*$j!"(B
foozy@708: $B<h$j>C$7$H$OJL$JJ}K!$G4V0c$$$rKd$a9g$o$;$kI,MW$,$"$j$^$9!#(B
foozy@708: $BJQ99$rB>$N%j%]%8%H%j$KH?1G$7!"(B
foozy@708: $B!J<j85$N%j%]%8%H%j$G!K$=$NJQ99$r<h$j>C$7$?8e$G!"(B
foozy@708: $BJQ99$rH?1G$7$?%j%]%8%H%j$+$iJQ99$r<h$j9~$s$@;~$K$O!"(B
foozy@708: $B<h$j>C$7$?JQ99$,!J<j85$N%j%]%8%H%j$K!K:F$S8=$l$^$9!#(B
foozy@708: 
foozy@708: $B!J<h$j>C$7$?$$JQ99$,!"JQ99$rH?1G$7$?%j%]%8%H%j$K$*$1$k:G?7$N$b$N$G!"(B
foozy@708: \emph{$B3n$D(B}$B!"(B
foozy@708: $BC/$b$=$l$r$=$N%j%]%8%H%j$+$i<h$j9~$s$G$$$J$$$3$H$,3N<B$G$"$k>l9g!"(B
foozy@708: $B$=$NJQ99$r<h$j>C$9$3$H$b$G$-$^$9$,!"(B
foozy@708: $B<h$j>C$7$,5!G=$9$k$3$H$K$O0MB8$7$J$$$h$&$K$7$F$/$@$5$$!#(B
foozy@708: $BCY$+$lAa$+$lJQ99$OD>@\?($k$3$H$N$G$-$J$$(B
foozy@708: $B!J$"$k$$$OB8:_$rK:$l$F$$$?!K%j%]%8%H%j$X$HH?1G$5$l!"(B
foozy@708: $B2s$j$^$o$C$FLa$C$F$-$?;~$K3z$_IU$+$l$F$7$^$$$^$9!#(B
foozy@708: $B!K(B
foozy@708: 
foozy@708: \subsection{You can only roll back once}
foozy@708: 
foozy@708: Mercurial $B$O!"(B
foozy@708: $BEv3:%j%]%8%H%j$K$*$1$k:G$b:G?7$N%H%i%s%6%/%7%g%s$r!"(B
foozy@708: $B#1$D$@$1%H%i%s%6%/%7%g%s%m%0$K5-O?$7$^$9!#(B
foozy@708: $B$=$N$?$a!"<h$j>C$;$k%H%i%s%6%/%7%g%s$O#1$DJ,$@$1$G$9!#(B
foozy@708: $B%H%i%s%6%/%7%g%s$r#1$D<h$j>C$7$?8e$G!"(B
foozy@708: $B$=$NA0$N%H%i%s%6%/%7%g%s$b<h$j>C$;$k$3$H$r4|BT$7$F$b!"(B
foozy@708: $B4|BTDL$j$N7k2L$OF@$i$l$^$;$s!#(B
foozy@708: 
foozy@708: \interaction{rollback.twice}
foozy@708: 
foozy@708: $B$"$k%j%]%8%H%j$G%H%i%s%6%/%7%g%s$N<h$j>C$7$r9T$C$?>l9g!"(B
foozy@708: $BJL$JJQ99$r%3%_%C%H$9$k$J$j<h$j9~$`$J$j$7$J$$8B$j!"(B
foozy@708: $B$=$N%j%]%8%H%j$G<h$j>C$7$r9T$&$3$H$O$G$-$^$;$s!#(B
foozy@708: 
foozy@708: \section{Reverting the mistaken change}
foozy@708: 
foozy@708: $B%U%!%$%k$rJQ99$7$?8e$G!"(B
foozy@708: $B%U%!%$%k$NJQ99$,A4$/I,MW$J$$$3$H$K5$IU$$$?>l9g!"(B
foozy@708: $BJQ99$r%3%_%C%H$9$kA0$G$"$l$P!"(B
foozy@708: \hgcmd{revert} $B%3%^%s%I$,MxMQ$G$-$^$9!#(B
foozy@708: $B$3$N%3%^%s%I$O!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$N?F%A%'%s%8%;%C%H$r;2>H$7!"(B
foozy@708: $B%U%!%$%k$NFbMF$r85$N>uBV$KLa$7$^$9!#(B
foozy@708: $B!J@bL@$9$k$HD9$/$J$j$^$9$,!"(B
foozy@708: $BDL>o$N>l9g!"$3$N%3%^%s%I$OJQ99$r<h$j>C$7$^$9!#!K(B
foozy@708: 
foozy@708: \hgcmd{revert} $B%3%^%s%I$N5!G=$r!"(B
foozy@708: $B$A$g$C$H$7$?%5%s%W%k$G@bL@$7$^$9!#(B
foozy@708: Mercurial $B$K$h$j4{$K9=@.4IM}$5$l$F$$$k%U%!%$%k$rJQ99$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.modify}
foozy@708: 
foozy@708: $BJQ99$,I,MW$J$$>l9g!"(B
foozy@708: $BC1=c$K(B \hgcmd{revert} $B%3%^%s%I$r%U%!%$%k$KE,MQ$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.unmodify}
foozy@708: 
foozy@708: \hgcmd{revert} $B%3%^%s%I$O!"(B
foozy@708: $B$"$kDxEY$N0BA4@-$r3NJ]$9$k$?$a$K!"(B
foozy@708: \filename{.orig} $B3HD%;RIU$-$N%U%!%$%k$K!"(B
foozy@708: $BJQ99$5$l$?%U%!%$%k$NFbMF$rJ]B8$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.status}
foozy@708: 
foozy@708: \hgcmd{revert} $B%3%^%s%I$,07$&$3$H$N$G$-$k>u67$r0J2<$K$^$H$a$^$9!#(B
foozy@708: $B8D!9$N>u67$K4X$9$k>\:Y$O!"0J8e$N@a$G@bL@$7$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B%U%!%$%k$,JQ99$5$l$F$$$?$J$i!"JQ99A0$N>uBV$KLa$7$^$9!#(B
foozy@708: 
foozy@708: \item $B%U%!%$%k$,(B \hgcmd{add} $B$5$l$F$$$?$J$i!"(B
foozy@708:   $B%U%!%$%k$N(B``$BDI2C(B''$B$5$l$F$$$k>uBV$r<h$j>C$7$^$9$,!"(B
foozy@708:   $B%U%!%$%k$=$N$b$N$K$O2?$bJQ99$r9T$$$^$;$s!#(B
foozy@708: 
foozy@708: \item Mercurial $B$X$N;X<(L5$/%U%!%$%k$r:o=|$7$F$$$?$J$i!"(B
foozy@708:   $BJQ99A0(B\footnote{$BLuCm(B: ``$B:o=|A0(B''$B$G$O$J$$E@$KCm0U(B}$B$N>uBV$KLa$7$^$9!#(B
foozy@708: 
foozy@708: \item \hgcmd{remove} $B%3%^%s%I$G%U%!%$%k$r:o=|$7$F$$$?$J$i!"(B
foozy@708:   $B%U%!%$%k$N(B``$B:o=|$5$l$?(B''$B>uBV$r<h$j>C$7!"(B
foozy@708:   $BJQ99A0$N>uBV$KLa$7$^$9!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: \subsection{File management errors}
foozy@708: \label{sec:undo:mgmt}
foozy@708: 
foozy@708: \hgcmd{revert} $B$OJQ99$5$l$?%U%!%$%k0J30$KBP$7$F$bM-MQ$J%3%^%s%I$G$9!#(B
foozy@708: $B$3$N%3%^%s%I$O!"(B
foozy@708: Mercurial $B$NA4$F$N%U%!%$%k4IM}%3%^%s%I(B
foozy@708: ---\hgcmd{add} $B$d(B \hgcmd{remove} $B$J$I(B---
foozy@708: $B$N<B;\$rH?E>$5$;$^$9!#(B
foozy@708: 
foozy@708: $B%U%!%$%k$KBP$7$F(B \hgcmd{add} $B$r9T$C$?8e$G!"(B
foozy@708: $B$=$N%U%!%$%k$r(B Mercurial $B$G9=@.4IM}$9$kI,MW$,L5$$$3$H$K5$IU$$$?$J$i!"(B
foozy@708: \hgcmd{revert} $B$K$h$j%U%!%$%k$NDI2C$r<h$j>C$;$^$9!#(B
foozy@708: Mercurial $B$O%U%!%$%k<+BN$K$O2?$bJQ99$r9T$$$^$;$s$N$G0B?4$7$F$/$@$5$$!#(B
foozy@708: $B%U%!%$%kDI2C$N<h$j>C$7$O!"(B
foozy@708: $B%U%!%$%k$KBP$7$F(B``$B0u$r>C$9(B''$B$@$1$G$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.add}
foozy@708: 
foozy@708: $BF1MM$K!"(B
foozy@708: $B%U%!%$%k$KBP$7$F(B \hgcmd{remove} $B$r9T$C$?8e$G$b!"(B
foozy@708: \hgcmd{revert} $B$r;H$&$3$H$G!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$N?F%A%'%s%8%;%C%H$K$*$1$k>uBV$K!"(B
foozy@708: $B%U%!%$%k$NFbMF$rI|5l$9$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.remove}
foozy@708: 
foozy@708: $B$3$l$O!"(BMercurial $B$rDL$5$:$K<jF0$G:o=|$7$?%U%!%$%k(B
foozy@708: $B!J(BMercurial $B$NMQ8l$G$O$3$N<o$N%U%!%$%k$,(B``$BJ6<:(B''(missing)
foozy@708: $B$H8F$P$l$k$3$H$r;W$$=P$7$F$/$@$5$$!K$G$"$C$F$b5!G=$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.missing}
foozy@708: 
foozy@708: \hgcmd{copy} $B$5$l$?%U%!%$%k$K<h$j>C$7$r9T$C$?>l9g!"(B
foozy@708: $BJ#@=@h%U%!%$%k$O:n6HNN0h%G%#%l%/%H%j$K!"(B
foozy@708: $B9=@.4IM}$5$l$J$$>uBV$G$=$N$^$^;D$j$^$9!#(B
foozy@708: $BJ#@=A`:n$OJ#@=85%U%!%$%k$K$O2?$b:nMQ$7$J$$$N$G!"(B
foozy@708: $B<h$j>C$7$N:]$K(B Mercurial $B$OJ#@=85%U%!%$%k$KBP$7$FFC$K2?$b$7$^$;$s!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.copy}
foozy@708: 
foozy@708: \subsubsection{A slightly special case: reverting a rename}
foozy@708: 
foozy@708: 
foozy@708: $B%U%!%$%k$KBP$7$F(B \hgcmd{rename} $B$r9T$C$?>l9g!"(B
foozy@708: $B3P$($F$$$FM_$7$$$3$H$,$"$j$^$9!#(B
foozy@708: \hgcmd{rename} $B<B9T$KBP$7$F(B \hgcmd{revert} $B$r9T$&:]$K$O!"(B
foozy@708: $B0J2<$K<($9$h$&$K!"(B
foozy@708: $BJQ998e$N%U%!%$%kL>$r;XDj$7$?$@$1$G$OIT==J,$G$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.rename}
foozy@708: 
foozy@708: \hgcmd{status} $B%3%^%s%I$N=PNO$+$i$b$o$+$k$h$&$K!"(B
foozy@708: $BJQL>8e$N%U%!%$%k$O4{$KL$DI2C>uBV$HG'<1$5$l$F$$$^$9$,!"(B
foozy@708: $BJQL>(B\emph{$BA0(B}$B$N%U%!%$%k$OL$$@$K:o=|>uBV$HG'<1$5$l$F$$$^$9!*(B
foozy@708: $B$3$l$O!J>/$J$/$H$bCx<T$K$H$C$F$O!KD>46$KH?$7$^$9$,!"(B
foozy@708: $B07$$$O4JC1$G$9!#(B
foozy@708: 
foozy@708: \interaction{daily.revert.rename-orig}
foozy@708: 
foozy@708: \hgcmd{rename} $B$N<h$j>C$7$r9T$&$K$O!"(B
foozy@708: $BJQL>A08e$N%U%!%$%kL>$r(B\emph{$BN>J}(B}$B;XDj$9$k$3$H$rK:$l$J$$$G$/$@$5$$!#(B
foozy@708: 
foozy@708: $B!J$A$J$_$K!"(B
foozy@708: $B%U%!%$%k$NJQL>8e$K!"JQL>8e$N%U%!%$%k$rJQ99$7!"(B
foozy@708: $B$=$l$+$iJQL>A08e$N%U%!%$%kL>$NN>J}$r;XDj$7$F<h$j>C$7$r9T$C$?>l9g!"(B
foozy@708: Mercurial $B$OJQL>$N:]$K:o=|$5$l$?%U%!%$%k(B\footnote{$BLuCm(B: $BJQL>A0$N%U%!%$%k(B
foozy@708: }$B$r2?$bJQ99$5$l$F$$$J$$>uBV$KLa$7$^$9!#(B
foozy@708: $BJQL>8e$N%U%!%$%k$KBP$9$kJQ99$rJQL>A0%U%!%$%k$KH?1G$7$?$$>l9g$K$O!"(B
foozy@708: $BJQL>8e%U%!%$%k$+$iJQL>A0%U%!%$%k$X$N%3%T!<$rK:$l$J$$$G$/$@$5$$!#(B
foozy@708: $B!K(B
foozy@708: 
foozy@708: $BJQL>$N<h$j>C$7$K$*$1$k$3$l$i$NLq2p$JB&LL$O!"(B
foozy@708: $B$*$=$i$/(B Mercurial $B$N>.$5$J%P%0$KM3Mh$9$k$b$N$G$9!#(B
foozy@708: 
foozy@708: \section{Dealing with committed changes}
foozy@708: 
foozy@708: $B$"$kJQ99(B $a$ $B$r%3%_%C%H$7!"$=$N>e$GJL$NJQ99(B $b$ $B$r%3%_%C%H$7$?8e$G!"(B
foozy@708: $BJQ99(B $a$ $B$,4V0c$C$F$$$?$3$H$K5$IU$$$?$H$7$^$9!#(B
foozy@708: Mercurial $B$K$O!"(B
foozy@708: $B%A%'%s%8%;%C%H$=$N$b$N$r<+F0E*$K(B``$BL5$+$C$?$3$H$K$9$k(B''$B5!G=$d!"(B
foozy@708: $B%A%'%s%8%;%C%H$N0lIt$r<jF0$GL58z$K$9$k$?$a$N>pJs$rDs6!$9$k5!G=$,$"$j$^$9!#(B
foozy@708: 
foozy@708: $B$3$N@a$rFI$`A0$K!"3P$($F$*$$$FM_$7$$$3$H$,4v$D$+$"$j$^$9!#(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$K$h$kJQ99$N<h$j>C$7$O!"(B
foozy@708: $BMzNr$r(B\emph{$BDI2C(B}$B$9$k$3$H$G9T$o$l$k$b$N$G$"$j!"(B
foozy@708: $BJQ99$=$N$b$N$r=$@5$7$?$j:o=|$7$?$j$9$k$b$N$G$O$"$j$^$;$s!#(B
foozy@708: $B$=$N$?$a!"%P%0$N=$@5$r$9$k$N$K$O8~$$$F$$$^$9$,!"(B
foozy@708: $BGK2uE*$J7k2L$rH<$&<h$j>C$7$H$$$C$?MQES$K$O8~$$$F$$$^$;$s!#(B
foozy@708: $B$=$N$h$&$J<h$j>C$7$K4X$7$F$O!"(B
foozy@708: ~\ref{sec:undo:aaaiiieee} $B@a$r;2>H$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \subsection{Backing out a changeset}
foozy@708: 
foozy@708: \hgcmd{backout} $B%3%^%s%I$O!"(B
foozy@708: $B<+F02=$5$l$?7A<0$G%A%'%s%8%;%C%H$N8z2LA4BN$r(B``$B<h$j>C$7(B''$B$^$9!#(B
foozy@708: Mercurial $B$NMzNr$O2~JQ$G$-$J$$$N$G!"(B
foozy@708: $B$3$N%3%^%s%I$O<h$j>C$7$?$$%A%'%s%8%;%C%H$r<h$j=|$$$?$j$O(B\emph{$B$7$^$;$s(B}$B!#(B
foozy@708: $B$=$NBe$o$j$K$3$N%3%^%s%I$O!"(B
foozy@708: $B<h$j>C$7$?$$%A%'%s%8%;%C%H$K$h$k2~JQFbMF$r(B\emph{$BH?E>(B}$B$5$;$k!"(B
foozy@708: $B?7$?$J%A%'%s%8%;%C%H$r:n@.$7$^$9!#(B
foozy@708: 
foozy@708: \hgcmd{backout} $B%3%^%s%I$NA`:n$O>/!9J#;($G$9$N$G!"Nc$r;H$C$F@bL@$7$^$9!#(B
foozy@708: $B$^$:$OC1=c$J%A%'%s%8%;%C%H$r4v$D$+;}$D%j%]%8%H%j$r:n@.$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.init}
foozy@708: 
foozy@708: \hgcmd{backout} $B%3%^%s%I$O!"(B
foozy@708: ``bakc out''$BBP>]$H$9$kC10l$N%A%'%s%8%;%C%H<1JL;R$r0z?t$K<h$j$^$9!#(B
foozy@708: $BDL>o!"(B
foozy@708: \hgcmd{backout} 
foozy@708: $B$O%3%_%C%H%a%C%;!<%8$r=q$/$?$a$K%F%-%9%H%(%G%#%?$r5/F0$7$^$9$N$G!"(B
foozy@708: $BJQ99$r(B back out $B$9$kM}M3$r5-O?$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B$3$NNc$G$O!"(B
foozy@708: \hgopt{backout}{-m} $B%*%W%7%g%s$rMQ$$$k$3$H$G!"(B
foozy@708: $B%3%^%s%I%i%$%s$+$i%3%_%C%H%a%C%;!<%8$rM?$($F$$$^$9!#(B
foozy@708: 
foozy@708: \subsection{Backing out the tip changeset}
foozy@708: 
foozy@708: $B0J2<$NNc$G$O!"(B
foozy@708: $B:G8e$K%3%_%C%H$7$?%A%'%s%8%;%C%H$r(B back out $B$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.simple}
foozy@708: 
foozy@708: \filename{myfile} $B$,4{$K#29TL\$r;}$?$J$$$3$H$,$*$o$+$j$G$7$g$&!#(B
foozy@708: \hgcmd{log} $B=PNO$r8+$l$P!"(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$,2?$r9T$C$?$+$rM}2r$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.simple.log}
foozy@708: 
foozy@708: \hgcmd{backout} $B$,@8@.$7$??7$7$$%A%'%s%8%;%C%H$O!"(B
foozy@708: back out $B$7$?%A%'%s%8%;%C%H$N;R%A%'%s%8%;%C%H$H$J$kE@$KCm0U$7$F$/$@$5$$!#(B
foozy@708: $BJQ99MzNr$r?^<($7$?(B \ref{fig:undo:backout}~$B?^$r8+$l$P!"(B
foozy@708: $B$3$N$3$H$,$o$+$k$G$7$g$&!#(B
foozy@708: $B$4Mw$NDL$j!"MzNr$O8+;v$K0lD>@~$G$9!#(B
foozy@708: 
foozy@708: \begin{figure}[htb]
foozy@708:   \centering
foozy@708:   \grafix{undo-simple}
foozy@708:   \label{fig:undo:backout}
foozy@708:   \caption{Backing out a change using the \hgcmd{backout} command}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \subsection{Backing out a non-tip change}
foozy@708: 
foozy@708: $B:G8e$K%3%_%C%H$7$?%A%'%s%8%;%C%H0J30$r(B back out $B$7$?$$>l9g!"(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$K(B
foozy@708: \hgopt{backout}{--merge} $B%*%W%7%g%s$r;XDj$7$F$/$@$5$$!#(B
foozy@708: 
foozy@708: \interaction{backout.non-tip.clone}
foozy@708: 
foozy@708: $B$3$N%3%^%s%I<B9T$O!"(B
foozy@708: $BG$0U$N%A%'%s%8%;%C%H$r!"(B
foozy@708: $B4JC1$GAGAa$$(B``$B0l2s8B$j$N(B''$BA`:n$G(B back out $B$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.non-tip.backout}
foozy@708: 
foozy@708: back out $B40N;8e$N(B \filename{myfile} $B$NFbMF$K$O!"(B
foozy@708: $B#12sL\$H#32sL\$NJQ99$KAjEv$9$kFbMF$O8+$k$3$H$,$G$-$^$9$,!"(B
foozy@708: $B#22sL\$NJQ99$KAjEv$9$kFbMF$O8+$k$3$H$,$G$-$J$$$G$7$g$&!#(B
foozy@708: 
foozy@708: \interaction{backout.non-tip.cat}
foozy@708: 
foozy@708: $BMzNr$r?^<($7$?(B \ref{fig:undo:backout-non-tip}~$B?^$K8+$i$l$k$h$&$K!"(B
foozy@708: $B$3$N$h$&$J>u67$N>l9g!"(B
foozy@708: Mercurial $B$O<B:]$K$O(B\emph{$B#2$D(B}$B$N%A%'%s%8%;%C%H$r%3%_%C%H$7$^$9(B
foozy@708: $B!J(BMercurial $B$,<+F0E*$K%3%_%C%H$7$?$b(B\footnote{$BLuCm(B: 
foozy@708: $B<B9TNc$G(B Mercurial $B$,=PNO$9$k%a%C%;!<%8$r8+$l$P$o$+$k$h$&$K!"(B
foozy@708: $B%^!<%8$5$l$?%A%'%s%8%;%C%H$N%3%_%C%H$OMxMQ<T@UG$$H$J$C$F$$$k$?$a!"(B
foozy@708: $B!V<+F0E*$K%3%_%C%H!W$7$?$b$N$G$O$J$/(B
foozy@708: $B!V<+F0E*$K@8@.$7$?$b$N!W$,@5$7$$I=8=$G$9!#(B}$B$N$O6k7A$G<($7$F$"$j$^$9!K!#(B
foozy@708: Mercurial $B$O(B back out $B=hM}$r;O$a$kA0$K!"(B
foozy@708: $B8=;~E@$G$N:n6HNN0h%G%#%l%/%H%j$K$*$1$k?F%A%'%s%8%;%C%H$r3P$($F$*$-$^$9!#(B
foozy@708: $B$=$N>e$GBP>]%A%'%s%8%;%C%H$r(B back out $B$7!"(B
foozy@708: $B%A%'%s%8%;%C%H$H$7$F%3%_%C%H$7$^$9!#(B
foozy@708: $B:G8e$K!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$N?F%A%'%s%8%;%C%H$H%^!<%8$7$?7k2L$r%3%_%C%H$7$^$9(B
foozy@708: footnote{$BLuCm(B: $BA0=R$N$h$&$K!"<+F0E*$K$O%3%_%C%H$5$l$^$;$s(B}$B!#(B
foozy@708: 
foozy@708: \begin{figure}[htb]
foozy@708:   \centering
foozy@708:   \grafix{undo-non-tip}
foozy@708:   \label{fig:undo:backout-non-tip}
foozy@708:   \caption{Automated backout of a non-tip change using the \hgcmd{backout} command}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $B7k2L$H$7$F!"(B
foozy@708: back out $B$7$?$$%A%'%s%8%;%C%H$K$h$kJQ99FbMF$r<h$j>C$9$?$a$N!"(B
foozy@708: $B4v$D$+$NM>J,$JMzNr$N$_$rH<$C$F!"(B
foozy@708: ``$B0JA0$N>uBV$X$NI|5l(B''$B$,9T$o$l$^$9!#(B
foozy@708: 
foozy@708: \subsubsection{Always use the \hgopt{backout}{--merge} option}
foozy@708: 
foozy@708: $B<B$N$H$3$m!"(B
foozy@708: back out $BBP>]$N%A%'%s%8%;%C%H$,(B tip $B$+H]$+$K4X$o$i$:!"(B
foozy@708: \hgopt{backout}{--merge} $B%*%W%7%g%s$O(B``$B@5$7$/5!G=(B''$B$7$^$9(B
foozy@708: $B!J(Bback out $BBP>]$,(B tip $B$N>l9g$O!"I,MW$,L5$$$N$G%^!<%8$7$h$&$H$O$7$^$;$s!K(B
foozy@708: $B$N$G!"(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$r<B9T$9$k:]$K$O(B\emph{$B>o$K(B}
foozy@708: \hgopt{backout}{--merge} $B%*%W%7%g%s$r;XDj$9$k$Y$-$G$7$g$&!#(B
foozy@708: 
foozy@708: \subsection{Gaining more control of the backout process}
foozy@708: 
foozy@708: $B@h$N5-=R$G$O!"JQ99$N(B back out $B$N:]$N(B
foozy@708: \hgopt{backout}{--merge} $B%*%W%7%g%s$N>oMQ$r?d>)$7$^$7$?$,!"(B
foozy@708: $B$=$N0lJ}$G!"(B
foozy@708: back out $BBP>]$H$J$k%A%'%s%8%;%C%H$N%^!<%8J}K!$r!"(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$NMxMQ<T$,7hDj$9$k$3$H$b$G$-$^$9!#(B
foozy@708: back out $B=hM}$r<jF0$G@)8f$9$kI,MW$OLGB?$K$"$j$^$;$s$,!"(B
foozy@708: $B<jF0@)8f$NJ}K!$rCN$k$3$H$O!"(B
foozy@708: \hgcmd{backout} $B$,<+F0E*$K9T$C$F$$$k$3$H$NFb>p$rM}2r$9$k>e$GM-MQ$G$9!#(B
foozy@708: $B<jF0@)8f$N@bL@$N$?$a$K!"(B
foozy@708: $B:G=i$K:n@.$7$?%j%]%8%H%j$rJ#@=$7$^$9$,!"(B
foozy@708: $B$3$3$G$O(B back out $B$O9T$$$^$;$s!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.clone}
foozy@708: 
foozy@708: $B@h$NNc$HF1MM$K!"(B
foozy@708: $BBh#3$N%A%'%s%8%;%C%H$r%3%_%C%H$7!"(B
foozy@708: $B$=$N>e$G$=$N?F$r(B back out $B$7$?7k2L$r8+$F$_$^$7$g$&!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.backout} 
foozy@708: 
foozy@708: $B?7$?$J%A%'%s%8%;%C%H$bBh#3$N%A%'%s%8%;%C%HF1MM$K!"(B
foozy@708: back out $BBP>]$N%A%'%s%8%;%C%H$N;R$K$J$j$^$9$N$G!"(B
foozy@708: $B$=$l$^$G(B tip $B$@$C$?%A%'%s%8%;%C%H(B\footnote{$BLuCm(B: $BBh#3$N%A%'%s%8%;%C%H$N$3$H(B}
foozy@708: $B$N;R(B\emph{$B$G$O$J$/(B}$B!"?7$?$J%X%C%I$K$J$j$^$9!#(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$O!"(B
foozy@708: $B$3$N$3$H$r9p$2$kHs>o$K$O$C$-$j$H$7$?%a%C%;!<%8$rI=<($7$F$$$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.log}
foozy@708: 
foozy@708: $B$3$3$G$b!"(B
foozy@708: $BMzNr$r?^<($7$?(B\ref{fig:undo:backout-manual}~$B?^$r8+$k$3$H$G!"(B
foozy@708: $B$I$&$$$C$?>u67$K$"$k$N$+$,M}2r$70W$$$H;W$$$^$9!#(B
foozy@708: $B$3$N?^$+$i!"(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$r(B tip $B0J30$N%A%'%s%8%;%C%H$KE,MQ$7$?:]$K!"(B
foozy@708: Mercurial $B$,?7$7$$%X%C%I$r%j%]%8%H%j$KDI2C$9$k(B
foozy@708: $B!J(BMercurial $B$K$h$jDI2C$5$l$?%A%'%s%8%;%C%H$O6k7A$GI=$7$F$$$^$9!K(B
foozy@708: $B$3$H$,$h$/$o$+$j$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[htb]
foozy@708:   \centering
foozy@708:   \grafix{undo-manual}
foozy@708:   \label{fig:undo:backout-manual}
foozy@708:   \caption{Backing out a change using the \hgcmd{backout} command}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \hgcmd{backout} $B%3%^%s%I$N<B9T$,40N;$9$k$H!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$N?F%A%'%s%8%;%C%H$,!"(B
foozy@708: $B?7$7$$(B ``backout'' $B%A%'%s%8%;%C%H$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.parents}
foozy@708: 
foozy@708: $B$3$N;~E@$G!"#2$D$NFHN)$7$?JQ99$N$^$H$^$j(B
foozy@708: \footnote{$BLuCm(B: $B%^!<%8$,I,MW$J!VJ#?t%X%C%I>uBV!W$N$3$H$r;X$7$F$$$k$H;W$o$l$^$9(B}
foozy@708: $B$,B8:_$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.heads}
foozy@708: 
foozy@708: $B$3$N;~E@$G!"(B\filename{myfile} 
foozy@708: $B$O$I$N$h$&$JFbMF$G$"$k$3$H$,4|BT$5$l$k$+$r9M$($F$_$^$7$g$&!#(B
foozy@708: $BBh#1$NJQ99$O(B back out $B$7$F$$$^$;$s$+$i!"(B
foozy@708: $B$=$l$K4X$9$kFbMF$OB8:_$7$F$$$J$1$l$P$J$j$^$;$s!#(B
foozy@708: $BBh#2$NJQ99$O(B back out $B$7$^$7$?$N$G!"(B
foozy@708: $B$=$l$K4X$9$kFbMF$O>C<:$7$F$$$J$1$l$P$J$j$^$;$s!#(B
foozy@708: $BMzNr?^$GJL8D$N%X%C%I$H$7$F?^<($5$l$F$$$k$h$&$K!"(B
foozy@708: $BBh#3$NJQ99$K4X$9$kFbMF$,(B
foozy@708: \filename{myfile} $B$KB8:_$7$F$O(B\emph{$B$J$j$^$;$s(B}$B!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.cat}
foozy@708: 
foozy@708: $BBh#3$NJQ99$NFbMF$r%U%!%$%k$K<h$j9~$`$K$O!"(B
foozy@708: $B#2$D$N%X%C%I$r$$$D$b$N$h$&$K%^!<%8$9$l$PNI$$$N$G$9!#(B
foozy@708: 
foozy@708: \interaction{backout.manual.merge}
foozy@708: 
foozy@708: $B%^!<%8$9$k$3$H$G!"(B
foozy@708: $B%j%]%8%H%jCf$NMzNr$O(B
foozy@708: \ref{fig:undo:backout-manual-merge}~$B?^$K<($9$h$&$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[htb]
foozy@708:   \centering
foozy@708:   \grafix{undo-manual-merge}
foozy@708:   \caption{Manually merging a backout change}
foozy@708:   \label{fig:undo:backout-manual-merge}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \subsection{Why \hgcmd{backout} works as it does}
foozy@708: 
foozy@708: \hgcmd{backout} $B%3%^%s%I$N?6$kIq$$$r4JC1$K$^$H$a$k$H0J2<$N$h$&$K$J$j$^$9!#(B
foozy@708: 
foozy@708: \begin{enumerate}
foozy@708: \item $B:n6HNN0h%G%#%l%/%H%j$,(B``$B%/%j!<%s(B''$B$J>uBV!"(B
foozy@708:   $BB($A(B \hgcmd{status} $B$N=PNO$,6u$G$"$k$3$H$r3NG'$7$^$9!#(B
foozy@708: 
foozy@708: \item $B$=$N;~E@$G$N:n6HNN0h%G%#%l%/%H%j$N?F%A%'%s%8%;%C%H$r3P$($F$*$-$^$9!#(B
foozy@708:   $B0J2<!"$3$N%A%'%s%8%;%C%H$r(B \texttt{orig} $B$H8F>N$7$^$9!#(B
foozy@708: 
foozy@708: \item $B:n6HNN0h%G%#%l%/%H%j$r(B back out $BBP>]%A%'%s%8%;%C%H$KF14|$9$k$?$a$K!"(B
foozy@708:   \hgcmd{update} $B$HF1Ey$N=hM}$r9T$$$^$9!#(B
foozy@708:   $B0J2<!"$3$N%A%'%s%8%;%C%H$r(B \texttt{backout} $B$H8F>N$7$^$9!#(B
foozy@708: 
foozy@708: \item \texttt{backout} $B$N?F%A%'%s%8%;%C%H$rD4$Y$^$9!#(B
foozy@708:   $B0J2<!"$3$N?F%A%'%s%8%;%C%H$r(B \texttt{parent} $B$H8F>N$7$^$9!#(B
foozy@708: 
foozy@708: \item \texttt{backout} $B%A%'%s%8%;%C%H$,1F6A$9$k8D!9$N%U%!%$%k$KBP$7$F!"(B
foozy@708:   \hgcmdargs{revert}{-r parent} $BAjEv$N=hM}$r9T$$!"(B
foozy@708:   \texttt{backout} $B%A%'%s%8%;%C%H$,%3%_%C%H$5$l$kA0$NFbMF$KI|85$7$^$9!#(B
foozy@708: 
foozy@708: \item $BI|857k2L$r?7$7$$%A%'%s%8%;%C%H$H$7$F%3%_%C%H$7$^$9!#(B
foozy@708:   $B$3$N%A%'%s%8%;%C%H$N?F$O(B \texttt{backout} $B$G$9!#(B
foozy@708: 
foozy@708: \item $B%3%^%s%I%i%$%s$G(B \hgopt{backout}{--merge} $B$,;XDj$5$l$F$$$?>l9g!"(B
foozy@708:   $B?7$7$$%A%'%s%8%;%C%H$H(B \texttt{orig} $B$r%^!<%8$7!"(B
foozy@708:   $B$=$N7k2L$r%3%_%C%H$7$^$9!#(B
foozy@708: 
foozy@708: \end{enumerate}
foozy@708: 
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$rO.7+$j2s$9$3$H$J$/(B
foozy@708: \hgcmd{backout} $B%3%^%s%IAjEv$N8z2L$rF@$k$b$&0l$D$NJ}K!$O!"(B
foozy@708: back out $B$5$l$k%A%'%s%8%;%C%H$KBP$7$F(B \hgcmd{export}
foozy@708: $B$9$k$3$H$GF@$?(B diff $B%U%!%$%k$r!"(B
foozy@708: $B:nMQ$rH?E>$5$;$k(B
foozy@708: \cmdopt{patch}{--reverse} $B%*%W%7%g%s$r;XDj$7$?(B
foozy@708: \command{patch} $B%3%^%s%I$KMQ$$$k$3$H$G$9!#(B
foozy@708: $B$3$NJ}K!$OHs>o$K4JC1$K46$8$k$G$7$g$&$,!"(B
foozy@708: $BA4$/>e<j$/5!G=$7$^$;$s!#(B
foozy@708: 
foozy@708: \hgcmd{backout} $B$,(B update$B!"(Bcommit$B!"(Bmerge $B$*$h$S:FEY$N(B commit $B$r9T$&$N$O!"(B
foozy@708: back out $BBP>]$N%A%'%s%8%;%C%H$H8=:_$N(B tip 
foozy@708: $B$N(B\emph{$B4V(B}$B$NA4$F$N%A%'%s%8%;%C%H$r07$&:]$K!"(B
foozy@708: $BNI9%$J7k2L$rF@$k$?$a$N:GA1$N5!2q$r(B Mercurial $B$N%^!<%85!9=$KM?$($k$?$a$G$9!#(B
foozy@708: 
foozy@708: $BNc$($P!"(B
foozy@708: $B%W%m%8%'%/%H$NMzNr$+$i!"(B100 $B%j%S%8%g%sJ,A0$N%A%'%s%8%;%C%H$r(B
foozy@708: back out $B$7$h$&$H$7$?>l9g!"(B
foozy@708: \command{patch} $B$,%Q%C%A$NE,MQ2DH]$rH=Dj$9$k%3%s%F%-%9%H>pJs$r!"(B
foozy@708: back out $BBP>]$H$N4V$K$"$k%A%'%s%8%;%C%H$,(B``$BGK2u(B''$B$7$F$7$^$&$+$b$7$l$J$$(B
foozy@708: $B!J$3$N0UL#$,$o$+$i$J$$>l9g$O!"(B
foozy@708: \ref{sec:mq:patch}~$B@a$N(B \command{patch} $B$K4X$9$k@bL@$r;2>H$7$F$/$@$5$$!K(B
foozy@708: $B$N$G!"(B
foozy@708: \command{patch} $B%3%^%s%I$,H?E>(B diff $B$re:No$KE,MQ$G$-$k$3$H$O4|BT$G$-$^$;$s!#(B
foozy@708: Mercurial $B$N%^!<%85!9=$O!"(B
foozy@708: $B%U%!%$%k$d%G%#%l%/%H%j$NJQL>!"(B
foozy@708: $B%U%!%$%k8"8B$NJQ99$d!"(B
foozy@708: $B%P%$%J%j%U%!%$%k$NJQ99$H$$$C$?(B
foozy@708: \command{patch} $B%3%^%s%I$,07$&$3$H$N$G$-$J$$$b$N$b07$&$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \section{Changes that should never have been}
foozy@708: \label{sec:undo:aaaiiieee}
foozy@708: 
foozy@708: $BJQ99FbMF$r<h$j>C$=$&$H$7$?>l9g$NKX$I$O!"(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$NMxMQ$,BEEv$G$9!#(B
foozy@708: \hgcmd{backout} $B%3%^%s%I$O!"(B
foozy@708: $B85$N%A%'%s%8%;%C%H$N%3%_%C%H$H!"(B
foozy@708: $B8e$+$i$=$l$r<h$j>C$7$?:]$NN>J}$K4X$7$F!"(B
foozy@708: $B@53N$G1JB3E*$J5-O?$r;D$7$^$9!#(B
foozy@708: 
foozy@708: $B$7$+$7!"Hs>o$K5)$J>u67$G$9$,!"(B
foozy@708: $B%j%]%8%H%jCf$KB8:_$7$FM_$7$/$J$$JQ99$r%3%_%C%H$7$F$7$^$&$+$b$7$l$^$;$s!#(B
foozy@708: $BNc$($P!"(B
foozy@708: $B%=!<%9%U%!%$%k$HF1MM$K%*%V%8%'%/%H%U%!%$%k$r%3%_%C%H$7$F$7$^$&$h$&$J;vBV$O!"(B
foozy@708: $BLGB?$KL5$$$N$GDL>o$O!V4V0c$$!W$H$_$J$5$l$^$9!#(B
foozy@708: $B%*%V%8%'%/%H%U%!%$%k$K$OK\<AE*$J2ACM$O$"$j$^$;$s$7!"(B
foozy@708: $BHs>o$K(B\emph{$B%5%$%:$,Bg$-$$(B}$B$G$9$+$i!"(B
foozy@708: $B%j%]%8%H%5%$%:$dJ#@=!?JQ99<h$j9~$_$KMW$9$k;~4V$,A}2C$7$F$7$^$$$^$9!#(B
foozy@708: 
foozy@708: XXXXXXXXXX
foozy@708: Before I discuss the options that you have if you commit a ``brown
foozy@708: paper bag'' change (the kind that's so bad that you want to pull a
foozy@708: brown paper bag over your head), let me first discuss some approaches
foozy@708: that probably won't work.
foozy@708: XXXXXXXXXX
foozy@708: 
foozy@708: Mercurial $B$OMzNr$r!VC_@QE*$J$b$N!W(B---
foozy@708: $BA4$F$NJQ99$,@h9T$9$kJQ99$N>e$KE,MQ$5$l$k(B---$B$H$7$F07$$$^$9$N$G!"(B
foozy@708: $BGK2uE*$J1F6A$r;}$D%A%'%s%8%;%C%H$KBP$7$F$G$"$C$F$b!"(B
foozy@708: $B$=$l$rGK4~$9$k$3$H$ODL>o$O$G$-$^$;$s!#(B
foozy@708: \ref{sec:undo:rollback}~$B@a$G>\:Y$r=R$Y$^$9$,!"(B
foozy@708: $BNc30E*$K(B \hgcmd{rollback} $B%3%^%s%I$r0BA4$K;HMQ$G$-$k$N$O!"(B
foozy@708: $BJQ99$r%3%_%C%H$7$?D>8e$G!"(B
foozy@708: $BJL$J%j%]%8%H%j$X(B \hgcmd{push} $B$b(B \hgcmd{pull} $B$b$5$l$F$$$J$$>l9g$@$1$G$9!#(B
foozy@708: 
foozy@708: $BITE,@Z$J%A%'%s%8%;%C%H$rB>$N%j%]%8%H%j$X(B 
foozy@708: \hgcmd{push} $B$7$F$7$^$C$?(B\emph{$B8e$G$b(B}$B!"(B
foozy@708: \hgcmd{rollback} $B%3%^%s%I$K$h$j!"(B
foozy@708: $B%m!<%+%k$J%j%]%8%H%j$G$=$N%A%'%s%8%;%C%H$rGK4~$9$k$3$H$O$G$-$^$9$,!"(B
foozy@708: $B$=$l$O$*$=$i$/K\Mh$d$j$?$+$C$?$3$H$G$OL5$$H&$G$9!#(B
foozy@708: $B1s3V%j%]%8%H%jCf$K$OITE,@Z$J%A%'%s%8%;%C%H$,B8:_$7B3$1$^$9$N$G!"(B
foozy@708: $B<!$KJQ99$N<h$j9~$_$r9T$C$?:]$K$O!"(B
foozy@708: $B$=$NJQ99$,:F$S%m!<%+%k%j%]%8%H%j$K8=$l$k$+$b$7$l$^$;$s!#(B
foozy@708: 
foozy@708: $B$3$N$h$&$J>u67$,H/@8$7$?>l9g!"(B
foozy@708: $B$I$N%j%]%8%H%j$,ITE,@Z$J%A%'%s%8%;%C%H$rJ];}$7$F$$$k$+$rGD0.$7$F$$$k$J$i!"(B
foozy@708: $B$=$l$i(B\emph{$BA4$F$N(B}$B%j%]%8%H%j$+$i$NITE,@Z$J%A%'%s%8%;%C%H$N=|5n$r!"(B
foozy@708: \emph{$B;n$_$k(B}$B$3$H$,2DG=$G$9!#(B
foozy@708: $BL^O@!"$3$l$O?=$7J,$NL5$$2rK!$G$O$"$j$^$;$s!#(B
foozy@708: $B$?$C$?0l$D$G$bKu>C$7B;$M$?%j%]%8%H%j$,$"$l$P!"(B
foozy@708: ``$BLn$KJ|$?$l$?(B''$B$^$^$N%A%'%s%8%;%C%H$O99$KEAGE$7$F$7$^$&$G$7$g$&!#(B
foozy@708: 
foozy@708: $B=|5n$7$?$$%A%'%s%8%;%C%H$N(B\emph{$B8e$K(B}$B!"(B
foozy@708: $B4v$D$+$N%A%'%s%8%;%C%H$r%3%_%C%H$7$F$7$^$C$?>l9g!"(B
foozy@708: $B<h$jF@$kA*Br;h$O99$K8B$i$l$F$7$^$$$^$9!#(B
foozy@708: Mercurial $B$O!"(B
foozy@708: $B%A%'%s%8%;%C%H$K<j$r$D$1$J$$$^$^$G!"(B
foozy@708: $BMzNr$K(B``$B7j$r3+$1$k(B''$B5!G=$ODs6!$7$F$$$^$;$s!#(B
foozy@708: 
foozy@708: XXX This needs filling out.  
foozy@708: \texttt{examples} $B%G%#%l%/%H%jG[2<$N(B
foozy@708: \texttt{hg-replay} $B%9%/%j%W%H$O5!G=$7$^$9$,!"(B
foozy@708: $B%A%'%s%8%;%C%H$N%^!<%8$r9T$$$^$;$s!#(B
foozy@708: $B=EBg$J<jH4$-$G$9!#(B
foozy@708: 
foozy@708: \subsection{Protect yourself from ``escaped'' changes}
foozy@708: 
foozy@708: $B%m!<%+%k%j%]%8%H%j$K%3%_%C%H$7$?4v$D$+$N%A%'%s%8%;%C%H$,!"(B
foozy@708: \hgcmd{push} $B$J$$$7(B \hgcmd{pull} 
foozy@708: $BEy$K$h$C$F$=$l$i$,B>$N%j%]%8%H%j$X$HH?1G$5$l$?$+$i$H$$$C$F!"(B
foozy@708: $B$=$N$3$H<+BN$OI,$:$7$bBg<:GT$H$$$&$o$1$G$O$"$j$^$;$s!#(B
foozy@708: $B$"$k<o$NIT@5$J%A%'%s%8%;%C%H$KBP$7$F!"(B
foozy@708: $B$"$i$+$8$a<+8JKI1R$9$k$3$H$b2DG=$G$9!#(B
foozy@708: $B3+H/%A!<%`$,JQ99$rCf1{$N%j%]%8%H%j$+$i(B \hgcmd{pull} $B$9$k$h$&$JBN@)$N>l9g!"(B
foozy@708: $B;v8NKI1R$OHs>o$K4JC1$G$9!#(B
foozy@708: 
foozy@708: $BCf1{$N%j%]%8%H%j$N4v$D$+$N%U%C%/$r!"(B
foozy@708: $BDI2C$5$l$k%A%'%s%8%;%C%H$N8!>Z$r9T$&$h$&$K@_Dj$9$k(B
foozy@708: $B!J(B\ref{chap:hook}~$B>O$r;2>H$7$F$/$@$5$$!K$3$H$G!"(B
foozy@708: $B$"$k<o$NIT@5$J%A%'%s%8%;%C%H$,!"(B
foozy@708: $BCf1{%j%]%8%H%j$KA4$/H?1G$5$l$J$$$h$&$K<+F02=$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B@_Dj$,E,@Z$G$"$l$PCf1{$N%j%]%8%H%j$KH?1G$G$-$J$/$J$k$?$a!"(B
foozy@708: $B$3$N$h$&$J%A%'%s%8%;%C%H$O<+A3$H(B``$B;`$K@d$((B''$B$^$9!#(B
foozy@708: $B$J$*NI$$$3$H$K!"$3$N<jK!$OL@<(E*$J2pF~$rI,MW$H$7$^$;$s!#(B
foozy@708: 
foozy@708: $BNc$($P!"Ev3:%A%'%s%8%;%C%H$,<B:]$K%3%s%Q%$%k2DG=$+$I$&$+$r8!>Z$9$k(B
foozy@708: incoming $B%U%C%/$O!"(B
foozy@708: $B$&$C$+$j(B``$B%S%k%I$G$-$J$/$7$F$7$^$&(B''$B$3$H$rKI;_$G$-$^$9!#(B
foozy@708: 
foozy@708: \section{Finding the source of a bug}
foozy@708: \label{sec:undo:bisect}
foozy@708: 
foozy@708: $B%P%0$r$b$?$i$7$?%A%'%s%8%;%C%H$r(B back out $B$G$-$k$N$OHs>o$K7k9=$J$N$G$9$,!"(B
foozy@708: $B$I$N%A%'%s%8%;%C%H$r(B back out $B$9$Y$-$+$rCN$C$F$$$kI,MW$,$"$j$^$9!#(B
foozy@708: Mercurial $B$K$O!"(B
foozy@708: $B%A%'%s%8%;%C%HFCDj$N<+F02=$HHs>o$K8zN(E*$J<B;\$rJd=u$9$k!"(B
foozy@708: \hgext{bisect} $B$H8F$P$l$k=EMW$J3HD%$,$"$j$^$9!#(B
foozy@708: 
foozy@708: $B%A%'%s%8%;%C%H$K$h$kJQ99$O?6$kIq$$$KJQ2=$r$b$?$i$9$N$G!"(B
foozy@708: $B$=$NJQ2=$r4JC1$J#2CM%F%9%H$K$h$j$=$l$rFCDj$9$k$3$H$,$G$-$k!"(B
foozy@708: $B$H$$$&$N$,(B \hgext{bisect} $B3HD%$N86M}$G$9!#(B
foozy@708: $B$I$N%3!<%IJR$,JQ2=$r$b$?$i$7$F$$$k$N$+$O$o$+$i$J$/$F$b!"(B
foozy@708: $B%P%0$NM-L5$r;n83$9$kJ}K!$O$o$+$k$G$7$g$&!#(B
foozy@708: \hgext{bisect} $B3HD%$O!"(B
foozy@708: $B%P%0$N860x$H$J$C$?%3!<%I$r$b$?$i$7$?%A%'%s%8%;%C%H$rC5$9$N$K!"(B
foozy@708: $B$"$J$?$N%F%9%H%W%m%0%i%`$rD>@\;HMQ$7$^$9!#(B
foozy@708: 
foozy@708: \hgext{bisect} $B3HD%$NE,MQJ}K!$rM}2r$7$d$9$$$h$&$K!"(B
foozy@708: $B4v$D$+$N%7%J%j%*$rNc<($7$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B?t=54VA0$K$O8+$i$l$J$+$C$?%P%0$,!":G?7$NHG$GH/8+$5$l$^$7$?$,!"(B
foozy@708:   $B2?;~$=$l$,:.F~$5$l$?$N$+$,$o$+$j$^$;$s!#(B
foozy@708:   $B$3$N>l9g!"(Bbinary test $B$G%P%0$NM-L5$rD4$Y$k$3$H$,$G$-$^$9(B
foozy@708:   \footnote{$BLuCm(B: $B!V%P%0$NM-L5!W$H$$$&#2CM$rH=Dj$9$k%F%9%H$rMQ$$$k$3$H$G!"(B
foozy@708:   $B%P%0$N:.F~$7$?%A%'%s%8%;%C%H$rC5$7$^$9(B}$B!#(B
foozy@708: 
foozy@708: \item $BBg5^$.$G%P%0$r=$@5$7!"(B
foozy@708:   $B3+H/%A!<%`$N%P%0%G!<%?%Y!<%9$N>uBV$r!V%/%m!<%:!W$K$G$-$k$h$&$K$J$j$^$7$?!#(B
foozy@708:   $B!V%/%m!<%:!W>uBV$K$9$k:]$K!"(B
foozy@708:   $B%P%0%G!<%?%Y!<%9$,%A%'%s%8%;%C%H(BID$B$r5a$a$F$-$^$7$?$,!"(B
foozy@708:   $B$I$N%A%'%s%8%;%C%H$G%P%0$r=$@5$7$?$N$+3P$($F$$$^$;$s$G$7$?!#(B
foozy@708:   $B$3$3$G:F$S(B binary test  $B$G%P%0$NM-L5$rD4$Y$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \item $B%=%U%H%&%'%"$,@5$7$/F0:n$7$F$$$^$9$,!"(B
foozy@708:   $B0JA07WB,$7$?;~$h$j$b(B 15\% $BCY$/$J$C$F$^$7$?!#(B
foozy@708:   $B$I$N%A%'%s%8%;%C%H$,@-G=Dc2<$NMW0x$H$J$C$F$$$k$N$+$rCN$j$?$$$G$9!#(B
foozy@708:   $B$3$N>l9g!"(Bbinary test $B$O%=%U%H%&%'%"$N@-G=$r7WB,$7!"(B
foozy@708:   ``$BAa$$(B''$B$N$+(B``$BCY$$(B''$B$N$+$rH=Dj$7$^$9!#(B
foozy@708: 
foozy@708: \item $B$3$3:G6a!"(B
foozy@708:   $B=P2Y$7$?%W%m%8%'%/%H$N9=@.MWAG$N%5%$%:$,GzH/E*$KBg$-$/$J$C$F$$$F!"(B
foozy@708:   $B%W%m%8%'%/%H$N%S%k%I<j=g$N2?$i$+$,JQ99$5$l$?$N$G$O$J$$$+$H?dB,$7$F$$$^$9(B
foozy@708:   \footnote{$BLuCm(B: $B%S%k%I7k2L$N!V9=@.MWAG%5%$%:$NBg>.!W(B
foozy@708:   $B$H$$$&#2CM$rH=Dj$9$k%F%9%H$rMQ$$$k$3$H$G!"(B
foozy@708:   $BJQ99$,:.F~$5$l$?%A%'%s%8%;%C%H$rC5$7$^$9(B}$B!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: $B$3$l$i$NNc$+$i!"(B
foozy@708: \hgext{bisect} $B3HD%$,%P%0$N85$rC5$9$@$1$N$b$N$G$J$$$3$H$OL@$i$+$G$7$g$&!#(B
foozy@708: $B$=$NFC@-$K4X$9$k#2CM%F%9%H$r=q$1$k$J$i!"(B
foozy@708: $B%j%]%8%H%j$K$*$1$k(B
foozy@708: $B!J%=!<%9%D%j!<Cf$N%U%!%$%k$KBP$9$kC1=c$JJ8;zNs8!:w$G$OC5$7=P$;$J$$!K(B
foozy@708: $BG$0U$N(B``$BFC@-$N=P8=(B''$B$rC5$7=P$9$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: $BMxMQ<T$H(B Mercurial $B$N$=$l$>$l$,!"(B
foozy@708: $B8!:w=hM}$K$*$$$F$I$NItJ,$K@UG$$rIi$&$N$+$r$O$C$-$j$H$5$;$k$?$a$K!"(B
foozy@708: $B$3$3$G$b$&>/$7MQ8l$N@bL@$r$7$^$7$g$&!#(B
foozy@708: \emph{$B%F%9%H(B}(test)$B$H$O!"(B
foozy@708: \hgext{bisect} $B3HD%$,%A%'%s%8%;%C%H$rA*Br$9$k:]$K!"(B
foozy@708: \emph{$BMxMQ<T(B}$B$,<B9T$9$k$b$N$G$9!#(B
foozy@708: \emph{$BD4::(B}(probe)$B$H$O!"(B
foozy@708: $B$"$k%j%S%8%g%s$NNIH]$rH=Dj$9$k$?$a$K(B \hgext{bisect} $B$,<B9T$9$k$b$N$G$9!#(B
foozy@708: $B:G8e$K!"(B
foozy@708: ``bisect'' $B$H$$$&8@MU$r!"(B
foozy@708: ``\hgext{bisect} $B3HD%$rMQ$$$?8!:w(B''$B$NBeMQ$H$7$F!"(B
foozy@708: $BL>;l$*$h$SF0;l$H$7$F;HMQ$7$^$9!#(B
foozy@708: 
foozy@708: $B8!:w=hM}$r<+F02=$9$k4JC1$JJ}K!$N0l$D$,!"(B
foozy@708: $BA4$F$N%A%'%s%8%;%C%H$rD4::$9$k8/$jJ}$G$9!#(B
foozy@708: $B$7$+$7$J$,$i!"$3$N8/$jJ}$K$OKX$I%9%1!<%i%S%j%F%#$,$"$j$^$;$s!#(B
foozy@708: $B#1$D$N%A%'%s%8%;%C%H$N%F%9%H$K#1#0J,I,MW$G!"(B
foozy@708: $B%j%]%8%H%j$K#1K|$N%A%'%s%8%;%C%H$,$"$C$?$H$9$k$H!"(B
foozy@708: $BE0DlE*$KD4::$9$k8/$jJ}$G$O!"(B
foozy@708: $B%P%0$r$b$?$i$7$?%A%'%s%8%;%C%H$r8+$D$1$k$N$K!"(B
foozy@708: $BJ?6Q$G#3#5(B~\emph{$BF|(B}$BI,MW$G$9!#(B
foozy@708: $B8!:wBP>]$r:G?7$N#5#0#0%A%'%s%8%;%C%H$K8BDj$G$-$k$H$7$F$b!"(B
foozy@708: $B%P%0$r$b$?$i$7$?%A%'%s%8%;%C%H$r8+$D$1$k$N$K$O!"(B
foozy@708: $B$=$l$G$b$J$*#4#0;~4VI,MW$G$9!#(B
foozy@708: 
foozy@708: \emph{bisect} $B3HD%$O!"(B
foozy@708: $B3NG'$9$k%A%'%s%8%;%C%H?t$KBP$7$F(B\emph{$BBP?t(B}$B$N%*!<%@!<$G8!:w(B
foozy@708: $B!J$3$N<o$N8!:w$O(B``$BFsJ,C5:w(B''$B$H8F$P$l$^$9!K$G$-$k$h$&$K!"(B
foozy@708: $B%W%m%8%'%/%HMzNr$N(B``$B7A(B''$B$K4X$9$k>pJs$rMxMQ$7$^$9!#(B
foozy@708: $B$3$NJ}K!$K$h$j!"(B
foozy@708: $B2>$K%F%9%H$"$?$j$N=jMW;~4V$,#1#0J,3]$+$k$H$7$F$b!"(B
foozy@708: $B#1K|%A%'%s%8%;%C%H$KBP$9$k8!:w$O#2;~4V0JFb$G=*$o$j$^$9!#(B
foozy@708: $B8!:wBP>]$r:G?7$N#5#0#0%A%'%s%8%;%C%H$K8BDj$G$-$k$J$i$P!"(B
foozy@708: $B#1;~4V0JFb$K8!:w$G$-$k$G$7$g$&!#(B
foozy@708: 
foozy@708: \hgext{bisect} $B3HD%$O!"(B
foozy@708: Mercurial $B$G4IM}$5$l$F$$$k%W%m%8%'%/%H$NMzNr$N;}$D(B
foozy@708: ``$B;^J,$+$l(B''$B$NFC<A$r$o$+$C$F$$$^$9$N$G!"(B
foozy@708: $B%j%]%8%H%j$K$*$1$k;^J,$+$l!&%^!<%8!&J#?t%X%C%I$N07$$$bLdBj$"$j$^$;$s!#(B
foozy@708: $BC10l$ND4::$GMzNr$N;^J,$+$lA4BN$r4"$j<h$k(B\footnote{$BLuCm(B:
foozy@708: $B!V;^J,$+$l@hA4BN$r8!:wBP>]$+$i=|30$9$k!W$N0U(B}$B$3$H$,$G$-$k$?$a!"(B
foozy@708: \hgext{bisect} $B3HD%$O8zN(E*$K8!:w$9$k$3$H$,$G$-$k$N$G$9!#(B
foozy@708: 
foozy@708: \subsection{Using the \hgext{bisect} extension}
foozy@708: 
foozy@708: $B$3$3$G$O(B \hgext{bisect} $B3HD%$N<B9TNc$r<($7$^$9!#(B
foozy@708: Mercurial $B<+BN$N4JJX@-$r0];}$9$k$?$a$K!"(B
foozy@708: \hgext{bisect} $B$O3HD%5!G=$H$7$FDs6!$5$l$^$9!#(B
foozy@708: $B$=$N$?$a!"L@<(E*$KM-8z$K$7$J$1$l$P!"$=$N5!G=$ODs6!$5$l$^$;$s!#(B
foozy@708: \hgext{bisect} $B3HD%$rM-8z$K$9$k$K$O!"(B
foozy@708: $B!JB8:_$7$J$$>l9g$K$O!K(B \hgrc\ $B$K0J2<$N%;%/%7%g%s%X%C%@$rDI2C$7!'(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [extensions]
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $BB3$$$F!"(B\hgext{bisect} $B3HD%$rM-8z2=$9$k$?$a$N9T$r$3$N%;%/%7%g%s$KDI2C$7$^$9(B
foozy@708: \footnote{1.0 $BHG0J9_$N(B Mercurial $B$G$O!"(B
foozy@708: \hgext{bisect} $B5!G=$O4pK\5!G=$K<h$j9~$^$l$F$$$^$9$N$G!"(B
foozy@708: $B!V3HD%5!G=$NM-8z2=!W$OITMW$G$9(B}$B!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   hbisect =
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: \begin{note}
foozy@708:   \hgext{bisect} $B3HD%$NL>A0$N@hF,$K(B``\texttt{h}''$B$,IU$/$N$O4V0c$C$F$$$^$;$s!#(B
foozy@708:   $B$3$NJ8;z$,IU$/$N$O!"(BMercurial $B$,(B Python $B$G<BAu$5$l$F$$$F!"(B
foozy@708:   Python $B$NI8=`%i%$%V%i%j$N(B \texttt{bisect} $B$r;HMQ$7$F$$$k$?$a$G$9!#(B
foozy@708:   $B8m$C$F(B ``\texttt{hbisect}''$B$+$i(B``\texttt{h}''$B$r>JN,$7$?>l9g!"(B
foozy@708:   \hgrc $B%U%!%$%k$N5-=R$N%9%Z%k$r=$@5$9$k$^$G$O!"(B
foozy@708:   Mercurial $B$O(B Python $BI8=`$N(B \texttt{bisect} $B%Q%C%1!<%8$r8+$D$1=P$7!"(B
foozy@708:   $B$=$l$r(B Mercurial $B3HD%$H$7$FMxMQ$7$h$&$H$7$F%/%i%C%7%e$7B3$1$k$3$H$G$7$g$&!#(B
foozy@708: \end{note}
foozy@708: 
foozy@708: \hgext{bisect} $B3HD%$r3VN%$7$FMxMQ$9$k$?$a$K!"(B
foozy@708: $B%j%]%8%H%j$r:n@.$7$^$7$g$&!#(B
foozy@708: 
foozy@708: \interaction{bisect.init}
foozy@708: 
foozy@708: $B%k!<%W$K$h$C$F4v$D$+$N:3:Y$JJQ99$r9T$$!"(B
foozy@708: $B$=$NCf$NFCDj$NJQ99$,(B``$B%P%0(B''$B$r;}$D$h$&$K$9$k!"(B
foozy@708: $B$H$$$&C1=c$JJ}K!$G!"(B
foozy@708: $B%P%0$r;}$C$?%W%m%8%'%/%H$N%7%_%e%l!<%7%g%s$r9T$$$^$9!#(B
foozy@708: $B$3$N%k!<%W$O(B 50 $B$N%A%'%s%8%;%C%H$r@8@.$7!"(B
foozy@708: $B$=$l$>$l$,#1$D$N%U%!%$%k$r%j%]%8%H%j$KDI2C$7$^$9!#(B
foozy@708: $B$3$3$G$O!"(B
foozy@708: $B%U%!%$%k$,(B``i have a gub''$B$H$$$&%F%-%9%H$r4^$s$G$$$k$3$H$r$b$C$F!"(B
foozy@708: ``$B%P%0(B''$B$H$_$J$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.commits}
foozy@708: 
foozy@708: $B$=$l$G$O!"(B\hgext{bisect} $B3HD%$N;HMQJ}K!$rM}2r$7$^$7$g$&!#(B
foozy@708: \hgext{bisect} $B3HD%$K4X$7$F$b!"(B
foozy@708: $BDL>o$N(B Mercurial $B$NAH$_9~$_(B help $B5!G=$,;HMQ$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.help}
foozy@708: 
foozy@708: \hgext{bisect} $B3HD%$OCJ3,$rF'$s$G5!G=$7$^$9!#(B
foozy@708: $B3FCJ3,$O0J2<$N$h$&$K?J$_$^$9!#(B
foozy@708: 
foozy@708: \begin{enumerate}
foozy@708: \item $B#2CM%F%9%H$r<B9T$7$^$9!#(B
foozy@708:   \begin{itemize}
foozy@708:   \item $B%F%9%H$,@.8y$7$?>l9g!"(B
foozy@708:     \hgcmdargs{bisect}{good} $B%3%^%s%I$K$h$j(B 
foozy@708:     \hgext{bisect} $B3HD%$K$=$N$3$H$rEA$($^$9!#(B
foozy@708:   \item $B%F%9%H$,<:GT$7$?>l9g!"(B
foozy@708:     \hgcmdargs{bisect}{bad} $B%3%^%s%I$K$h$j(B
foozy@708:     \hgext{bisect} $B3HD%$K$=$N$3$H$rEA$($^$9!#(B
foozy@708:   \end{itemize}
foozy@708: \item \hgext{bisect} $B3HD%$OEA$($i$l$?>pJs$r85$K!"(B
foozy@708:   $B<!$K%F%9%H$9$Y$-%A%'%s%8%;%C%H$r7hDj$7$^$9!#(B
foozy@708: 
foozy@708: \item \hgext{bisect} $B3HD%$O!"(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$r$=$N%A%'%s%8%;%C%H$G99?7$7$^$9$N$G!"(B
foozy@708:   $B0J>e$N<j=g$r7+$jJV$7$^$9!#(B
foozy@708: 
foozy@708: \end{enumerate}
foozy@708: 
foozy@708: $B#2CM%F%9%H$N7k2L$,(B``$B@.8y(B''$B$+$i(B``$B<:GT(B''$B$KJQ2=$7$?E@$r<($9!"(B
foozy@708: $B0l0U$J%A%'%s%8%;%C%H$r(B \hgext{bisect} $B3HD%$,FCDj$G$-$?;~E@$G!"(B
foozy@708: $B$3$N<j=g$O=*N;$7$^$9!#(B
foozy@708: 
foozy@708: $B8!:w$N3+;O$KEv$?$C$F$O!"(B
foozy@708: \hgcmdargs{bisect}{init} $B%3%^%s%I$N<B9T$,I,MW$G$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.init}
foozy@708: 
foozy@708: $B:#2s$N<B9TNc$G;HMQ$9$k#2CM%F%9%H$O4JC1$J$b$N$G!"(B
foozy@708: $B%j%]%8%H%jCf$N2?$l$+$N%U%!%$%k$,(B
foozy@708: ``i have a gub'' $BJ8;zNs$r4^$s$G$$$k$+H]$+$rH=Dj$7$^$9!#(B
foozy@708: $B4^$s$G$$$k>l9g!"$=$N%A%'%s%8%;%C%H$O(B
foozy@708: ``$B%P%0$NMW0x$H$J$k(B''$B%A%'%s%8%;%C%H$G$9!#(B
foozy@708: $B47=,>e!"(B
foozy@708: $B8!:wBP>]$H$J$kFC@-$r;}$C$F$$$k%A%'%s%8%;%C%H$r(B ``bad''$B!"(B
foozy@708: $B;}$C$F$$$J$$%A%'%s%8%;%C%H$r(B ``good'' $B$H8F$S$^$9!#(B
foozy@708: $BB?$/$N>l9g!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$,F14|$7$F$$$k%j%S%8%g%s!JDL>o$O(B tip$B!K(B
foozy@708: $B$O%P%0$r;}$D%A%'%s%8%;%C%H$K$h$jLdBj$rJz$($F$$$k$b$N$G$9$+$i!"(B
foozy@708: $B$3$l$r(B``bad''$B$H$_$J$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.bad-init}
foozy@708: 
foozy@708: $B<!$N:n6H$O!"(B
foozy@708: $B%P%0$,(B\emph{$BL5$$(B}$B%A%'%s%8%;%C%H$r;XDj$9$k$3$H$G$9!#(B
foozy@708: \hgext{bisect} $B3HD%$O(B
foozy@708: $B:G=i$N(B ``good'' $B$H(B ``bad'' $B$N%A%'%s%8%;%C%H4V$N8!::>u67$r(B
foozy@708: ``$B3g8L(B''$B$G3g$C$FI=<($9$k$G$7$g$&!#(B
foozy@708: $B:#2s$N;vNc$G$O!"(B
foozy@708: $B%j%S%8%g%s(B 10 $B$K$O%P%0$,$"$j$^$;$s(B
foozy@708: $B!J:G=i$N(B ``good'' $B%A%'%s%8%;%C%H$NA*Br$K4X$7$F$O!"(B
foozy@708: $B8e$[$IJdB-$,$"$j$^$9!K!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.good-init}
foozy@708: 
foozy@708: $B%3%^%s%I=PNO$K$O0J2<$N0UL#$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B%P%0$r$b$?$i$7$?%A%'%s%8%;%C%H$NFCDj$^$G$K!"(B
foozy@708:   $B$I$l$@$1$N%A%'%s%8%;%C%H$KBP$7$F9MN8$,I,MW$G$"$k$+!"(B
foozy@708:   $B$^$?!"$I$l$@$1$N%F%9%H$rMW5a$9$k$+$rI=<($7$^$9!#(B
foozy@708: 
foozy@708: \item \hgext{bisect} 
foozy@708:   $B3HD%$O<!$K%F%9%H$9$Y$-%A%'%s%8%;%C%H$X$H:n6HNN0h%G%#%l%/%H%j$r99?7$7!"(B
foozy@708:   $B$I$N%A%'%s%8%;%C%H$,%F%9%HBP>]$G$"$k$N$+$rI=<($7$^$9!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: $BAaB.:n6HNN0h%G%#%l%/%H%j$G%F%9%H$r$7$F$_$^$7$g$&!#(B
foozy@708: \command{grep} $B$r;HMQ$7$F!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$N(B``bad''$B%U%!%$%k$NM-L5$rD4$Y!"(B
foozy@708: $B%U%!%$%k$,L5$1$l$P$=$N%j%S%8%g%s$O(B``good''$B$G$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.step1}
foozy@708: 
foozy@708: $B$3$N%F%9%H$O40A4$K<+F02=$G$-$=$&$G$9$N$G!"(B
foozy@708: $B%7%'%k4X?t$K$7$F$7$^$$$^$7$g$&!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.mytest}
foozy@708: 
foozy@708: $B$3$l$G!"(B
foozy@708: $B%F%9%H<j=gA4BN$rC10l$N(B
foozy@708: \texttt{mytest} $B%3%^%s%I$G<B9T$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.step2}
foozy@708: 
foozy@708: $B%F%9%H<j=g$,5-O?$5$l$?%3%^%s%I$r$"$H?t2s5/F0$9$k$3$H$G!"(B
foozy@708: $BEv=i$NL\E*$,C#@.$5$l$^$9!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.rest}
foozy@708: 
foozy@708: 40 $BDx$N%A%'%s%8%;%C%HA4BN$N8!:w$K$b4X$o$i$:!"(B
foozy@708: \hgext{bisect} 
foozy@708: $B3HD%$O$o$:$+#52s$N%F%9%H$G(B``$B%P%0(B''$B$r$b$?$i$7$?%A%'%s%8%;%C%H$rFCDj$G$-$^$7$?!#(B
foozy@708: $BD4::BP>]%A%'%s%8%;%C%H?t$KBP$7$F!"(B
foozy@708: \hgext{bisect} $B3HD%$OBP?t$N%*!<%@!<$G%F%9%HBP>]$rA*Dj$9$k$N$G!"(B
foozy@708: $B%A%'%s%8%;%C%H$rDI2C$7$?$@$1%F%9%H2s?t$,A}2C$9$k(B
foozy@708: ``$BNO?T$/(B''$B$N<jK!$h$j$bM-Mx$G$9!#(B
foozy@708: 
foozy@708: \subsection{Cleaning up after your search}
foozy@708: 
foozy@708: $B%j%]%8%H%j$K$*$1$k(B \hgext{bisect} $B3HD%$N;HMQ$,=*$o$C$?$J$i!"(B
foozy@708: $B8!:w$K;HMQ$7$F$$$?>pJs$r(B
foozy@708: \hgcmdargs{bisect}{reset} $B%3%^%s%I$K$h$jGK4~$9$k$3$H$,$G$-$^$9!#(B
foozy@708: \hgext{bisect} $B3HD%$O$=$l$[$IB?$/$NNN0h$r>CHq$9$k$o$1$G$O$"$j$^$;$s$N$G!"(B
foozy@708: $B$3$N:n6H$rK:$l$F$bLdBj$K$O$J$j$^$;$s!#(B
foozy@708: $B$7$+$7!"(B\hgcmdargs{bisect}{reset} $B$r<B9T$9$k$^$G$O!"(B
foozy@708: \hgext{bisect} $B$O$=$N%j%]%8%H%j$GJL$N8!:w$r3+;O$5$;$F$/$l$^$;$s!#(B
foozy@708: 
foozy@708: \interaction{bisect.search.reset}
foozy@708: 
foozy@708: \section{Tips for finding bugs effectively}
foozy@708: 
foozy@708: \subsection{Give consistent input}
foozy@708: 
foozy@708: \hgext{bisect} $B3HD%$K$O!"(B
foozy@708: $B<B;\$7$?A4$F$N%F%9%H$N7k2L$,@5$7$/;XDj$5$l$J$1$l$P$J$j$^$;$s!#(B
foozy@708: $BK\Ev$O%F%9%H$,@.8y$7$F$$$?$K$b4X$o$i$:!"(B
foozy@708: $B%F%9%H$N<:GT$r(B \hgext{bisect} $B3HD%$KEA$($?>l9g!"(B
foozy@708: $BL7=b$7$?7k2L$r=P$9(B\emph{$B$+$b(B}$B$7$l$^$;$s!#(B
foozy@708: $B%F%9%H7k2L$KBP$7$FL7=b$,8!CN$5$l$?>l9g!"(B
foozy@708: \hgext{bisect} $B$O!"(B
foozy@708: $BFCDj$N%A%'%s%8%;%C%H$,(B``good''$B$G$b(B``bad''$B$G$b$"$k!"(B
foozy@708: $B$H8@$C$F$-$^$9!#(B
foozy@708: $B$7$+$7!"$3$N8!CN$O40`z$K9T$o$l$k$o$1$G$O$J$$$N$G!"(B
foozy@708: $B4V0c$C$?%A%'%s%8%;%C%H$r%P%0$NMW0x$H$7$FJs9p$9$k$G$7$g$&!#(B
foozy@708: 
foozy@708: \subsection{Automate as much as possible}
foozy@708: 
foozy@708: $BI.<T$,(B \hgext{bisect} $B3HD%$r;H$$;O$a$?:"$O!"(B
foozy@708: $B8!:w$N$?$a$N%F%9%H$r%3%^%s%I%i%$%s$G<jF0$G<B9T$7$F$$$^$7$?$,!"(B
foozy@708: $B>/$J$/$H$b;d$K$O!"$3$N<jK!$OFk@w$_$^$;$s!#(B
foozy@708: $B2?EY$+(B \hgext{bisect} $B$r;HMQ$7$?8e$G!"(B
foozy@708: $B:G=*E*$K@5$7$$7k2L$rF@$kA0$K!"(B
foozy@708: $B$$$D$b<j0c$$$N$?$a$K2?EY$b8!:w$r$d$jD>$7$F$$$k$3$H$K5$IU$-$^$7$?!#(B
foozy@708: 
foozy@708: \hgext{bisect} $B3HD%$r<jF0$G6nF0$7$F$$$?:]$K$O!"(B
foozy@708: $B>.$5$J%j%]%8%H%j$K$*$1$kC1=c$J8!:w$G$"$C$F$bLdBj$,H/@8$7$F$$$^$7$?!#(B
foozy@708: $B%F%9%H$NFbMF$,J#;($G$"$C$?$j!"(B
foozy@708: \hgext{bisect} $B$,MW5a$9$k%F%9%H<B9T2s?t$,A}$($l$P!"(B
foozy@708: $B$=$l$@$1%F%9%H<B9T$K$*$1$kA`:n%_%9$N2DG=@-$O9b$^$j$^$9!#(B
foozy@708: $B%F%9%H$r<+F02=$9$k$h$&$K$J$C$F0JMh!"(B
foozy@708: $BHs>o$KNI9%$J7k2L$rF@$i$l$F$$$^$9!#(B
foozy@708: 
foozy@708: $B%F%9%H<+F02=$N$?$a$N80$O#2$D$"$j$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B>o$KF1$8!V>I>u!W$r%F%9%H$9$k$3$H$H!"(B
foozy@708: \item $B>o$K0l4S$7$?F~NO$r(B \hgcmd{bisect} $B%3%^%s%I$KM?$($k$3$H(B
foozy@708: \end{itemize}
foozy@708: 
foozy@708: $BA0=R$N<B9TNc$G$O!"(B
foozy@708: \command{grep} $B%3%^%s%I$K$h$j!V>I>u!W$rD4$Y$F$$$F!"(B
foozy@708: \texttt{if} $B%9%F!<%H%a%s%H$,!V8!::!W$N7k2L$r<u$1$F(B
foozy@708: \hgcmd{bisect} $B%3%^%s%I$KF1$8F~NO$rM?$($k$3$H$rJ]>Z$7$F$$$^$7$?!#(B
foozy@708: \texttt{mytest} $B4X?t$,!"(B
foozy@708: $B$3$l$i$r:F8=$7$d$9$$7A<0$KE}9g$7$?$3$H$G!"(B
foozy@708: $BA4$F$N%F%9%H$,6Q0l$G@09g@-$N<h$l$?$b$N$K$J$C$F$$$^$9!#(B
foozy@708: 
foozy@708: \subsection{Check your results}
foozy@708: 
foozy@708: \hgext{bisect} $B$K$h$k8!:w$N=PNO7k2L$OM?$($?>pJsDxEY$K$7$+@5$7$/$J$$$N$G!"(B
foozy@708: \hgext{bisect} $B$K$h$j(B ``good'' $B$HJs9p$5$l$?%A%'%s%8%;%C%H$r!"(B
foozy@708: $B@dBPE*$K@5$7$$$b$N$H$_$J$5$J$$$G$/$@$5$$!#(B
foozy@708: $BJs9pFbMF$r%/%m%9%A%'%C%/$9$k4JC1$JJ}K!$O!"(B
foozy@708: $B0J2<$N$h$&$J%A%'%s%8%;%C%H$N$=$l$>$l$KBP$7$F!"(B
foozy@708: $B<jF0$G<+?H$N%F%9%H$r<B9T$7$F$_$k$3$H$G$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B:G=i$N(B ``bad'' $B%j%S%8%g%s$G$"$k$HJs9p$5$l$?$b$N(B
foozy@708:   $B!J0J2<!"!V>c32%A%'%s%8%;%C%H!W$H8F>N!K!#(B
foozy@708:   $B$"$J$?$N%F%9%H$O$3$l$K4X$7$F(B ``bad'' $B$HJs9p$7$J$1$l$P$J$j$^$;$s!#(B
foozy@708: 
foozy@708: \item $B>e5-%A%'%s%8%;%C%H$N?F%A%'%s%8%;%C%H(B
foozy@708:   $B!J%^!<%8$5$l$?>l9g$ON>J}$N?F!K!#(B
foozy@708:   $B$"$J$?$N%F%9%H$O$3$l!J$3$l$i!K$K4X$7$F(B ``good'' $B$HJs9p$7$J$1$l$P$J$j$^$;$s!#(B
foozy@708: 
foozy@708: \item $B>c32%A%'%s%8%;%C%H$N;R%A%'%s%8%;%C%H!#(B
foozy@708:   $B$"$J$?$N%F%9%H$O$3$l$K4X$7$F(B ``bad'' $B$HJs9p$7$J$1$l$P$J$j$^$;$s!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: \subsection{Beware interference between bugs}
foozy@708: 
foozy@708: $B$"$k%P%0$rC5$9:]$K!"(B
foozy@708: $BB>$N%P%0$NB8:_$K$h$j:.Mp$5$;$i$l$k2DG=@-$b$"$j$^$9!#(B
foozy@708: $BNc$($P!"(B
foozy@708: $B%j%S%8%g%s(B 100 $B$G%=%U%H%&%'%"$,%/%i%C%7%e$7!"(B
foozy@708: $B%j%S%8%g%s(B 50 $B$G$O@5$7$/F0:n$7$F$$$?$H$7$^$9!#(B
foozy@708: $B$"$J$?$NCN$i$J$$4V$K!"(B
foozy@708: $B%=%U%H%&%'%"$r%/%i%C%7%e$5$;$kJL$N%P%0$r!"(B
foozy@708: $BB>$N?M$,%j%S%8%g%s(B 60 $B$GF~$l$F$7$^$$!"(B
foozy@708: $B$=$l$r%j%S%8%g%s(B 80 $B$G=$@5$7$?>l9g!"(B
foozy@708: $B$J$s$i$+$NJ}K!$G8!:w7k2L$r:.Mp$5$;$k$+$b$7$l$^$;$s!#(B
foozy@708: 
foozy@708: $BB>$N%P%0$NB8:_$K$h$C$F!"(B
foozy@708: $BC5$7$F$$$k%P%0$,40A4$K(B``$BJ$$$1#$5$l$k(B''$B$+$b$7$l$:!"(B
foozy@708: $BC5$7$F$$$k%P%0$,$=$NB8:_$r<($95!2q$rF@$kA0$KB>$N%P%0$,H/@8$7$F$$$k!"(B
foozy@708: $B$H8@$($^$9!#(B
foozy@708: $BB>$N%P%0$r2sHr$7$?%F%9%H$,(B
foozy@708: $B!JNc$($P!"$=$N%P%0$,%W%m%8%'%/%H$N%S%k%I$rAK32$9$k$J$I$NM}M3$G!K(B
foozy@708: $B$G$-$J$$$?$a$K!"(B
foozy@708: $BFCDj$N%A%'%s%8%;%C%H$K$*$1$k8!:wBP>]$N%P%0$NM-L5$rL@8@$G$-$J$$>l9g!"(B
foozy@708: \hgext{bisect} $B3HD%$N=u$1$rD>@\<u$1$k$3$H$O$G$-$^$;$s!#(B
foozy@708: $B$=$NBX$o$j!"(B
foozy@708: $BB>$N%P%0$,B8:_$9$k%A%'%s%8%;%C%H$r<jF0$G<h$j=|$/$3$H$G!"(B
foozy@708: ``$B<~JU(B''$B$G$NJL$J8!:w$r9T$$$^$7$g$&!#(B
foozy@708: 
foozy@708: $B%P%0$NB8:_$K4X$9$k%F%9%H$,==J,L@3N$G$J$$>l9g$K$O!"(B
foozy@708: $BJL$JLdBj$,H/@8$7F@$^$9!#(B
foozy@708: ``$B%W%m%0%i%`$N%/%i%C%7%e(B''$B$G%P%0$NM-L5$r3NG'$7$F$$$k>l9g!"(B
foozy@708: $B%=%U%H%&%'%"$r%/%i%C%7%e$5$;$kA4A34X78$J$$%P%0$K$h$j!"(B
foozy@708: $B8!:wBP>]$G$"$k%P%0$,J$$$1#$5$l$F$7$^$$!"(B
foozy@708: $BN>J}$H$bF1$8$b$N$H$_$J$5$l$k$?$a$K!"(B
foozy@708: \hgext{bisect} $B$,OG$o$5$l$F$7$^$$$^$9!#(B
foozy@708: 
foozy@708: \subsection{Bracket your search lazily}
foozy@708: 
foozy@708: $B8!:w$K$*$1$k=*C<$N0u$H$J$k(B
foozy@708: ``good'' $B$*$h$S(B ``bad'' $B$J%A%'%s%8%;%C%H$N:G=i$NA*Br$O!"(B
foozy@708: $BDL>o$O4JC1$J$3$H$G$9$,!"(B
foozy@708: $B$=$&$G$"$C$F$bB?>/$O5DO@$NM>CO$,$"$j$^$9!#(B
foozy@708: \hgext{bisect} $B$NN)>l$+$i8+$?>l9g!"(B
foozy@708: ``$B:G?7(B''$B$N%A%'%s%8%;%C%H$ODLNc$G$O(B``bad''$B$G!"(B
foozy@708: $B:G8E$N%A%'%s%8%;%C%H$O(B``good''$B$G$9!#(B
foozy@708: 
foozy@708: \hgext{bisect} $B$N;HMQ$KEv$?$C$F(B
foozy@708: ``good''$B$K$U$5$o$7$$%A%'%s%8%;%C%H$,$I$l$+$r;W$$=P$9$N$,Fq$7$$>l9g$K$O!"(B
foozy@708: $B$G$?$i$a$K%F%9%H$9$k$N$b0-$/$O$J$$$G$7$g$&!#(B
foozy@708: $B$I$&$"$C$F$b%P%0$NC{8u$,8+=P$;$J$$(B
foozy@708: $B!JNc$($P!"%P%0$NH/@8$K4XO"$9$k5!G=$,$^$@Ds6!$5$l$F$$$J$$!K$b$N$d!"(B
foozy@708: $BB>$NLdBj$,!JA0=R$7$?$h$&$K!K%P%0$rJ$$$1#$7$F$7$^$&$h$&$J$b$N$r!"(B
foozy@708: $B%F%9%H8uJd$N%A%'%s%8%;%C%H$+$i=|30$9$k$N$rK:$l$J$$$h$&$K$7$^$7$g$&!#(B
foozy@708: 
foozy@708: $B?t@i$N%A%'%s%8%;%C%H!"(B
foozy@708: $B$J$$$7?t%v7n$NMzNr$N(B``$B=i4|(B''$B$N$b$N$,:G=*7k2L$@$C$?$H$7$F$b!"(B
foozy@708: $BBP?t%*!<%@!<$N?6$kIq$$$N$*1"$G!"(B
foozy@708: \hgext{bisect} $B$,<B;\$7$J$1$l$P$J$i$J$$Am2s?t$,?t2sA}$($k$@$1$G$9!#(B
foozy@708: 
foozy@708: %%% Local Variables: 
foozy@708: %%% mode: latex
foozy@708: %%% TeX-master: "00book"
foozy@708: %%% End: 




