comparison ja/mq.tex @ 335:2a8c05da3fae

more mq.tex
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Mon, 31 Mar 2008 04:49:46 +0900
parents db3aa48f2f73
children b8791971ba65
comparison
equal deleted inserted replaced
334:4ffdaa0773a3 335:2a8c05da3fae
675 \end{figure} 675 \end{figure}
676 676
677 %\subsection{Safety checks, and overriding them} 677 %\subsection{Safety checks, and overriding them}
678 \subsection{$B0BA4@-%A%'%C%/$H%*!<%P%i%$%I(B} 678 \subsection{$B0BA4@-%A%'%C%/$H%*!<%P%i%$%I(B}
679 679
680 Several MQ commands check the working directory before they do 680 %Several MQ commands check the working directory before they do
681 anything, and fail if they find any modifications. They do this to 681 %anything, and fail if they find any modifications. They do this to
682 ensure that you won't lose any changes that you have made, but not yet 682 %ensure that you won't lose any changes that you have made, but not yet
683 incorporated into a patch. Figure~\ref{ex:mq:add} illustrates this; 683 %incorporated into a patch.Figure~\ref{ex:mq:add} illustrates this;
684 the \hgxcmd{mq}{qnew} command will not create a new patch if there are 684 %the \hgxcmd{mq}{qnew} command will not create a new patch if there are
685 outstanding changes, caused in this case by the \hgcmd{add} of 685 %outstanding changes, caused in this case by the \hgcmd{add} of
686 \filename{file3}. 686 %\filename{file3}.
687
688 $B$$$/$D$+$N(BMQ$B%3%^%s%I$O!$<B9T;~$K$^$:%o!<%-%s%0%G%#%l%/%H%j$r%A%'%C%/$7!$(B
689 $BJQ99$,$J$5$l$F$$$?$i=*N;$9$k$h$&$K$J$C$F$$$k!%$3$l$O!$%f!<%6$N$^$@%Q%C%A(B
690 $B$K<h$j9~$^$l$F$$$J$$JQ99$,<:$o$l$J$$$h$&$K$9$k$?$a$G$"$k!%(B
691 $B?^(B~\ref{ex:mq:add}$B$O$3$l$r@bL@$7$?$b$N$G!$(B\hgxcmd{mq}{qnew}$B%3%^%s%I$O8IN)(B
692 $B$7$?JQ99$,$"$k;~$K?7$?$J%Q%C%A$r@8@.$7$J$$!%$3$NNc$G$O!$JQ99$O(B
693 \hgcmd{add}$B$K$h$k(B\filename{file3}$B$NDI2C$K$h$C$F@8$^$l$F$$$k!%(B
687 694
688 \begin{figure}[ht] 695 \begin{figure}[ht]
689 \interaction{mq.tutorial.add} 696 \interaction{mq.tutorial.add}
690 \caption{Forcibly creating a patch} 697 % \caption{Forcibly creating a patch}
698 \caption{$B%Q%C%A$N6/@)E*$J@8@.(B}
691 \label{ex:mq:add} 699 \label{ex:mq:add}
692 \end{figure} 700 \end{figure}
693 701
694 Commands that check the working directory all take an ``I know what 702 %Commands that check the working directory all take an ``I know what
695 I'm doing'' option, which is always named \option{-f}. The exact 703 %I'm doing'' option, which is always named \option{-f}. The exact
696 meaning of \option{-f} depends on the command. For example, 704 %meaning of \option{-f} depends on the command. For example,
697 \hgcmdargs{qnew}{\hgxopt{mq}{qnew}{-f}} will incorporate any outstanding 705 %\hgcmdargs{qnew}{\hgxopt{mq}{qnew}{-f}} will incorporate any outstanding
698 changes into the new patch it creates, but 706 %changes into the new patch it creates, but
699 \hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-f}} will revert modifications to any 707 %\hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-f}} will revert modifications to any
700 files affected by the patch that it is popping. Be sure to read the 708 %files affected by the patch that it is popping. Be sure to read the
701 documentation for a command's \option{-f} option before you use it! 709 %documentation for a command's \option{-f} option before you use it!
710
711 $B%o!<%-%s%0%G%#%l%/%H%j$N%A%'%C%/$r9T$J$&%3%^%s%I$OA4$F!$>e5i<T8~$1$N6/@)(B
712 $B%*%W%7%g%s(B\option{-f}$B$r;}$C$F$$$k!%(B\option{-f}$B$N87L)$J0UL#$O!$%3%^%s%I$K(B
713 $B$h$C$F0[$J$k!%Nc$($P(B\hgcmdargs{qnew}{\hgxopt{mq}{qnew}{-f}}$B$O8IN)$7$?JQ(B
714 $B99$r?7$7$$%Q%C%A$K<h$j9~$`$H$$$&0UL#$@$,!$(B
715 \hgcmdargs{qpop}{\hgxopt{mq}{qpop}{-f}}$B$O!$%]%C%W$9$k%Q%C%A$K$h$k$"$i$f(B
716 $B$k%U%!%$%k$X$NJQ99$r<h$j>C$9$H$$$&0UL#$K$J$k!%(B\option{-f}$B%*%W%7%g%s$r;H(B
717 $B$&;~$OI,$:;vA0$K%3%^%s%I$N%I%-%e%a%s%H$rFI$s$G3NG'$9$k$h$&$K$7$FM_$7$$!%(B
702 718
703 %\subsection{Working on several patches at once} 719 %\subsection{Working on several patches at once}
704 \subsection{$BJ#?t$N%Q%C%A$r0lEY$K07$&(B} 720 \subsection{$BJ#?t$N%Q%C%A$r0lEY$K07$&(B}
705 721
706 The \hgxcmd{mq}{qrefresh} command always refreshes the \emph{topmost} 722 %The \hgxcmd{mq}{qrefresh} command always refreshes the \emph{topmost}
707 applied patch. This means that you can suspend work on one patch (by 723 %applied patch. This means that you can suspend work on one patch (by
708 refreshing it), pop or push to make a different patch the top, and 724 %refreshing it), pop or push to make a different patch the top, and
709 work on \emph{that} patch for a while. 725 %work on \emph{that} patch for a while.
710 726
711 Here's an example that illustrates how you can use this ability. 727 \hgxcmd{mq}{qrefresh}$B%3%^%s%I$O(B\emph{$B:G$b>e(B}$B$KE,MQ$5$l$?%Q%C%A$KBP$7$F%j(B
712 Let's say you're developing a new feature as two patches. The first 728 $B%U%l%C%7%e$r9T$J$&!%$3$l$O%j%U%l%C%7%e$K$h$C$F(B1$B$D$N%Q%C%A$K8=:_$N:n6H$r%5(B
713 is a change to the core of your software, and the second---layered on 729 $B%9%Z%s%I$7$?$j!$JL$N%H%C%W%Q%C%A$d0l;~E*$K:n6H$9$k$?$a%Q%C%A$r:n$k$?$a$K(B
714 top of the first---changes the user interface to use the code you just 730 $B%]%C%W$d%W%C%7%e$,$G$-$k$H$$$&$3$H$r0UL#$9$k!%(B
715 added to the core. If you notice a bug in the core while you're 731
716 working on the UI patch, it's easy to fix the core. Simply 732 %Here's an example that illustrates how you can use this ability.
717 \hgxcmd{mq}{qrefresh} the UI patch to save your in-progress changes, and 733 %Let's say you're developing a new feature as two patches. The first
718 \hgxcmd{mq}{qpop} down to the core patch. Fix the core bug, 734 %is a change to the core of your software, and the second---layered on
719 \hgxcmd{mq}{qrefresh} the core patch, and \hgxcmd{mq}{qpush} back to the UI 735 %top of the first---changes the user interface to use the code you just
720 patch to continue where you left off. 736 %added to the core. If you notice a bug in the core while you're
737 %working on the UI patch, it's easy to fix the core. Simply
738 %\hgxcmd{mq}{qrefresh} the UI patch to save your in-progress changes, and
739 %\hgxcmd{mq}{qpop} down to the core patch. Fix the core bug,
740 %\hgxcmd{mq}{qrefresh} the core patch, and \hgxcmd{mq}{qpush} back to the UI
741 %patch to continue where you left off.
742
743 $B$3$N5!G=$N;H$$J}$r<($9Nc$r<($9!%(B2$B$D$N%Q%C%A$H$7$F?7$7$$5!G=$r3+H/$7$F$$$k(B
744 $B$H$9$k!%:G=i$N$b$N$O$"$J$?$N%=%U%H%&%'%"$N%3%"$rJQ99$7!$(B2$BHVL\$N$b$N$O(B1$BHV(B
745 $BL\$N$b$N$N>e$KE83+$9$k!$:#DI2C$7$?%3%"$N%3!<%I$r;H$C$?%f!<%6%$%s%?%U%'!<(B
746 $B%9$@$H$9$k!%(BUI$B%Q%C%A$G:n6HCf$K%3%"$N%P%0$K5$IU$$$?$H$9$k$H!$4JC1$K%3%"$N(B
747 $B=$@5$O9T$J$($k!%C1=c$K(B\hgxcmd{mq}{qrefresh}$B$K$h$C$F?J9TCf$N(BUI$B%Q%C%A$r%;!<(B
748 $B%V$7!$(B\hgxcmd{mq}{qpop}$B$K$h$C$F%3%"%Q%C%A$XAL$k!%%3%"$N%P%0$r=$@5$7$?8e(B
749 $B$K(B\hgxcmd{mq}{qrefresh}$B$r%3%"%Q%C%A$K$D$$$F9T$J$$!$(B\hgxcmd{mq}{qpush}$B$G(B
750 UI$B%Q%C%A$KLa$C$F:n6H$rB3$1$k!%(B
721 751
722 %\section{More about patches} 752 %\section{More about patches}
723 \section{$B$5$i$K%Q%C%A$K$D$$$F(B} 753 \section{$B$5$i$K%Q%C%A$K$D$$$F(B}
724 \label{sec:mq:adv-patch} 754 \label{sec:mq:adv-patch}
725 755