Source

hgbook / ja / tour-merge.tex

\chapter{A tour of Mercurial: merging work}
\label{chap:tour-merge}

$BA0>O$K$*$$$F$O!"(B
$B%j%]%8%H%j$NJ#@=!"(B
$B%j%]%8%H%j$G$N%A%'%s%8%;%C%H$N@8@.!"(B
$B$J$i$S$K(B \hgcmd{push} $B$*$h$S(B \hgcmd{pull} 
$B$K$h$k%j%]%8%H%j4V$G$N%A%'%s%8%;%C%H$N<x<u$r8+$F$-$^$7$?!#(B
$B<!$NCJ3,$H$7$F!"JL!9$N%j%]%8%H%j$K$*$1$kJQ99$N(B\emph{$B%^!<%8(B}
$B!J(Bmerge$B!K$K$D$$$F8+$F$_$^$7$g$&!#(B

\section{Merging streams of work}

$BJ,;69=@.4IM}%D!<%k$K$*$$$F!"%^!<%8$O:n6H$N4pK\$G$9!#(B

\begin{itemize}
\item Alice $B$H(B Bob $B$,!"(B
  $B6&F1:n6H$7$F$$$k%W%m%8%'%/%H$N%j%]%8%H%j$+$iJ#@=$7$?!"(B
  $B8D?ME*$J%j%]%8%H%j$r;}$C$F$$$k$b$N$H$7$^$9!#(B
  Alice $B$O<+J,$N%j%]%8%H%j$K$*$$$F%P%0$r=$@5$7$^$7$?!#(B
  Bob $B$O<+J,$N%j%]%8%H%j$K$*$$$F5!G=$rDI2C$7$^$7$?!#(B
  $BFs?M$O!"(B
  $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

\item $BI.<T$O!"(B
  $B8DJL$N%j%]%8%H%j$K$h$C$F!"(B
  $B$*8_$$$,0BA4$K3VN%$5$l$?J#?t$N0[$J$k:n6H$r!"(B
  $BF10l%W%m%8%'%/%H$K$*$$$FF1;~$K<B;\$9$k$3$H$,IQHK$K$"$j$^$9!#(B
  $B$3$N7A<0$G$N:n6H$G$O!"(B
  $B$"$k%j%]%8%H%j$K$*$1$k@.2L$r!"(B
  $BB>$N%j%]%8%H%j$KBP$7$FIQHK$K%^!<%8$9$kI,MW$,$"$j$^$9!#(B

\end{itemize}

$B%^!<%8$OI,MW$K1~$8$F<B;\$9$k$"$j$U$l$?:n6H$G$9$N$G!"(B
Mercurial $B$G$O4JC1$K9T$($k$h$&$K$J$C$F$$$^$9!#(B
$B$=$l$G$O!"%^!<%8<j=g$r8+$F9T$-$^$7$g$&!#(B
$B$b$&0lEY%j%]%8%H%j$NJ#@=$r9T$$!J$b$&2?EY$bJ#@=$7$^$7$?$h$M!)!K!"(B
$B$=$N%j%]%8%H%j$K$*$$$FJQ99$r9T$$$^$9!#(B

\interaction{tour.merge.clone}

$B$3$N;~E@$G!"(B
$BFbMF$N0[$J$k#2$D$N(B \filename{hello.c} $B$N%3%T!<$,B8:_$9$k$O$:$G$9!#(B
$B#2$D$N%j%]%8%H%j$NMzNr$O!"(B
$B?^(B~\ref{fig:tour-merge:sep-repos} $B$K<($9$h$&$K!"(B
$B;^J,$+$l$7$F$$$^$9!#(B

\interaction{tour.merge.cat}

\begin{figure}[ht]
  \centering
  \grafix{tour-merge-sep-repos}
  \caption{Divergent recent histories of the \dirname{my-hello} and
    \dirname{my-new-hello} repositories}
  \label{fig:tour-merge:sep-repos}
\end{figure}

\hgcmd{pull} $B$r9T$C$F$b!"(B
$B:n6HNN0h%G%#%l%/%H%j$K$O1F6A$r5Z$\$5$J$$$3$H$O4{$K@bL@$7$?$H$*$j$G$9$N$G!"(B
\dirname{my-hello} $B$+$i(B \hgcmd{pull} $B$7$F$_$^$7$g$&!#(B

\interaction{tour.merge.pull}

$B:n6HNN0h%G%#%l%/%H%j$K$O1F6A$r5Z$\$7$F$$$^$;$s$,!"(B
\hgcmd{pull} $B%3%^%s%I$O(B ``heads'' $B$K$D$$$F2?$+7Y9p$7$F$$$^$9!#(B

\subsection{Head changesets}

``head'' $B$H$O!"(B
$B%j%]%8%H%jCf$K$*$$$F!"(B
$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
$B%j%]%8%H%j$K$*$1$k:G$b:G?7$N%j%S%8%g%s$O!"(B
$B0l@Z$N;R%A%'%s%8%;%C%H$r;}$A$^$;$s$+$i!"(B
$B=>$C$F(B tip $B%j%S%8%g%s$O(B head $B$H$J$j$^$9$,!"(B
$B#1$D$N%j%]%8%H%j$K$OJ#?t$N(B head $B$,B8:_$7$($^$9!#(B

\begin{figure}[ht]
  \centering
  \grafix{tour-merge-pull}
  \caption{Repository contents after pulling from \dirname{my-hello} into
    \dirname{my-new-hello}}
  \label{fig:tour-merge:pull}
\end{figure}

\dirname{my-hello} $B$+$i(B \dirname{my-new-hello} $B$X$N(B
\hgcmd{pull} $B$K$h$k1F6A$r!"(B
$B?^(B~\ref{fig:tour-merge:pull} $B$G8+$k$3$H$,$G$-$^$9!#(B
$B4{$K(B \dirname{my-new-hello} $B$KB8:_$7$F$$$?MzNr$K$O<j$,IU$1$i$l$F$$$^$;$s$,!"(B
$B?7$7$$%j%S%8%g%s$,DI2C$5$l$F$$$^$9!#(B
$B?^(B~\ref{fig:tour-merge:pull} $B$+$i$O!"(B
$B?7$7$$%j%]%8%H%j!J(B\dirname{my-new-hello}$B!K$K$*$$$F!"(B
\emph{$B%A%'%s%8%;%C%H<1JL;R(B}$B$OF1$8$^$^$G$b!"(B
\emph{$B%j%S%8%g%sHV9f(B}$B$,0[$J$kMM$,FI$_<h$l$^$9(B
$B!J$=$7$F!"?^$i$:$b!"%A%'%s%8%;%C%H$K$D$$$FOC$r$9$k:]$K!"(B
$B%j%S%8%g%sHV9f$r;HMQ$9$k$N$,NI$/$J$$!"$H$$$&9%Nc$K$J$C$F$$$^$9!K!#(B
\hgcmd{heads} $B%3%^%s%I$K$h$j!"(B
$B%j%]%8%H%j$N(B head $B$r8+$k$3$H$,$G$-$^$9!#(B

\interaction{tour.merge.heads}

\subsection{Performing the merge}

$B:n6HNN0h%G%#%l%/%H%j$r!"(B
$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
$B$$$D$b$N$h$&$K(B \hgcmd{update} $B%3%^%s%I$r<B9T$9$k$H!"(B
$B$I$&$J$k$G$7$g$&!)(B

\interaction{tour.merge.update}

Mercurial $B$+$i!"(B
\hgcmd{update} $B%3%^%s%I$G$O%^!<%8$,9T$o$l$J$$;]$,DLC#$5$l$^$9!#(B
$B%^!<%8$N<B;\$,I,MW$H;W$o$l$k>l9g!"(B
$B6/@)E*$J<B9T$r$7$J$$8B$j$O(B 
\hgcmd{update} $B%3%^%s%I$K$h$k:n6HNN0h%G%#%l%/%H%j$N99?7$O9T$o$l$^$;$s!#(B
\hgcmd{update} $B%3%^%s%I$NBe$o$j$K!"(B
\hgcmd{merge} $B%3%^%s%I$rMQ$$$F#2$D$N(B head $B$r%^!<%8$7$^$9!#(B

\interaction{tour.merge.merge}

\begin{figure}[ht]
  \centering
  \grafix{tour-merge-merge}
  \caption{Working directory and repository during merge, and
    following commit}
  \label{fig:tour-merge:merge}
\end{figure}

\hgcmd{merge} $B%3%^%s%I$K$h$C$F!"(B
\hgcmd{parents} $B%3%^%s%I$N=PNO!"(B
$B$*$h$S(B \filename{hello.c} $B$NFbMF$NJQ99$H$$$&7A$G!"(B
\emph{$BN>J}(B}$B$N(B head $B$NJQ99FbMF$,:n6HNN0h%G%#%l%/%H%j$KH?1G$5$l$^$9!#(B

\interaction{tour.merge.parents}

\subsection{Committing the results of the merge}

$B7k2L$r(B \hgcmd{commit} $B$9$k$^$G$O!"(B
\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

\interaction{tour.merge.commit}

$B$3$l$G!"?7$7$$(B tip $B%j%S%8%g%s$,:n@.$5$l$^$7$?!#(B
$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
$B$3$l$i$O!"@h$K(B \hgcmd{parents} $B$GI=<($7$?%j%S%8%g%s$H0lCW$7$^$9!#(B

\interaction{tour.merge.tip}

$B:n6HNN0h%G%#%l%/%H%j$,%^!<%8$N:]$K$I$N$h$&$K$J$C$F$$$k$N$+!"(B
$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
$B?^(B~\ref{fig:tour-merge:merge} $B$+$iFI$_<h$k$3$H$,$G$-$^$9!#(B
$B%^!<%8$N:]$K:n6HNN0h%G%#%l%/%H%j$N?F$G$"$C$?#2$D$N%A%'%s%8%;%C%H$O!"(B
$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

\section{Merging conflicting changes}

$BKX$I$N%^!<%8:n6H$O4JC1$K:Q$_$^$9$,!"(B
$B;~$K$O%^!<%8BP>]$N%A%'%s%8%;%C%HF1;N$,!"(B
$BF1$8%U%!%$%k$NF1$8It0L$rJQ99$7$F$$$k>l9g$,$"$j$^$9!#(B
$BN><T$NJQ99FbMF$,F10l$GL5$1$l$P!"(B
$B%^!<%8$O(B\emph{$B>WFM(B}$B!J(Bconflict$B!K$r@8$8$k$?$a!"(B
$BN><T$N0[$J$kJQ99FbMF$rN>N)$5$;$F(B
$B2?$i$+$N0l4S@-$N<h$l$?>uBV$K$9$k$?$a$N7hCG$,I,MW$G$9!#(B

\begin{figure}[ht]
  \centering
  \grafix{tour-merge-conflict}
  \caption{Conflicting changes to a document}
  \label{fig:tour-merge:conflict}
\end{figure}

$BJ8=q$KBP$9$k#2$D$NJQ99$N>WFM$NNc$r!"(B
$B?^(B~\ref{fig:tour-merge:conflict} $B$,?^<($7$F$$$^$9!#(B
$BN><T$O%U%!%$%k$NF1$8HG$r85$K$7$F$$$^$9$,!"(B
$B0lJ}$,JQ99$r9T$&K5$i!"(B
$BB>J}$,F1$8CJMn$KBP$7$F0[$J$kJ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D6-JQ?t$GDj5A$5$l$k%(%G%#%?!J$J$$$7(B \command{vi}$B!K(B
$B$r5/F0$7$F!"(B
$B$=$l$>$l$N%A%'%s%8%;%C%H$KM3Mh$9$kJQ99$N4V$G$ND4Dd$rMW5a$7$F$-$^$9!#(B
}$B!#(B

\envar{HGMERGE} 
$B4D6-JQ?t$K5/F0BP>]%W%m%0%i%`$J$$$7%9%/%j%W%HL>$r@_Dj$9$k$3$H$G!"(B
Mercurial $B$K(B \command{hgmerge} $B0J30$r5/F0$5$;$k;v$b$G$-$^$9(B

\subsection{Using a graphical merge tool}

$BCx<T$N$*A&$a$N%0%i%U%#%+%k$J%^!<%8%D!<%k$O(B \command{kdiff3} $B$J$N$G!"(B
$B%0%i%U%#%+%k$J%U%!%$%k%^!<%8%D!<%k$K5a$a$i$l$k5!G=$K$D$$$F!"(B
$B$3$l$rBj:`$K@bL@$7$h$&$H;W$$$^$9!#(B
$B:n6HCf$N2hLL%$%a!<%8$,?^(B~\ref{fig:tour-merge:kdiff3}$B$K$"$j$^$9!#(B
$BCeL\$7$F$$$k#1$D$N%U%!%$%k$KBP$7$F!"(B
$B#3$D$N0[$J$k%j%S%8%g%s$,B8:_$9$k$3$H$+$i!"(B
$B%^!<%8J}K!$O(B\emph{$B#3J}8~%^!<%8(B}$B!J(Bthree-way merge$B!K$H8F$P$l$F$$$^$9!#(B
$B$=$l$f$(!"%^!<%8%D!<%k$O%&%#%s%I%&>eIt$r#3$D$N6h2h$KJ,3d$7$F$$$^$9!#(B

\begin{itemize}
\item $B:8C<$KI=<($5$l$F$$$k$N$O!"(B
  $B%U%!%$%k$N(B\emph{$B85(B}$B!J(Bbase$B!K$NHG!"(B
  $B$D$^$j%^!<%8BP>]$H$7$F$$$k#2$D$NHG$K$H$C$F!"(B
  $B:G$b?7$7$$J,4t85$H$J$C$F$$$kHG$G$9!#(B

\item $BCf1{$KI=<($5$l$F$$$k$N$O!"(B
  $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
  $B:n6HNN0h%G%#%l%/%H%j$K$*$1$kJQ99FbMF$,I=<($5$l$^$9!#(B

\item $B1&C<$KI=<($5$l$F$$$k$N$O!"(B
  $B%^!<%8(B``$B85(B''\footnote{$BLuCm(B: $B86J8$G$O!V(B``their'' version$B!W(B}$B$G$9$N$G!"(B
  $B%^!<%8$7$h$&$H$7$F$$$k%A%'%s%8%;%C%H$KM3Mh$9$kFbMF$,I=<($5$l$^$9!#(B

\end{itemize}

$B$3$l$i$N6h2h$N2<J}$KI=<($5$l$F$$$k$N$O!"(B
$B8=;~E@$G$N%^!<%8(B\emph{$B7k2L(B}$B$G$9!#(B
$B%^!<%8$K$*$1$k:n6H$H$O!"(B
$B2hLL>e$K@V;z$GI=<($5$l$?(B\footnote{$BLuCm(B:
\command{diff3} $B$,9TC10L$G$N>WFMI=<($G$"$k$N$KHf$Y$F!"(B
GUI $B$G$"$kMxE@$,@8$-$F$$$^$9!#(B}$B!"(B
$B?5=E$J%U%!%$%k$N%^!<%8$,I,MW$H$5$l$kL$2r7h$N>WFM$r!"(B
$BBEEv$JFbMF$GCV$-49$($k$3$H$G$9!#(B

$B$3$l$i#4$D$N6h2h$O(B\emph{$B8_$$$K8GDj(B}$B$5$l$F$$$k$N$G!"(B
$B$$$:$l$+$N6h2h$r%9%/%m!<%k$5$;$?>l9g$K$O!"(B
$BB>$N6h2h$bAj1~$N>l=j$rI=<($9$k$h$&$K99?7$5$l$^$9!#(B

\begin{figure}[ht]
  \centering
  \grafixL{kdiff3}
  \label{fig:tour-merge:kdiff3}
  \caption{Using \command{kdiff3} to merge versions of a file}
\end{figure}

$B%U%!%$%kCf$N8D!9$N>WFM2U=j$K$*$$$F!"(B
$B>WFM$r2r>C$9$k$?$a$K!"(B
$B85HG!?%^!<%8@hHG!?%^!<%885HG$N%F%-%9%H$r(B
$B!J$=$l$i$NAH$_9g$o$;$b4^$a$F!KG$0U$KA*Br$9$k$3$H$,$G$-$^$9!#(B
$B$^$?!"99$J$kJQ99$r9T$&$?$a$K!"(B
$B%^!<%87k2L$rD>@\<j$GF~NO$9$k$3$H$b$G$-$^$9!#(B

$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
$B$3$l$i$O$=$l$>$l!"2TF02DG=%W%i%C%H%[!<%`$d!"(B
$BFCD'E*$JF@<jITF@<j$J$I$NE@$G0[$J$j$^$9!#(B
$BKX$I$N%D!<%k$O%F%-%9%H%U%!%$%k$N%^!<%8$KFC2=$7$F$$$^$9$,!"(B
$BCf$K$OFCDj$N%U%!%$%k%U%)!<%^%C%H!J0lHL$K$O(B XML$B!K(B
$B$KFC2=$7$?$b$N$b$"$j$^$9!#(B

\subsection{A worked example}

$BK\@a$G$NNc$G$O!"(B
$BA0=R$N?^(B~\ref{fig:tour-merge:conflict} 
$B$K$*$1$k%U%!%$%k99?7$NMzNr$r:F8=$7$^$9!#(B
$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
\footnote{$BLuCm(B: $B<B9TNc$G$O!"(B
$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

\interaction{tour-merge-conflict.wife}

$B<!$K!"%j%]%8%H%j$rJ#@=$7!"%U%!%$%k$rJQ99$7$^$9!#(B

\interaction{tour-merge-conflict.cousin}

$B$b$&0l$D%j%]%8%H%j$rJ#@=$7!"(B
$BB>$NMxMQ<T$K$h$k%U%!%$%k$X$NJQ99$rLO5<E*$K:F8=$7$^$9(B
$B!J$3$NLO5<E*$J<B9T$O!"(B
$B%?%9%/$4$H$K3VN%$7$?%j%]%8%H%j$N4V$G$N%^!<%8$I$3$m$+!"(B
$B$=$l$i$N%^!<%8$N:]$N>WFM$r2r>C$9$k$3$H$G$9$i!"(B
$B7h$7$FDA$7$$$3$H$G$O$J$$!"(B
$B$H$$$&$3$H$r0E<($7$F$$$^$9!K!#(B

\interaction{tour-merge-conflict.son}

$BF10l%U%!%$%k$K#2$D$N0[$J$kHG$,$G$-$?$N$G!"(B
$B%^!<%8<B;\$N4D6-$,@0$$$^$7$?!#(B

\interaction{tour-merge-conflict.pull}

$B%^!<%8$K$*$1$kBPOCE*$J=hM}$NItJ,$,!"(B
$BK\=q$K$*$1$k<B9TNc$N<+F0<B9T5!9=(B~ref{sec:automated-example-running
}$B$rB;$M$k$?$a!"(B
$B$3$NNc$G$O(B Mercurial $B$N(B \command{hgmerge} $B$r;HMQ$7$^$;$s!#(B
$B$=$NBe$o$j$K!"(B
\envar{HGMERGE} $B$r@_Dj$9$k$3$H$G!"(B
Mercurial $B$KHsBPOCE*$J(B \command{merge} $B%3%^%s%I$r<B9T$5$;$^$9!#(B
$B$3$N%3%^%s%I$OB?$/$N(B Unix $BE*$J%7%9%F%`$KF1:-$5$l$F$$$^$9!#(B
$B0J2<$NNc$r<B:]$K;n$9:]$K$O!"(B
\envar{HGMERGE} $B$r$o$6$o$6@_Dj$9$kI,MW$O$"$j$^$;$s!#(B

\interaction{tour-merge-conflict.merge}

\command{merge} $B%3%^%s%I$O>WFM$r2r>C$;$:$K!"(B
$B$I$N9T$K$*$1$kJQ99$,>WFM$7$F$$$F!"(B
$B$=$NJQ99$,$I$N%A%'%s%8%;%C%H$KM3Mh$9$k$N$+$r<($9(B\emph{$B%^!<%8%^!<%/(B}$B$r!"(B
$B>WFM$,8!=P$5$l$?%U%!%$%k$K=q$-9~$_$^$9!#(B

Mercurial $B$O!"(B
\command{merge} $B$N=*N;%3!<%I$,%^!<%8=hM}(B\footnote{$BLuCm(B:
$B$h$j@53N$K$O!V%^!<%8$K$*$1$k>WFM$N2r>C!W(B}$B<:GT$r<($9>l9g!"(B
$B%^!<%8=hM}$r:F<B9T$9$k<j=g$rI=<($7$^$9!#(B
$B$3$3$GDs<($5$l$k<j=g$O!"(B
$B%^!<%8:n6H$NESCf$G:.Mp$7$F$7$^$C$?$j!"(B
$B4V0c$C$F$7$^$C$?$3$H$K5$IU$$$F!"(B
$B%0%i%U%#%+%k$J%^!<%8%D!<%k$rCfES=*N;$5$;$?>l9g$J$I$KLrN)$A$^$9!#(B

$B<+F0$J$$$7<jF0$N%^!<%8$,<:GT$7$?>l9g$G$"$C$F$b!"(B
$B4XO"$NM-$k%U%!%$%k$rD>@\(B``$B=$@5(B''$B$7$?>e$G!"(B
$B%^!<%87k2L$r%3%_%C%H$9$k$3$H$b2DG=$G$9!#(B

\interaction{tour-merge-conflict.commit}

\section{Simplifying the pull-merge-commit sequence}
\label{sec:tour-merge:fetch}

$B$3$3$^$G$K=R$Y$F$-$?JQ99%^!<%8$N<j=g$OC1=c$J$b$N$G$9$,!"(B
$B#3$D$N%3%^%s%I$r=g$K<B9T$9$kI,MW$,$"$j$^$9!#(B

\begin{codesample2}
  hg pull
  hg merge
  hg commit -m 'Merged remote changes'
\end{codesample2}

$B:G8e$N%3%_%C%H$N:]$K$O!"(B
$BDL>o$OLLGr$/$bL5$$(B``$B7h$^$j$-$C$?(B''$BFbMF$K$J$i$6$k$rF@$^$;$s$,!"(B
$B%3%_%C%H%a%C%;!<%8$rF~NO$9$kI,MW$,$"$j$^$9!#(B

$B2DG=$G$"$l$P!"I,MW$H$5$l$k<j=g$rDc8:$5$;$?$$$b$N$G$9!#(B
$B<B:]$K(B Mercurial $B$O!"$3$l$r2DG=$H$9$k(B \hgext{fetch} 
$B$H8F$P$l$k%$%/%9%F%s%7%g%s$,F1:-$5$l$F$$$^$9!#(B

Mercurial $B$O!"(B
$B<h$j07$$$NMxJX@->e$+$iCf3K5!G=$r>.$5$/4J7i$KJ]$D0lJ}$G!"(B
$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
$B%3%^%s%I%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B%U%!%$%k$rJT=8$7!"(B
\rcsection{extensions} $B%;%/%7%g%s(B
$B!JL5$$>l9g$O:n@.$7$F$/$@$5$$!K$K0\F0$7!"(B
``\Verb+fetch +'' $B$G;O$^$k9T$rDI2C$7$^$9!#(B

\begin{codesample2}
  [extensions]
  fetch =
\end{codesample2}

$B!JDL>o$O!"(B
``\texttt{=}'' $B$N1&JU$K%$%/%9%F%s%7%g%s$N0LCV$r;XDj$7$^$9$,!"(B
\hgext{fetch} $B%$%/%9%F%s%7%g%s$OI8=`$NG[I[J*$KF1:-$5$l$F$$$k$N$G!"(B
Mercurial $B$O(B \hgext{fetch} $B$rC5$7=P$9$3$H$,$G$-$^$9!K(B

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "00book"
%%% End: 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.