Mercurial > hgbook
changeset 344:cea705a64649
more mq.tex
author | Yoshiki Yazawa <yaz@honeyplnaet.jp> |
---|---|
date | Sun, 13 Jul 2008 03:48:07 +0900 |
parents | f3f56da2e650 |
children | 6da6c5741e90 |
files | ja/mq.tex |
diffstat | 1 files changed, 130 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- a/ja/mq.tex Sun Jul 13 01:01:02 2008 +0900 +++ b/ja/mq.tex Sun Jul 13 03:48:07 2008 +0900 @@ -1156,71 +1156,144 @@ \section{$BBP>]%3!<%I$NJQ2=$K9g$o$;$F%Q%C%A$r99?7$9$k(B} \label{sec:mq:merge} -It's common to have a stack of patches on top of an underlying -repository that you don't modify directly. If you're working on -changes to third-party code, or on a feature that is taking longer to -develop than the rate of change of the code beneath, you will often -need to sync up with the underlying code, and fix up any hunks in your -patches that no longer apply. This is called \emph{rebasing} your -patch series. +%It's common to have a stack of patches on top of an underlying +%repository that you don't modify directly. If you're working on +%changes to third-party code, or on a feature that is taking longer to +%develop than the rate of change of the code beneath, you will often +%need to sync up with the underlying code, and fix up any hunks in your +%patches that no longer apply. This is called \emph{rebasing} your +%patch series. + +$BD>@\JQ99$7$J$$%j%]%8%H%j$N>e$K%Q%C%A$N%9%?%C%/$r4IM}$9$k$3$H$O$h$/9T$o$l(B +$B$k!%%5!<%I%Q!<%F%#$N%3!<%I$rJQ99$9$k:n6H$r$7$F$$$k>l9g$d!$85$K$J$k%3!<%I(B +$B$NJQ99IQEY$KHf$Y$FD9$$;~4V$,$+$+$k5!G=$r3+H/$7$F$$$k>l9g!$$7$P$7$P85$N%3!<(B +$B%I$NF14|$r9T$$!$%Q%C%A$NCf$N$b$O$dE,MQ$G$-$J$/$J$C$?(Bhunk$B$r=$@5$9$k$3$H$K(B +$B$J$k$@$m$&!%$3$l$O%Q%C%A$N(B\emph{rebasing}$B$H8F$P$l$k!%(B + +%The simplest way to do this is to \hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a}} +%your patches, then \hgcmd{pull} changes into the underlying +%repository, and finally \hgcmdargs{qpush}{\hgxopt{mq}{qpop}{-a}} your +%patches again. MQ will stop pushing any time it runs across a patch +%that fails to apply during conflicts, allowing you to fix your +%conflicts, \hgxcmd{mq}{qrefresh} the affected patch, and continue pushing +%until you have fixed your entire stack. -The simplest way to do this is to \hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a}} -your patches, then \hgcmd{pull} changes into the underlying -repository, and finally \hgcmdargs{qpush}{\hgxopt{mq}{qpop}{-a}} your -patches again. MQ will stop pushing any time it runs across a patch -that fails to apply during conflicts, allowing you to fix your -conflicts, \hgxcmd{mq}{qrefresh} the affected patch, and continue pushing -until you have fixed your entire stack. +$B$3$l$r9T$&:G$b4JC1$JJ}K!$O!$%Q%C%A$KBP$7$F(B +\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a}}$B$r9T$$!$2<0L$N%j%]%8%H%j$K(B +\hgcmd{pull}$B$r9T$&!%$=$7$F:G8e$K%Q%C%A$K:F$S(B +\hgcmdargs{qpush}{\hgxopt{mq}{qpop}{-a}}$B$r9T$&!%(B MQ$B$O%Q%C%AE,MQCf$K%3%s%U(B +$B%j%/%H$,$"$k$H!$$$$D$G$b%W%C%7%e$rDd;_$7!$(B\hgxcmd{mq}{qrefresh}$B$K$h$C$F%3(B +$B%s%U%j%/%H$r=$@5$9$k5!2q$rM?$($k!%$=$N8e$K$9$Y$F$N%Q%C%A%9%?%C%/$rE,MQ$9(B +$B$k$^$G%W%C%7%e$rB3$1$k!%(B + +%This approach is easy to use and works well if you don't expect +%changes to the underlying code to affect how well your patches apply. +%If your patch stack touches code that is modified frequently or +%invasively in the underlying repository, however, fixing up rejected +%hunks by hand quickly becomes tiresome. -This approach is easy to use and works well if you don't expect -changes to the underlying code to affect how well your patches apply. -If your patch stack touches code that is modified frequently or -invasively in the underlying repository, however, fixing up rejected -hunks by hand quickly becomes tiresome. +$B$3$N%"%W%m!<%A$O4JC1$G!$%Q%C%A$NE,MQ$5$l$k2<0L$N%3!<%I$X$NJQ99$,$J$1$l$P(B +$B$&$^$/F/$/!%$7$+$7!$%Q%C%A%9%?%C%/$,!$IQHK$K99?7$5$l$?$j!$2<0L%j%]%8%H%j(B +$B$X?/F~E*$K99?7$5$l$?$j$9$k%3!<%I$K?($l$F$$$k>l9g$O%j%8%'%/%H$5$l$?%3!<%I(B +$B$N=$@5$OLLE]$J$b$N$K$J$k!%(B + +%It's possible to partially automate the rebasing process. If your +%patches apply cleanly against some revision of the underlying repo, MQ +%can use this information to help you to resolve conflicts between your +%patches and a different revision. + +rebase$B%W%m%;%9$rItJ,E*$K<+F02=$9$k$3$H$O2DG=$G$"$k!%%Q%C%A$,2<0L$N%j%]%8(B +$B%H%j$N$$$:$l$+$N%P!<%8%g%s$K%/%j!<%s$KE,MQ$G$-$k$N$G$"$l$P!$(BMQ$B$O$3$N>pJs(B +$B$r;H$C$F%Q%C%A$H$=$NB>$N%j%S%8%g%s$H$N4V$N%3%s%U%j%/%H$r2r>C$9$k$N$r1g=u(B +$B$9$k!%(B -It's possible to partially automate the rebasing process. If your -patches apply cleanly against some revision of the underlying repo, MQ -can use this information to help you to resolve conflicts between your -patches and a different revision. - -The process is a little involved. +%The process is a little involved. +$B$3$N%W%m%;%9$O$d$d9~$_F~$C$F$$$k!%(B \begin{enumerate} -\item To begin, \hgcmdargs{qpush}{-a} all of your patches on top of - the revision where you know that they apply cleanly. -\item Save a backup copy of your patch directory using - \hgcmdargs{qsave}{\hgxopt{mq}{qsave}{-e} \hgxopt{mq}{qsave}{-c}}. This prints - the name of the directory that it has saved the patches in. It will - save the patches to a directory called - \sdirname{.hg/patches.\emph{N}}, where \texttt{\emph{N}} is a small - integer. It also commits a ``save changeset'' on top of your - applied patches; this is for internal book-keeping, and records the - states of the \sfilename{series} and \sfilename{status} files. -\item Use \hgcmd{pull} to bring new changes into the underlying - repository. (Don't run \hgcmdargs{pull}{-u}; see below for why.) -\item Update to the new tip revision, using - \hgcmdargs{update}{\hgopt{update}{-C}} to override the patches you - have pushed. -\item Merge all patches using \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m} - \hgxopt{mq}{qpush}{-a}}. The \hgxopt{mq}{qpush}{-m} option to \hgxcmd{mq}{qpush} - tells MQ to perform a three-way merge if the patch fails to apply. +%\item To begin, \hgcmdargs{qpush}{-a} all of your patches on top of +% the revision where you know that they apply cleanly. +\item $B:G=i$K!$%Q%C%A$,%/%j!<%s$KE,MQ$G$-$k%j%S%8%g%s$N>e$G!$$9$Y$F$N%Q%C(B + $B%A$KBP$7$F(B\hgcmdargs{qpush}{-a}$B$r9T$&!%(B + +%\item Save a backup copy of your patch directory using +% \hgcmdargs{qsave}{\hgxopt{mq}{qsave}{-e} \hgxopt{mq}{qsave}{-c}}. +% This prints +% the name of the directory that it has saved the patches in. It will +% save the patches to a directory called +% \sdirname{.hg/patches.\emph{N}}, where \texttt{\emph{N}} is a small +% integer. It also commits a ``save changeset'' on top of your + +% applied patches; this is for internal book-keeping, and records the +% states of the \sfilename{series} and \sfilename{status} files. + +\item $B%Q%C%A%G%#%l%/%H%j$r%;!<%V$r(B + \hgcmdargs{qsave}{\hgxopt{mq}{qsave}{-e} \hgxopt{mq}{qsave}{-c}}$B$r(B + $BMQ$$$F9T$&!%%Q%C%A$r%;!<%V$7$?%G%#%l%/%H%jL>$,I=<($5$l$k!%$3$N%3%^(B + $B%s%I$O!$(B\sdirname{.hg/patches.\emph{N}}$B$H$$$&%G%#%l%/%H%j$K%;!<%V$r(B + $B9T$&!%$3$3$G(B\texttt{\emph{N}}$B$O>.$5$$@0?t$G$"$k!%$3$N%3%^%s%I$O(B``$B%;!<(B + $B%V%A%'%s%8%;%C%H(B''$B$rE,MQ$5$l$?%Q%C%A$N>e$K%3%_%C%H$9$k!%$3$l$OFbIt(B + $BE*$J4IM}$H!$(B\sfilename{series}$B%U%!%$%k5Z$S(B\sfilename{status}$B%U%!%$(B + $B%k$N>uBV$r5-O?$9$k$?$a$G$"$k!%(B + +%\item Use \hgcmd{pull} to bring new changes into the underlying +% repository. (Don't run \hgcmdargs{pull}{-u}; see below for why.) + +\item \hgcmd{pull}$B%3%^%s%I$r;H$C$F?7$?$JJQ99$r2<0L$N%j%]%8%H%j$K<h$j9~(B + $B$`!%(B(\hgcmdargs{pull}{-u}$B$r<B9T$7$F$O$$$1$J$$!%M}M3$K$D$$$F$O2<5-(B + $B$r;2>H!%(B) + +%\item Update to the new tip revision, using +% \hgcmdargs{update}{\hgopt{update}{-C}} to override the patches you +% have pushed. + +\item \hgcmdargs{update}{\hgopt{update}{-C}}$B$rMQ$$$F!$(Bpush$B$7$?%Q%C%A$r%*!<(B + $B%P%i%$%I$7$F?7$?$J(Btip$B%j%S%8%g%s$X$N%"%C%W%G!<%H$r9T$&!%(B + +%\item Merge all patches using \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m} +% \hgxopt{mq}{qpush}{-a}}. The \hgxopt{mq}{qpush}{-m} option to \hgxcmd{mq}{qpush} +% tells MQ to perform a three-way merge if the patch fails to apply. + +\item \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m} \hgxopt{mq}{qpush}{-a}}$B$r(B + $BMQ$$$F$9$Y$F$N%Q%C%A$N%^!<%8$r9T$&!%(B\hgxopt{mq}{qpush}{-m}$B%*%W%7%g(B + $B%s$r(B\hgxcmd{mq}{qpush}$B$KIU$1$k$H!$(BMQ$B$O%Q%C%A$NE,MQ$K<:GT$7$?>l(B + $B9g!$(B3$B%&%'%$%^!<%8$r9T$&!%(B + \end{enumerate} -During the \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m}}, each patch in the -\sfilename{series} file is applied normally. If a patch applies with -fuzz or rejects, MQ looks at the queue you \hgxcmd{mq}{qsave}d, and -performs a three-way merge with the corresponding changeset. This -merge uses Mercurial's normal merge machinery, so it may pop up a GUI -merge tool to help you to resolve problems. +%During the \hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m}}, each patch in the +%\sfilename{series} file is applied normally. If a patch applies with +%fuzz or rejects, MQ looks at the queue you \hgxcmd{mq}{qsave}d, and +%performs a three-way merge with the corresponding changeset. This +%merge uses Mercurial's normal merge machinery, so it may pop up a GUI +%merge tool to help you to resolve problems. + +\hgcmdargs{qpush}{\hgxopt{mq}{qpush}{-m}}$B%3%^%s%I$N<B9T(B +$BCf!$(B\sfilename{series}$BFb$N%Q%C%A$ODL>oDL$jE,MQ$5$l$k!%$b$7%Q%C%A$,(Bfuzz$B$d(B +reject$B$r=P$7$?>l9g!$(BMQ$B$O(B\hgxcmd{mq}{qsave}$B$7$?%-%e!<$r;2>H$7!$BP1~$9$k%A%'(B +$B%s%8%;%C%H$H$N4V$G(B3$B%&%'%$%^!<%8$r9T$&!%%^!<%8$O(BMercurial$B$NDL>o$N5!9=$r;H$C(B +$B$F9T$o$l$k$?$a!$@_Dj$K$h$C$FLdBj$r2r7h$9$k$?$a$N(BGUI$B%^!<%8%D!<%k$J$I$,5/F0(B +$B$9$k!%(B + +%When you finish resolving the effects of a patch, MQ refreshes your +%patch based on the result of the merge. -When you finish resolving the effects of a patch, MQ refreshes your -patch based on the result of the merge. +$B%Q%C%A$N1F6A$N2r7h$r=*$($?;~!$(BMQ$B$O%^!<%8$N7k2L$rF'$^$($F%Q%C%A$N%j%U%l%C(B +$B%7%e$r9T$&!%(B + +%At the end of this process, your repository will have one extra head +%from the old patch queue, and a copy of the old patch queue will be in +%\sdirname{.hg/patches.\emph{N}}. You can remove the extra head using -At the end of this process, your repository will have one extra head -from the old patch queue, and a copy of the old patch queue will be in -\sdirname{.hg/patches.\emph{N}}. You can remove the extra head using -\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a} \hgxopt{mq}{qpop}{-n} patches.\emph{N}} -or \hgcmd{strip}. You can delete \sdirname{.hg/patches.\emph{N}} once -you are sure that you no longer need it as a backup. +%\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a} \hgxopt{mq}{qpop}{-n} patches.\emph{N}} +%or \hgcmd{strip}. You can delete \sdirname{.hg/patches.\emph{N}} once +%you are sure that you no longer need it as a backup. + +$B$3$N%W%m%;%9$N:G8e$K%j%]%8%H%j$K$O8E$$%Q%C%A%-%e!<$KM3Mh$9$k0l$DM>J,$J(B +head$B$,$G$-!$8E$$%Q%C%A%-%e!<$,(B\sdirname{.hg/patches.\emph{N}}$B$K%3%T!<$5$l(B +$B$k!%$3$N(Bhead$B$O(B\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-a} +\hgxopt{mq}{qpop}{-n} patches.\emph{N}}$B$^$?$O(B\hgcmd{strip}$B$K$h$C$F>C5n$G(B +$B$-$k!%%P%C%/%"%C%W$,ITMW$J$3$H$,J,$+$l$P!$(B\sdirname{.hg/patches.\emph{N}}$B$r(B +$B>C5n$7$F$b9=$o$J$$!%(B %\section{Identifying patches} \section{$B%Q%C%A$N<1JL(B}