
foozy@708: \chapter{A tour of Mercurial: merging work}
foozy@708: \label{chap:tour-merge}
foozy@708: 
foozy@708: $BA0>O$K$*$$$F$O!"(B
foozy@708: $B%j%]%8%H%j$NJ#@=!"(B
foozy@708: $B%j%]%8%H%j$G$N%A%'%s%8%;%C%H$N@8@.!"(B
foozy@708: $B$J$i$S$K(B \hgcmd{push} $B$*$h$S(B \hgcmd{pull} 
foozy@708: $B$K$h$k%j%]%8%H%j4V$G$N%A%'%s%8%;%C%H$N<x<u$r8+$F$-$^$7$?!#(B
foozy@708: $B<!$NCJ3,$H$7$F!"JL!9$N%j%]%8%H%j$K$*$1$kJQ99$N(B\emph{$B%^!<%8(B}
foozy@708: $B!J(Bmerge$B!K$K$D$$$F8+$F$_$^$7$g$&!#(B
foozy@708: 
foozy@708: \section{Merging streams of work}
foozy@708: 
foozy@708: $BJ,;69=@.4IM}%D!<%k$K$*$$$F!"%^!<%8$O:n6H$N4pK\$G$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item Alice $B$H(B Bob $B$,!"(B
foozy@708:   $B6&F1:n6H$7$F$$$k%W%m%8%'%/%H$N%j%]%8%H%j$+$iJ#@=$7$?!"(B
foozy@708:   $B8D?ME*$J%j%]%8%H%j$r;}$C$F$$$k$b$N$H$7$^$9!#(B
foozy@708:   Alice $B$O<+J,$N%j%]%8%H%j$K$*$$$F%P%0$r=$@5$7$^$7$?!#(B
foozy@708:   Bob $B$O<+J,$N%j%]%8%H%j$K$*$$$F5!G=$rDI2C$7$^$7$?!#(B
foozy@708:   $BFs?M$O!"(B
foozy@708:   $B%P%0%U%#%C%/%9$H?75!G=$NN>J}$r4^$`%j%]%8%H%j$r6&M-$7$?$$$H;W$&$G$7$g$&!#(B
foozy@708: 
foozy@708: \item $BI.<T$O!"(B
foozy@708:   $B8DJL$N%j%]%8%H%j$K$h$C$F!"(B
foozy@708:   $B$*8_$$$,0BA4$K3VN%$5$l$?J#?t$N0[$J$k:n6H$r!"(B
foozy@708:   $BF10l%W%m%8%'%/%H$K$*$$$FF1;~$K<B;\$9$k$3$H$,IQHK$K$"$j$^$9!#(B
foozy@708:   $B$3$N7A<0$G$N:n6H$G$O!"(B
foozy@708:   $B$"$k%j%]%8%H%j$K$*$1$k@.2L$r!"(B
foozy@708:   $BB>$N%j%]%8%H%j$KBP$7$FIQHK$K%^!<%8$9$kI,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: $B%^!<%8$OI,MW$K1~$8$F<B;\$9$k$"$j$U$l$?:n6H$G$9$N$G!"(B
foozy@708: Mercurial $B$G$O4JC1$K9T$($k$h$&$K$J$C$F$$$^$9!#(B
foozy@708: $B$=$l$G$O!"%^!<%8<j=g$r8+$F9T$-$^$7$g$&!#(B
foozy@708: $B$b$&0lEY%j%]%8%H%j$NJ#@=$r9T$$!J$b$&2?EY$bJ#@=$7$^$7$?$h$M!)!K!"(B
foozy@708: $B$=$N%j%]%8%H%j$K$*$$$FJQ99$r9T$$$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.clone}
foozy@708: 
foozy@708: $B$3$N;~E@$G!"(B
foozy@708: $BFbMF$N0[$J$k#2$D$N(B \filename{hello.c} $B$N%3%T!<$,B8:_$9$k$O$:$G$9!#(B
foozy@708: $B#2$D$N%j%]%8%H%j$NMzNr$O!"(B
foozy@708: $B?^(B~\ref{fig:tour-merge:sep-repos} $B$K<($9$h$&$K!"(B
foozy@708: $B;^J,$+$l$7$F$$$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.cat}
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \centering
foozy@708:   \grafix{tour-merge-sep-repos}
foozy@708:   \caption{Divergent recent histories of the \dirname{my-hello} and
foozy@708:     \dirname{my-new-hello} repositories}
foozy@708:   \label{fig:tour-merge:sep-repos}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \hgcmd{pull} $B$r9T$C$F$b!"(B
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$K$O1F6A$r5Z$\$5$J$$$3$H$O4{$K@bL@$7$?$H$*$j$G$9$N$G!"(B
foozy@708: \dirname{my-hello} $B$+$i(B \hgcmd{pull} $B$7$F$_$^$7$g$&!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.pull}
foozy@708: 
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$K$O1F6A$r5Z$\$7$F$$$^$;$s$,!"(B
foozy@708: \hgcmd{pull} $B%3%^%s%I$O(B ``heads'' $B$K$D$$$F2?$+7Y9p$7$F$$$^$9!#(B
foozy@708: 
foozy@708: \subsection{Head changesets}
foozy@708: 
foozy@708: ``head'' $B$H$O!"(B
foozy@708: $B%j%]%8%H%jCf$K$*$$$F!"(B
foozy@708: $B;RB9!J$J$$$7;R6!!K$H$J$k%A%'%s%8%;%C%H$,B8:_$7$J$$%A%'%s%8%;%C%H$N$3$H$G$9!#(B
foozy@708: $B%j%]%8%H%j$K$*$1$k:G$b:G?7$N%j%S%8%g%s$O!"(B
foozy@708: $B0l@Z$N;R%A%'%s%8%;%C%H$r;}$A$^$;$s$+$i!"(B
foozy@708: $B=>$C$F(B tip $B%j%S%8%g%s$O(B head $B$H$J$j$^$9$,!"(B
foozy@708: $B#1$D$N%j%]%8%H%j$K$OJ#?t$N(B head $B$,B8:_$7$($^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \centering
foozy@708:   \grafix{tour-merge-pull}
foozy@708:   \caption{Repository contents after pulling from \dirname{my-hello} into
foozy@708:     \dirname{my-new-hello}}
foozy@708:   \label{fig:tour-merge:pull}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \dirname{my-hello} $B$+$i(B \dirname{my-new-hello} $B$X$N(B
foozy@708: \hgcmd{pull} $B$K$h$k1F6A$r!"(B
foozy@708: $B?^(B~\ref{fig:tour-merge:pull} $B$G8+$k$3$H$,$G$-$^$9!#(B
foozy@708: $B4{$K(B \dirname{my-new-hello} $B$KB8:_$7$F$$$?MzNr$K$O<j$,IU$1$i$l$F$$$^$;$s$,!"(B
foozy@708: $B?7$7$$%j%S%8%g%s$,DI2C$5$l$F$$$^$9!#(B
foozy@708: $B?^(B~\ref{fig:tour-merge:pull} $B$+$i$O!"(B
foozy@708: $B?7$7$$%j%]%8%H%j!J(B\dirname{my-new-hello}$B!K$K$*$$$F!"(B
foozy@708: \emph{$B%A%'%s%8%;%C%H<1JL;R(B}$B$OF1$8$^$^$G$b!"(B
foozy@708: \emph{$B%j%S%8%g%sHV9f(B}$B$,0[$J$kMM$,FI$_<h$l$^$9(B
foozy@708: $B!J$=$7$F!"?^$i$:$b!"%A%'%s%8%;%C%H$K$D$$$FOC$r$9$k:]$K!"(B
foozy@708: $B%j%S%8%g%sHV9f$r;HMQ$9$k$N$,NI$/$J$$!"$H$$$&9%Nc$K$J$C$F$$$^$9!K!#(B
foozy@708: \hgcmd{heads} $B%3%^%s%I$K$h$j!"(B
foozy@708: $B%j%]%8%H%j$N(B head $B$r8+$k$3$H$,$G$-$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.heads}
foozy@708: 
foozy@708: \subsection{Performing the merge}
foozy@708: 
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$r!"(B
foozy@708: $B!J(B\dirname{my-hello} $B$+$i<h$j9~$s$@!K?7$?$J(B tip $B%j%S%8%g%s$K99?7$9$k$?$a$K!"(B
foozy@708: $B$$$D$b$N$h$&$K(B \hgcmd{update} $B%3%^%s%I$r<B9T$9$k$H!"(B
foozy@708: $B$I$&$J$k$G$7$g$&!)(B
foozy@708: 
foozy@708: \interaction{tour.merge.update}
foozy@708: 
foozy@708: Mercurial $B$+$i!"(B
foozy@708: \hgcmd{update} $B%3%^%s%I$G$O%^!<%8$,9T$o$l$J$$;]$,DLC#$5$l$^$9!#(B
foozy@708: $B%^!<%8$N<B;\$,I,MW$H;W$o$l$k>l9g!"(B
foozy@708: $B6/@)E*$J<B9T$r$7$J$$8B$j$O(B 
foozy@708: \hgcmd{update} $B%3%^%s%I$K$h$k:n6HNN0h%G%#%l%/%H%j$N99?7$O9T$o$l$^$;$s!#(B
foozy@708: \hgcmd{update} $B%3%^%s%I$NBe$o$j$K!"(B
foozy@708: \hgcmd{merge} $B%3%^%s%I$rMQ$$$F#2$D$N(B head $B$r%^!<%8$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.merge}
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \centering
foozy@708:   \grafix{tour-merge-merge}
foozy@708:   \caption{Working directory and repository during merge, and
foozy@708:     following commit}
foozy@708:   \label{fig:tour-merge:merge}
foozy@708: \end{figure}
foozy@708: 
foozy@708: \hgcmd{merge} $B%3%^%s%I$K$h$C$F!"(B
foozy@708: \hgcmd{parents} $B%3%^%s%I$N=PNO!"(B
foozy@708: $B$*$h$S(B \filename{hello.c} $B$NFbMF$NJQ99$H$$$&7A$G!"(B
foozy@708: \emph{$BN>J}(B}$B$N(B head $B$NJQ99FbMF$,:n6HNN0h%G%#%l%/%H%j$KH?1G$5$l$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.parents}
foozy@708: 
foozy@708: \subsection{Committing the results of the merge}
foozy@708: 
foozy@708: $B7k2L$r(B \hgcmd{commit} $B$9$k$^$G$O!"(B
foozy@708: \hgcmd{parents} $B$O%^!<%8$N:]$K$O>o$K#2$D$N?F!J%A%'%s%8%;%C%H!K$rI=<($7$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.commit}
foozy@708: 
foozy@708: $B$3$l$G!"?7$7$$(B tip $B%j%S%8%g%s$,:n@.$5$l$^$7$?!#(B
foozy@708: $B@h=R$7$?#2$D$N(B head $B$N(B\emph{$BN>J}(B}$B$r?F$K;}$DE@$KCm0U$7$F$/$@$5$$!#(B
foozy@708: $B$3$l$i$O!"@h$K(B \hgcmd{parents} $B$GI=<($7$?%j%S%8%g%s$H0lCW$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour.merge.tip}
foozy@708: 
foozy@708: $B:n6HNN0h%G%#%l%/%H%j$,%^!<%8$N:]$K$I$N$h$&$K$J$C$F$$$k$N$+!"(B
foozy@708: $B$=$7$F%3%_%C%H$K$h$C$F$I$N$h$&$K%j%]%8%H%j$K:nMQ$9$k$N$+$r!"(B
foozy@708: $B?^(B~\ref{fig:tour-merge:merge} $B$+$iFI$_<h$k$3$H$,$G$-$^$9!#(B
foozy@708: $B%^!<%8$N:]$K:n6HNN0h%G%#%l%/%H%j$N?F$G$"$C$?#2$D$N%A%'%s%8%;%C%H$O!"(B
foozy@708: $B%3%_%C%H$N:]$K$O?7$?$J%A%'%s%8%;%C%H$K$H$C$F$N?F%A%'%s%8%;%C%H$H$J$j$^$9!#(B
foozy@708: 
foozy@708: \section{Merging conflicting changes}
foozy@708: 
foozy@708: $BKX$I$N%^!<%8:n6H$O4JC1$K:Q$_$^$9$,!"(B
foozy@708: $B;~$K$O%^!<%8BP>]$N%A%'%s%8%;%C%HF1;N$,!"(B
foozy@708: $BF1$8%U%!%$%k$NF1$8It0L$rJQ99$7$F$$$k>l9g$,$"$j$^$9!#(B
foozy@708: $BN><T$NJQ99FbMF$,F10l$GL5$1$l$P!"(B
foozy@708: $B%^!<%8$O(B\emph{$B>WFM(B}$B!J(Bconflict$B!K$r@8$8$k$?$a!"(B
foozy@708: $BN><T$N0[$J$kJQ99FbMF$rN>N)$5$;$F(B
foozy@708: $B2?$i$+$N0l4S@-$N<h$l$?>uBV$K$9$k$?$a$N7hCG$,I,MW$G$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \centering
foozy@708:   \grafix{tour-merge-conflict}
foozy@708:   \caption{Conflicting changes to a document}
foozy@708:   \label{fig:tour-merge:conflict}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $BJ8=q$KBP$9$k#2$D$NJQ99$N>WFM$NNc$r!"(B
foozy@708: $B?^(B~\ref{fig:tour-merge:conflict} $B$,?^<($7$F$$$^$9!#(B
foozy@708: $BN><T$O%U%!%$%k$NF1$8HG$r85$K$7$F$$$^$9$,!"(B
foozy@708: $B0lJ}$,JQ99$r9T$&K5$i!"(B
foozy@708: $BB>J}$,F1$8CJMn$KBP$7$F0[$J$kJQ99$r$7$F$7$^$$$^$9!#(B
foozy@708: $BJQ99$N>WFM$r2r>C$9$k:n6H$H$O!"(B
foozy@708: $B$=$N%U%!%$%k$,$I$N$h$&$K$J$C$F$$$k$Y$-$+$r7hDj$9$k$3$H$KB>$J$j$^$;$s!#(B
foozy@708: 
foozy@708: Mercurial $B$K$O>WFM$r07$&5!G=$,AH$_9~$^$l$F$$$^$;$s!#(B
foozy@708: $B$=$NBe$o$j$K!"(B
foozy@708: \command{hgmerge} $B$H8F$P$l$k30It%W%m%0%i%`$r<B9T$7$^$9!#(B
foozy@708: $B$3$N%W%m%0%i%`$O!"(B
foozy@708: Mercurial $B$KE:IU$5$l$k%7%'%k%9%/%j%W%H(B\footnote{$BLuCm(B:
foozy@708: \command{/bin/sh} $B8~$1$@$+$i!"$H$$$&$3$H$J$N$G$7$g$&$,!"(B
foozy@708: Windows $B$N%P%$%J%jHG$K$OE:IU$5$l$F$$$^$;$s!#(B}$B$G$9$,!"(B
foozy@708: $BJL$J%W%m%0%i%`$r5/F0$5$;$k$3$H$b$G$-$^$9!#(B
foozy@708: \command{hgmerge} $B$N4pDlF0:n$G$O!"(B
foozy@708: $B4v$D$+$NCxL>$J%^!<%8%D!<%k$N$&$A!"(B
foozy@708: $B2TF/4D6-$K$*$$$F%$%s%9%H!<%k$5$l$F$$$k$H;W$o$l$k$b$N$rC5$7$^$9!#(B
foozy@708: $B$^$:;O$a$K!"(B
foozy@708: $BHsBPOCE*%^!<%8%D!<%k(B\footnote{$BLuCm(B:
foozy@708: \command{diff3} $B$d(B \command{merge} $B$J$I(B}$B$r<B9T$7$F$_$^$9$,!"(B
foozy@708: $B!J?M<j$K$h$C$F2r7h$9$kI,MW@-$,$"$k$?$a$K!K$=$l$,<:GT$7$?>l9g$d!"(B
foozy@708: $B$=$b$=$b$=$l$i$N%D!<%k$,Ds6!$5$l$F$$$J$$>l9g!"(B
foozy@708: $BB>$N%0%i%U%#%+%k$J%^!<%8%D!<%k$N5/F0$r;n$_$^$9(B
foozy@708: \footnote{$BLuCm(B: $BNc$($P!"(B
foozy@708: \command{diff3} $B$K$h$k%^!<%8$r9T$$!"(B
foozy@708: $B>WFM$,8!=P$5$l$?>l9g$O$=$N%U%!%$%k$4$H$K!"(B
foozy@708: \envar{EDITOR} $B4D6-JQ?t$GDj5A$5$l$k%(%G%#%?!J$J$$$7(B \command{vi}$B!K(B
foozy@708: $B$r5/F0$7$F!"(B
foozy@708: $B$=$l$>$l$N%A%'%s%8%;%C%H$KM3Mh$9$kJQ99$N4V$G$ND4Dd$rMW5a$7$F$-$^$9!#(B
foozy@708: }$B!#(B
foozy@708: 
foozy@708: \envar{HGMERGE} 
foozy@708: $B4D6-JQ?t$K5/F0BP>]%W%m%0%i%`$J$$$7%9%/%j%W%HL>$r@_Dj$9$k$3$H$G!"(B
foozy@708: Mercurial $B$K(B \command{hgmerge} $B0J30$r5/F0$5$;$k;v$b$G$-$^$9(B
foozy@708: 
foozy@708: \subsection{Using a graphical merge tool}
foozy@708: 
foozy@708: $BCx<T$N$*A&$a$N%0%i%U%#%+%k$J%^!<%8%D!<%k$O(B \command{kdiff3} $B$J$N$G!"(B
foozy@708: $B%0%i%U%#%+%k$J%U%!%$%k%^!<%8%D!<%k$K5a$a$i$l$k5!G=$K$D$$$F!"(B
foozy@708: $B$3$l$rBj:`$K@bL@$7$h$&$H;W$$$^$9!#(B
foozy@708: $B:n6HCf$N2hLL%$%a!<%8$,?^(B~\ref{fig:tour-merge:kdiff3}$B$K$"$j$^$9!#(B
foozy@708: $BCeL\$7$F$$$k#1$D$N%U%!%$%k$KBP$7$F!"(B
foozy@708: $B#3$D$N0[$J$k%j%S%8%g%s$,B8:_$9$k$3$H$+$i!"(B
foozy@708: $B%^!<%8J}K!$O(B\emph{$B#3J}8~%^!<%8(B}$B!J(Bthree-way merge$B!K$H8F$P$l$F$$$^$9!#(B
foozy@708: $B$=$l$f$(!"%^!<%8%D!<%k$O%&%#%s%I%&>eIt$r#3$D$N6h2h$KJ,3d$7$F$$$^$9!#(B
foozy@708: 
foozy@708: \begin{itemize}
foozy@708: \item $B:8C<$KI=<($5$l$F$$$k$N$O!"(B
foozy@708:   $B%U%!%$%k$N(B\emph{$B85(B}$B!J(Bbase$B!K$NHG!"(B
foozy@708:   $B$D$^$j%^!<%8BP>]$H$7$F$$$k#2$D$NHG$K$H$C$F!"(B
foozy@708:   $B:G$b?7$7$$J,4t85$H$J$C$F$$$kHG$G$9!#(B
foozy@708: 
foozy@708: \item $BCf1{$KI=<($5$l$F$$$k$N$O!"(B
foozy@708:   $B%^!<%8(B``$B@h(B''$B$NHG(B\footnote{$BLuCm(B: $B86J8$G$O!V(B``our'' version$B!W(B}$B$G$9$N$G!"(B
foozy@708:   $B:n6HNN0h%G%#%l%/%H%j$K$*$1$kJQ99FbMF$,I=<($5$l$^$9!#(B
foozy@708: 
foozy@708: \item $B1&C<$KI=<($5$l$F$$$k$N$O!"(B
foozy@708:   $B%^!<%8(B``$B85(B''\footnote{$BLuCm(B: $B86J8$G$O!V(B``their'' version$B!W(B}$B$G$9$N$G!"(B
foozy@708:   $B%^!<%8$7$h$&$H$7$F$$$k%A%'%s%8%;%C%H$KM3Mh$9$kFbMF$,I=<($5$l$^$9!#(B
foozy@708: 
foozy@708: \end{itemize}
foozy@708: 
foozy@708: $B$3$l$i$N6h2h$N2<J}$KI=<($5$l$F$$$k$N$O!"(B
foozy@708: $B8=;~E@$G$N%^!<%8(B\emph{$B7k2L(B}$B$G$9!#(B
foozy@708: $B%^!<%8$K$*$1$k:n6H$H$O!"(B
foozy@708: $B2hLL>e$K@V;z$GI=<($5$l$?(B\footnote{$BLuCm(B:
foozy@708: \command{diff3} $B$,9TC10L$G$N>WFMI=<($G$"$k$N$KHf$Y$F!"(B
foozy@708: GUI $B$G$"$kMxE@$,@8$-$F$$$^$9!#(B}$B!"(B
foozy@708: $B?5=E$J%U%!%$%k$N%^!<%8$,I,MW$H$5$l$kL$2r7h$N>WFM$r!"(B
foozy@708: $BBEEv$JFbMF$GCV$-49$($k$3$H$G$9!#(B
foozy@708: 
foozy@708: $B$3$l$i#4$D$N6h2h$O(B\emph{$B8_$$$K8GDj(B}$B$5$l$F$$$k$N$G!"(B
foozy@708: $B$$$:$l$+$N6h2h$r%9%/%m!<%k$5$;$?>l9g$K$O!"(B
foozy@708: $BB>$N6h2h$bAj1~$N>l=j$rI=<($9$k$h$&$K99?7$5$l$^$9!#(B
foozy@708: 
foozy@708: \begin{figure}[ht]
foozy@708:   \centering
foozy@708:   \grafixL{kdiff3}
foozy@708:   \label{fig:tour-merge:kdiff3}
foozy@708:   \caption{Using \command{kdiff3} to merge versions of a file}
foozy@708: \end{figure}
foozy@708: 
foozy@708: $B%U%!%$%kCf$N8D!9$N>WFM2U=j$K$*$$$F!"(B
foozy@708: $B>WFM$r2r>C$9$k$?$a$K!"(B
foozy@708: $B85HG!?%^!<%8@hHG!?%^!<%885HG$N%F%-%9%H$r(B
foozy@708: $B!J$=$l$i$NAH$_9g$o$;$b4^$a$F!KG$0U$KA*Br$9$k$3$H$,$G$-$^$9!#(B
foozy@708: $B$^$?!"99$J$kJQ99$r9T$&$?$a$K!"(B
foozy@708: $B%^!<%87k2L$rD>@\<j$GF~NO$9$k$3$H$b$G$-$^$9!#(B
foozy@708: 
foozy@708: $B$3$3$G>R2p$7@Z$l$J$$$[$I(B\emph{$BB?$/$N(B}$B%U%!%$%k%^!<%8%D!<%k$,B8:_$7$^$9!#(B
foozy@708: $B$3$l$i$O$=$l$>$l!"2TF02DG=%W%i%C%H%[!<%`$d!"(B
foozy@708: $BFCD'E*$JF@<jITF@<j$J$I$NE@$G0[$J$j$^$9!#(B
foozy@708: $BKX$I$N%D!<%k$O%F%-%9%H%U%!%$%k$N%^!<%8$KFC2=$7$F$$$^$9$,!"(B
foozy@708: $BCf$K$OFCDj$N%U%!%$%k%U%)!<%^%C%H!J0lHL$K$O(B XML$B!K(B
foozy@708: $B$KFC2=$7$?$b$N$b$"$j$^$9!#(B
foozy@708: 
foozy@708: \subsection{A worked example}
foozy@708: 
foozy@708: $BK\@a$G$NNc$G$O!"(B
foozy@708: $BA0=R$N?^(B~\ref{fig:tour-merge:conflict} 
foozy@708: $B$K$*$1$k%U%!%$%k99?7$NMzNr$r:F8=$7$^$9!#(B
foozy@708: $B85$H$J$kHG$N%U%!%$%k$r3JG<$7$?%j%]%8%H%j$r:n@.$9$k$3$H$+$i;O$a$^$7$g$&(B
foozy@708: \footnote{$BLuCm(B: $B<B9TNc$G$O!"(B
foozy@708: $B?75,$N%j%]%8%H%j$G$"$k(B \dirname{scam} $B$N(B \hgcmd{init} $B$,H4$1$F$$$^$9!#(B}$B!#(B
foozy@708: 
foozy@708: \interaction{tour-merge-conflict.wife}
foozy@708: 
foozy@708: $B<!$K!"%j%]%8%H%j$rJ#@=$7!"%U%!%$%k$rJQ99$7$^$9!#(B
foozy@708: 
foozy@708: \interaction{tour-merge-conflict.cousin}
foozy@708: 
foozy@708: $B$b$&0l$D%j%]%8%H%j$rJ#@=$7!"(B
foozy@708: $BB>$NMxMQ<T$K$h$k%U%!%$%k$X$NJQ99$rLO5<E*$K:F8=$7$^$9(B
foozy@708: $B!J$3$NLO5<E*$J<B9T$O!"(B
foozy@708: $B%?%9%/$4$H$K3VN%$7$?%j%]%8%H%j$N4V$G$N%^!<%8$I$3$m$+!"(B
foozy@708: $B$=$l$i$N%^!<%8$N:]$N>WFM$r2r>C$9$k$3$H$G$9$i!"(B
foozy@708: $B7h$7$FDA$7$$$3$H$G$O$J$$!"(B
foozy@708: $B$H$$$&$3$H$r0E<($7$F$$$^$9!K!#(B
foozy@708: 
foozy@708: \interaction{tour-merge-conflict.son}
foozy@708: 
foozy@708: $BF10l%U%!%$%k$K#2$D$N0[$J$kHG$,$G$-$?$N$G!"(B
foozy@708: $B%^!<%8<B;\$N4D6-$,@0$$$^$7$?!#(B
foozy@708: 
foozy@708: \interaction{tour-merge-conflict.pull}
foozy@708: 
foozy@708: $B%^!<%8$K$*$1$kBPOCE*$J=hM}$NItJ,$,!"(B
foozy@708: $BK\=q$K$*$1$k<B9TNc$N<+F0<B9T5!9=(B~ref{sec:automated-example-running
foozy@708: }$B$rB;$M$k$?$a!"(B
foozy@708: $B$3$NNc$G$O(B Mercurial $B$N(B \command{hgmerge} $B$r;HMQ$7$^$;$s!#(B
foozy@708: $B$=$NBe$o$j$K!"(B
foozy@708: \envar{HGMERGE} $B$r@_Dj$9$k$3$H$G!"(B
foozy@708: Mercurial $B$KHsBPOCE*$J(B \command{merge} $B%3%^%s%I$r<B9T$5$;$^$9!#(B
foozy@708: $B$3$N%3%^%s%I$OB?$/$N(B Unix $BE*$J%7%9%F%`$KF1:-$5$l$F$$$^$9!#(B
foozy@708: $B0J2<$NNc$r<B:]$K;n$9:]$K$O!"(B
foozy@708: \envar{HGMERGE} $B$r$o$6$o$6@_Dj$9$kI,MW$O$"$j$^$;$s!#(B
foozy@708: 
foozy@708: \interaction{tour-merge-conflict.merge}
foozy@708: 
foozy@708: \command{merge} $B%3%^%s%I$O>WFM$r2r>C$;$:$K!"(B
foozy@708: $B$I$N9T$K$*$1$kJQ99$,>WFM$7$F$$$F!"(B
foozy@708: $B$=$NJQ99$,$I$N%A%'%s%8%;%C%H$KM3Mh$9$k$N$+$r<($9(B\emph{$B%^!<%8%^!<%/(B}$B$r!"(B
foozy@708: $B>WFM$,8!=P$5$l$?%U%!%$%k$K=q$-9~$_$^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$O!"(B
foozy@708: \command{merge} $B$N=*N;%3!<%I$,%^!<%8=hM}(B\footnote{$BLuCm(B:
foozy@708: $B$h$j@53N$K$O!V%^!<%8$K$*$1$k>WFM$N2r>C!W(B}$B<:GT$r<($9>l9g!"(B
foozy@708: $B%^!<%8=hM}$r:F<B9T$9$k<j=g$rI=<($7$^$9!#(B
foozy@708: $B$3$3$GDs<($5$l$k<j=g$O!"(B
foozy@708: $B%^!<%8:n6H$NESCf$G:.Mp$7$F$7$^$C$?$j!"(B
foozy@708: $B4V0c$C$F$7$^$C$?$3$H$K5$IU$$$F!"(B
foozy@708: $B%0%i%U%#%+%k$J%^!<%8%D!<%k$rCfES=*N;$5$;$?>l9g$J$I$KLrN)$A$^$9!#(B
foozy@708: 
foozy@708: $B<+F0$J$$$7<jF0$N%^!<%8$,<:GT$7$?>l9g$G$"$C$F$b!"(B
foozy@708: $B4XO"$NM-$k%U%!%$%k$rD>@\(B``$B=$@5(B''$B$7$?>e$G!"(B
foozy@708: $B%^!<%87k2L$r%3%_%C%H$9$k$3$H$b2DG=$G$9!#(B
foozy@708: 
foozy@708: \interaction{tour-merge-conflict.commit}
foozy@708: 
foozy@708: \section{Simplifying the pull-merge-commit sequence}
foozy@708: \label{sec:tour-merge:fetch}
foozy@708: 
foozy@708: $B$3$3$^$G$K=R$Y$F$-$?JQ99%^!<%8$N<j=g$OC1=c$J$b$N$G$9$,!"(B
foozy@708: $B#3$D$N%3%^%s%I$r=g$K<B9T$9$kI,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   hg pull
foozy@708:   hg merge
foozy@708:   hg commit -m 'Merged remote changes'
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B:G8e$N%3%_%C%H$N:]$K$O!"(B
foozy@708: $BDL>o$OLLGr$/$bL5$$(B``$B7h$^$j$-$C$?(B''$BFbMF$K$J$i$6$k$rF@$^$;$s$,!"(B
foozy@708: $B%3%_%C%H%a%C%;!<%8$rF~NO$9$kI,MW$,$"$j$^$9!#(B
foozy@708: 
foozy@708: $B2DG=$G$"$l$P!"I,MW$H$5$l$k<j=g$rDc8:$5$;$?$$$b$N$G$9!#(B
foozy@708: $B<B:]$K(B Mercurial $B$O!"$3$l$r2DG=$H$9$k(B \hgext{fetch} 
foozy@708: $B$H8F$P$l$k%$%/%9%F%s%7%g%s$,F1:-$5$l$F$$$^$9!#(B
foozy@708: 
foozy@708: Mercurial $B$O!"(B
foozy@708: $B<h$j07$$$NMxJX@->e$+$iCf3K5!G=$r>.$5$/4J7i$KJ]$D0lJ}$G!"(B
foozy@708: $B5!G=DI2C$r2DG=$K$9$k$?$a$N=@Fp$J3HD%!J%$%/%9%F%s%7%g%s!K5!9=$rDs6!$7$F$$$^$9!#(B
foozy@708: $B%3%^%s%I%i%$%s$+$iMxMQ$G$-$k(B 
foozy@708: Mercurial $B%3%^%s%I$rDI2C$9$k%$%/%9%F%s%7%g%s$b$"$l$P!"(B
foozy@708: $BNc$($P%5!<%P5!G=$r3HD%$9$k$h$&$J!"(B
foozy@708: ``$BIqBfN"(B''$B$G5!G=$9$k%$%/%9%F%s%7%g%s$b$"$j$^$9!#(B
foozy@708: 
foozy@708: \hgext{fetch} $B%$%/%9%F%s%7%g%s$O!"(B
foozy@708: $BM=A[$7$?$3$H$H$O;W$$$^$9$,!"(B
foozy@708: \hgcmd{fetch} $B$H8F$P$l$k?7$7$$%3%^%s%I$rDI2C$7$^$9!#(B
foozy@708: \hgcmd{fetch} $B%3%^%s%I$O!"(B
foozy@708: \hgcmd{pull}$B!?(B\hgcmd{update}$B!?(B\hgcmd{merge}$B!?(B\hgcmd{commit}
foozy@708: $B$NAH$_9g$o$;$N$h$&$K?6Iq$$$^$9!#(B
foozy@708: $B$^$:$OB>$N%j%]%8%H%j$+$i:n6HCf$N%j%]%8%H%j$XJQ99$r<h$j9~$_$^$9!#(B
foozy@708: $B<h$j9~$s$@%A%'%s%8%;%C%H$K$h$k?7$?$J(B head $B$NDI2C$,8!CN(B\footnote{$BLuCm(B:
foozy@708: $BB>$N%j%]%8%H%j$+$i$N<h$j9~$_$K$h$j!"(B
foozy@708: $B#3$D0J>e$N(B head $B$,%j%]%8%H%j$KB8:_$9$k$h$&$K$J$C$?>l9g$O!"(B
foozy@708: $B%^!<%8BP>]$NFCDj$,$G$-$J$$$?$a!"(B
foozy@708: $B<h$j9~$_$N$_$G=hM}$rCfCG$7$^$9!#(B}$B$5$l$?>l9g!"(B
foozy@708: $B%^!<%8$r3+;O$7!"(B
foozy@708: $B<+F0E*$K@8@.$5$l$?%3%_%C%H%a%C%;!<%8$r;H$C$F%3%_%C%H$r9T$$$^$9!#(B
foozy@708: $B?7$?$J(B head $B$NDI2C$,L5$+$C$?>l9g!"(B
foozy@708: \hgcmd{fetch} $B%3%^%s%I$O:n6HNN0h%G%#%l%/%H%j$r(B
foozy@708: tip $B%j%S%8%g%s$G99?7$7$^$9!#(B
foozy@708: 
foozy@708: \hgext{fetch} $B%$%/%9%F%s%7%g%s$O4JC1$KM-8z2=$G$-$^$9!#(B
foozy@708: \sfilename{.hgrc} $B%U%!%$%k$rJT=8$7!"(B
foozy@708: \rcsection{extensions} $B%;%/%7%g%s(B
foozy@708: $B!JL5$$>l9g$O:n@.$7$F$/$@$5$$!K$K0\F0$7!"(B
foozy@708: ``\Verb+fetch +'' $B$G;O$^$k9T$rDI2C$7$^$9!#(B
foozy@708: 
foozy@708: \begin{codesample2}
foozy@708:   [extensions]
foozy@708:   fetch =
foozy@708: \end{codesample2}
foozy@708: 
foozy@708: $B!JDL>o$O!"(B
foozy@708: ``\texttt{=}'' $B$N1&JU$K%$%/%9%F%s%7%g%s$N0LCV$r;XDj$7$^$9$,!"(B
foozy@708: \hgext{fetch} $B%$%/%9%F%s%7%g%s$OI8=`$NG[I[J*$KF1:-$5$l$F$$$k$N$G!"(B
foozy@708: Mercurial $B$O(B \hgext{fetch} $B$rC5$7=P$9$3$H$,$G$-$^$9!K(B
foozy@708: 
foozy@708: %%% Local Variables: 
foozy@708: %%% mode: latex
foozy@708: %%% TeX-master: "00book"
foozy@708: %%% End: 




