Mercurial > hgbook
comparison ja/template.tex @ 363:bc92b28fc970
finished template.tex
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 23 Sep 2008 12:27:24 +0900 |
parents | df4ac9043db0 |
children | 8a3041e6f3cb |
comparison
equal
deleted
inserted
replaced
362:df4ac9043db0 | 363:bc92b28fc970 |
---|---|
183 | 183 |
184 $BC1=c$J%F%s%W%l!<%H$O0J2<$N$h$&$J%-!<%o!<%I$r;H$C$FD>$A$K=q$/$3$H$,$G$-$k!%(B | 184 $BC1=c$J%F%s%W%l!<%H$O0J2<$N$h$&$J%-!<%o!<%I$r;H$C$FD>$A$K=q$/$3$H$,$G$-$k!%(B |
185 | 185 |
186 \begin{itemize} | 186 \begin{itemize} |
187 %\item[\tplkword{author}] String. The unmodified author of the changeset. | 187 %\item[\tplkword{author}] String. The unmodified author of the changeset. |
188 \item[\tplkword{author}] $BJ8;zNs!%%A%'%s%8%;%C%H$NCx<T$,$=$N$b$N!%(B | 188 \item[\tplkword{author}] $BJ8;zNs!%%A%'%s%8%;%C%H$NCx<T!%(B |
189 %\item[\tplkword{branches}] String. The name of the branch on which | 189 %\item[\tplkword{branches}] String. The name of the branch on which |
190 % the changeset was committed. Will be empty if the branch name was | 190 % the changeset was committed. Will be empty if the branch name was |
191 % \texttt{default}. | 191 % \texttt{default}. |
192 \item[\tplkword{branches}] $BJ8;zNs!%%A%'%s%8%;%C%H$,%3%_%C%H$5$l$?%V%i%s(B | 192 \item[\tplkword{branches}] $BJ8;zNs!%%A%'%s%8%;%C%H$,%3%_%C%H$5$l$?%V%i%s(B |
193 $B%A$NL>A0!%%V%i%s%AL>$,(B\texttt{default}$B$N>l9g$O(B | 193 $B%A$NL>A0!%%V%i%s%AL>$,(B\texttt{default}$B$N>l9g$O(B |
461 % For example, ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' | 461 % For example, ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' |
462 % becomes ``\Verb+Bryan O'Sullivan+''. | 462 % becomes ``\Verb+Bryan O'Sullivan+''. |
463 | 463 |
464 \item[\tplkwfilt{author}{person}] $BG$0U$N%F%-%9%H!%(B\tplkword{author}$B%-!<(B | 464 \item[\tplkwfilt{author}{person}] $BG$0U$N%F%-%9%H!%(B\tplkword{author}$B%-!<(B |
465 $B%o!<%I$H9g$o$;$F;H$&>l9g$b$C$H$bM-MQ!%(Bemail$B%"%I%l%9$NA0$N%F(B | 465 $B%o!<%I$H9g$o$;$F;H$&>l9g$b$C$H$bM-MQ!%(Bemail$B%"%I%l%9$NA0$N%F(B |
466 $B%-%9%H$rCj=P$9$k!%Nc$($P(B``\Verb+Bryan O'Sullivan | 466 $B%-%9%H$rCj=P$9$k!%Nc$($P(B``\Verb+Bryan O'Sullivan <bos@serpentine.com>+''$B$O(B``\Verb+Bryan O'Sullivan+''$B$H$J$k!%(B |
467 <bos@serpentine.com>+''$B$O(B``\Verb+Bryan O'Sullivan+''$B$H$J$k!%(B | |
468 | 467 |
469 %\item[\tplkwfilt{date}{rfc822date}] \tplkword{date} keyword. Render a | 468 %\item[\tplkwfilt{date}{rfc822date}] \tplkword{date} keyword. Render a |
470 % date using the same format used in email headers. Yields a string | 469 % date using the same format used in email headers. Yields a string |
471 % like ``\Verb+Mon, 04 Sep 2006 15:13:13 -0700+''. | 470 % like ``\Verb+Mon, 04 Sep 2006 15:13:13 -0700+''. |
472 | 471 |
473 \item[\tplkwfilt{date}{rfc822date}] \tplkword{date}$B%-!<%o!<%I!%F|;~$r(B | 472 \item[\tplkwfilt{date}{rfc822date}] \tplkword{date}$B%-!<%o!<%I!%F|;~$r(B |
474 email$B%X%C%@$HF1$87A<0$G@07A$9$k!%(B``\Verb+Mon, 04 Sep 2006 | 473 email$B%X%C%@$HF1$87A<0$G@07A$9$k!%(B``\Verb+Mon, 04 Sep 2006 15:13:13 -0700+''$B$N$h$&$JJ8;zNs$r@8@.$9$k!%(B |
475 15:13:13 -0700+''$B$N$h$&$JJ8;zNs$r@8@.$9$k!%(B | |
476 | 474 |
477 %\item[\tplkwfilt{node}{short}] Changeset hash. Yield the short form | 475 %\item[\tplkwfilt{node}{short}] Changeset hash. Yield the short form |
478 % of a changeset hash, i.e.~a 12-byte hexadecimal string. | 476 % of a changeset hash, i.e.~a 12-byte hexadecimal string. |
479 | 477 |
480 \item[\tplkwfilt{node}{short}] $B%A%'%s%8%;%C%H%O%C%7%e!%C;7A<0$N%A%'%s%8(B | 478 \item[\tplkwfilt{node}{short}] $B%A%'%s%8%;%C%H%O%C%7%e!%C;7A<0$N%A%'%s%8(B |
513 % ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' becomes | 511 % ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' becomes |
514 % ``\Verb+bos+''. | 512 % ``\Verb+bos+''. |
515 | 513 |
516 \item[\tplkwfilt{author}{user}] $BG$0U$N%F%-%9%H!%(B\tplkword{author}$B%-!<%o!<(B | 514 \item[\tplkwfilt{author}{user}] $BG$0U$N%F%-%9%H!%(B\tplkword{author}$B%-!<%o!<(B |
517 $B%I$H6&$K;H$C$?>l9g$K:G$bM-MQ!%(Bemail$B%"%I%l%9$+$i%f!<%6L>$NIt(B | 515 $B%I$H6&$K;H$C$?>l9g$K:G$bM-MQ!%(Bemail$B%"%I%l%9$+$i%f!<%6L>$NIt(B |
518 $BJ,$rH4$-=P$9!%Nc$($P(B``\Verb+Bryan O'Sullivan | 516 $BJ,$rH4$-=P$9!%Nc$($P(B``\Verb+Bryan O'Sullivan <bos@serpentine.com>+''$B$O(B``\Verb+bos+''$B$H$J$k!%(B |
519 <bos@serpentine.com>+''$B$O(B``\Verb+bos+''$B$H$J$k!%(B | |
520 \end{itemize} | 517 \end{itemize} |
521 | 518 |
522 \begin{figure} | 519 \begin{figure} |
523 \interaction{template.simple.manyfilters} | 520 \interaction{template.simple.manyfilters} |
524 % \caption{Template filters in action} | 521 % \caption{Template filters in action} |
594 $B8B$K0z$-=P$9$3$H$,$G$-$k!%(B | 591 $B8B$K0z$-=P$9$3$H$,$G$-$k!%(B |
595 | 592 |
596 %\subsection{The simplest of style files} | 593 %\subsection{The simplest of style files} |
597 \subsection{$B:G$bC1=c$J%9%?%$%k%U%!%$%k(B} | 594 \subsection{$B:G$bC1=c$J%9%?%$%k%U%!%$%k(B} |
598 | 595 |
599 Our simple style file contains just one line: | 596 %Our simple style file contains just one line: |
597 | |
598 $B%5%s%W%k%9%?%$%k%U%!%$%k$O$?$@$N(B1$B9T$+$i$J$k(B: | |
600 | 599 |
601 \interaction{template.simple.rev} | 600 \interaction{template.simple.rev} |
602 | 601 |
603 This tells Mercurial, ``if you're printing a changeset, use the text | 602 %This tells Mercurial, ``if you're printing a changeset, use the text |
604 on the right as the template''. | 603 %on the right as the template''. |
604 | |
605 $B$3$l$O(BMercurial$B$K(B``$B%A%'%s%8%;%C%H$r=PNO$9$k;~$O1&$N%F%-%9%H$r%F%s%W%l!<%H(B | |
606 $B$H$7$F;H$((B''$B$H$$$&;X<($rM?$($k!%(B | |
605 | 607 |
606 %\subsection{Style file syntax} | 608 %\subsection{Style file syntax} |
607 \subsection{$B%9%?%$%k%U%!%$%k$NJ8K!(B} | 609 \subsection{$B%9%?%$%k%U%!%$%k$NJ8K!(B} |
608 | 610 |
609 The syntax rules for a style file are simple. | 611 %The syntax rules for a style file are simple. |
612 | |
613 $B%9%?%$%k%U%!%$%k$NJ8K!5,B'$OC1=c$G$"$k!%(B | |
610 | 614 |
611 \begin{itemize} | 615 \begin{itemize} |
612 \item The file is processed one line at a time. | 616 %\item The file is processed one line at a time. |
613 | 617 \item $B%U%!%$%k$O0lEY$K(B1$B9T$:$D=hM}$5$l$k(B |
614 \item Leading and trailing white space are ignored. | 618 |
615 | 619 %\item Leading and trailing white space are ignored. |
616 \item Empty lines are skipped. | 620 \item $BA08e$N6uGr$OL5;k$5$l$k(B |
617 | 621 |
618 \item If a line starts with either of the characters ``\texttt{\#}'' or | 622 %\item Empty lines are skipped. |
619 ``\texttt{;}'', the entire line is treated as a comment, and skipped | 623 \item $B6u9T$O%9%-%C%W$5$l$k(B |
620 as if empty. | 624 |
621 | 625 %\item If a line starts with either of the characters ``\texttt{\#}'' or |
622 \item A line starts with a keyword. This must start with an | 626 % ``\texttt{;}'', the entire line is treated as a comment, and skipped |
623 alphabetic character or underscore, and can subsequently contain any | 627 % as if empty. |
624 alphanumeric character or underscore. (In regexp notation, a | 628 \item $B9T$,(B``\texttt{\#}''$B$^$?$O(B``\texttt{;}''$B$G;O$^$k>l9g$O!$9TA4BN$,%3(B |
625 keyword must match \Verb+[A-Za-z_][A-Za-z0-9_]*+.) | 629 $B%a%s%H$H$7$F07$o$l!$6uGr$HF1MM$K%9%-%C%W$5$l$k!%(B |
626 | 630 |
627 \item The next element must be an ``\texttt{=}'' character, which can | 631 %\item A line starts with a keyword. This must start with an |
628 be preceded or followed by an arbitrary amount of white space. | 632 % alphabetic character or underscore, and can subsequently contain any |
629 | 633 % alphanumeric character or underscore. (In regexp notation, a |
630 \item If the rest of the line starts and ends with matching quote | 634 % keyword must match \Verb+[A-Za-z_][A-Za-z0-9_]*+.) |
631 characters (either single or double quote), it is treated as a | 635 \item $B9T$O%-!<%o!<%I$G;O$^$k!%I,$:%"%k%U%!%Y%C%H$+%"%s%@!<%9%3%"$G;O$^$k(B |
632 template body. | 636 $BI,MW$,$"$j!$8eB3$NJ8;z$O%"%k%U%!%Y%C%H!$?t;z!$%"%s%@!<%9%3%"$N$$$:(B |
633 | 637 $B$l$+$G$"$C$F$h$$!%!J@55,I=8=$G$O(B\Verb+[A-Za-z_][A-Za-z0-9_]*+$B$H%^%C(B |
634 \item If the rest of the line \emph{does not} start with a quote | 638 $B%A$9$k!K(B |
635 character, it is treated as the name of a file; the contents of this | 639 |
636 file will be read and used as a template body. | 640 %\item The next element must be an ``\texttt{=}'' character, which can |
641 % be preceded or followed by an arbitrary amount of white space. | |
642 \item $B<!$NMWAG$OJ8;z(B``\texttt{=}''$B$G!$A08e$K6uGr$,F~$C$F$bNI$$!%(B | |
643 | |
644 %\item If the rest of the line starts and ends with matching quote | |
645 % characters (either single or double quote), it is treated as a | |
646 % template body. | |
647 \item $B?t$ND`$j9g$C$?%7%s%0%k%/%)!<%H$^$?$O%@%V%k%/%)!<%H$G3g$i$l$kItJ,$,(B | |
648 $BB3$/>l9g$O$3$l$,%F%s%W%l!<%H%\%G%#$H$7$F07$o$l$k!%(B | |
649 | |
650 %\item If the rest of the line \emph{does not} start with a quote | |
651 % character, it is treated as the name of a file; the contents of this | |
652 % file will be read and used as a template body. | |
653 \item $BB3$/ItJ,$,%/%)!<%HJ8;z$G;O$^$i$J$$>l9g$O%U%!%$%kL>$H$7$F07$o$l!$%U%!(B | |
654 $B%$%k$NFbMF$,%F%s%W%l!<%H%\%G%#$H$7$F;H$o$l$k!%(B | |
655 | |
637 \end{itemize} | 656 \end{itemize} |
638 | 657 |
639 %\section{Style files by example} | 658 %\section{Style files by example} |
640 \section{$B%9%?%$%k%U%!%$%k$NNc(B} | 659 \section{$B%9%?%$%k%U%!%$%k$NNc(B} |
641 | 660 |
642 To illustrate how to write a style file, we will construct a few by | 661 %To illustrate how to write a style file, we will construct a few by |
643 example. Rather than provide a complete style file and walk through | 662 %example. Rather than provide a complete style file and walk through |
644 it, we'll mirror the usual process of developing a style file by | 663 %it, we'll mirror the usual process of developing a style file by |
645 starting with something very simple, and walking through a series of | 664 %starting with something very simple, and walking through a series of |
646 successively more complete examples. | 665 %successively more complete examples. |
666 | |
667 $B%9%?%$%k%U%!%$%k$N=q$-J}$r@bL@$9$k$?$a$K$$$/$D$+$NNcBj$r5s$2$F$_$k!%40A4(B | |
668 $B$J%9%?%$%k%U%!%$%k$rMQ0U$7$F$3$l$r@bL@$9$k$N$G$O$J$/!$$H$F$bC1=c$JNc$+$i(B | |
669 $B;O$a$F!$$@$s$@$s$HJ#;($JNc$K?J$`$3$H$G%9%?%$%k%U%!%$%k$NDL>o$N3+H/%W%m%;(B | |
670 $B%9$rLOJo$7$F$_$k!%(B | |
647 | 671 |
648 %\subsection{Identifying mistakes in style files} | 672 %\subsection{Identifying mistakes in style files} |
649 \subsection{$B%9%?%$%k%U%!%$%k$G$N8m$j$rFCDj$9$k(B} | 673 \subsection{$B%9%?%$%k%U%!%$%k$G$N8m$j$rFCDj$9$k(B} |
650 | 674 |
651 If Mercurial encounters a problem in a style file you are working on, | 675 %If Mercurial encounters a problem in a style file you are working on, |
652 it prints a terse error message that, once you figure out what it | 676 %it prints a terse error message that, once you figure out what it |
653 means, is actually quite useful. | 677 %means, is actually quite useful. |
678 | |
679 Mercurial$B$,%9%?%$%k%U%!%$%k$GLdBj$KD>LL$9$k$H!$4J7i$J%(%i!<%a%C%;!<%8$rI=(B | |
680 $B<($9$k!%$3$N%a%C%;!<%8$O$=$N0UL#$9$k$H$3$m$,J,$+$C$F$$$l$P$H$F$bM-1W$G$"(B | |
681 $B$k!%(B | |
654 | 682 |
655 \interaction{template.svnstyle.syntax.input} | 683 \interaction{template.svnstyle.syntax.input} |
656 | 684 |
657 Notice that \filename{broken.style} attempts to define a | 685 %Notice that \filename{broken.style} attempts to define a |
658 \texttt{changeset} keyword, but forgets to give any content for it. | 686 %\texttt{changeset} keyword, but forgets to give any content for it. |
659 When instructed to use this style file, Mercurial promptly complains. | 687 %When instructed to use this style file, Mercurial promptly complains. |
688 | |
689 \filename{broken.style}$B$G(B\texttt{changeset}$B%-!<%o!<%I$rDj5A$7$h$&$H$7$F$$(B | |
690 $B$k$,!$Dj5A$NFbMF$,A4$/M?$($i$l$F$$$J$$!%$3$N%9%?%$%k%U%!%$%k$r;H$*$&$H$9(B | |
691 $B$k$H!$(BMercurial$B$O$9$0$5$^%(%i!<$rI=<($9$k!%(B | |
660 | 692 |
661 \interaction{template.svnstyle.syntax.error} | 693 \interaction{template.svnstyle.syntax.error} |
662 | 694 |
663 This error message looks intimidating, but it is not too hard to | 695 %This error message looks intimidating, but it is not too hard to |
664 follow. | 696 %follow. |
697 | |
698 $B$3$N%(%i!<%a%C%;!<%8$O62$m$7$2$@$,!$BP1~$9$k$N$O$5$[$IFq$7$/$J$$!%(B | |
665 | 699 |
666 \begin{itemize} | 700 \begin{itemize} |
667 \item The first component is simply Mercurial's way of saying ``I am | 701 %\item The first component is simply Mercurial's way of saying ``I am |
668 giving up''. | 702 % giving up''. |
703 \item $B:G=i$NItJ,$O(B``$B%.%V%"%C%W(B''$B$N(BMercurial$BE*$JI=8=$G$"$k!%(B | |
669 \begin{codesample4} | 704 \begin{codesample4} |
670 \textbf{abort:} broken.style:1: parse error | 705 \textbf{abort:} broken.style:1: parse error |
671 \end{codesample4} | 706 \end{codesample4} |
672 | 707 |
673 \item Next comes the name of the style file that contains the error. | 708 %\item Next comes the name of the style file that contains the error. |
709 \item $B<!$K%(%i!<$N$"$k%9%?%$%k%U%!%$%kL>$,I=<($5$l$k(B | |
674 \begin{codesample4} | 710 \begin{codesample4} |
675 abort: \textbf{broken.style}:1: parse error | 711 abort: \textbf{broken.style}:1: parse error |
676 \end{codesample4} | 712 \end{codesample4} |
677 | 713 |
678 \item Following the file name is the line number where the error was | 714 %\item Following the file name is the line number where the error was |
679 encountered. | 715 % encountered. |
716 \item $B%U%!%$%kL>$N8e$K%(%i!<$N5/$-$?9THV9f$,B3$/!%(B | |
680 \begin{codesample4} | 717 \begin{codesample4} |
681 abort: broken.style:\textbf{1}: parse error | 718 abort: broken.style:\textbf{1}: parse error |
682 \end{codesample4} | 719 \end{codesample4} |
683 | 720 |
684 \item Finally, a description of what went wrong. | 721 %\item Finally, a description of what went wrong. |
722 \item $B:G8e$KLdBjE@$N@bL@$,I=<($5$l$k(B | |
685 \begin{codesample4} | 723 \begin{codesample4} |
686 abort: broken.style:1: \textbf{parse error} | 724 abort: broken.style:1: \textbf{parse error} |
687 \end{codesample4} | 725 \end{codesample4} |
688 The description of the problem is not always clear (as in this | 726 % The description of the problem is not always clear (as in this |
689 case), but even when it is cryptic, it is almost always trivial to | 727 % case), but even when it is cryptic, it is almost always trivial to |
690 visually inspect the offending line in the style file and see what | 728 % visually inspect the offending line in the style file and see what |
691 is wrong. | 729 % is wrong. |
730 $BLdBj$N@bL@$O>o$KL@2w$G$"$k$H$O8B$i$J$$!%!J$3$NNc$N$h$&$K!%!K$7$+$7Ff$a$$(B | |
731 $B$F$$$?$H$7$F$b!$KX$s$I$N>l9g!$%9%?%$%k%U%!%$%k$NLdBj$N$"$k9T$r8+(B | |
732 $B$k$H!$$4$/:3:Y$JLdBj$K$9$.$J$$$b$N$G$"$k!%(B | |
692 \end{itemize} | 733 \end{itemize} |
693 | 734 |
694 %\subsection{Uniquely identifying a repository} | 735 %\subsection{Uniquely identifying a repository} |
695 \subsection{$B%j%]%8%H%j$NFCDj(B} | 736 \subsection{$B%j%]%8%H%j$NFCDj(B} |
696 | 737 |
697 If you would like to be able to identify a Mercurial repository | 738 %If you would like to be able to identify a Mercurial repository |
698 ``fairly uniquely'' using a short string as an identifier, you can | 739 %``fairly uniquely'' using a short string as an identifier, you can |
699 use the first revision in the repository. | 740 %use the first revision in the repository. |
700 \interaction{template.svnstyle.id} | 741 %\interaction{template.svnstyle.id} |
701 This is not guaranteed to be unique, but it is nevertheless useful in | 742 |
702 many cases. | 743 %This is not guaranteed to be unique, but it is nevertheless useful in |
744 %many cases. | |
745 | |
746 $BC;$$J8;zNs$r<1JL;R$K;H$C$F(BMercurial$B%j%]%8%H%j$rFCDj$7$?$$>l9g$O(B | |
747 $B%j%]%8%H%jFb$N:G=i$N%j%S%8%g%s$r;H$&$3$H$,$G$-$k!%(B | |
748 \interaction{template.svnstyle.id} | |
749 $B$3$l$O%f%K!<%/$G$"$k$3$H$,J]>Z$5$l$F$$$k$o$1$G$O$J$$$,!$B?$/$N>l9g$KM-MQ(B | |
750 $B$G$"$k$3$H$O$$$&$^$G$b$J$$!%(B | |
751 | |
703 \begin{itemize} | 752 \begin{itemize} |
704 \item It will not work in a completely empty repository, because such | 753 %\item It will not work in a completely empty repository, because such |
705 a repository does not have a revision~zero. | 754 % a repository does not have a revision~zero. |
706 \item Neither will it work in the (extremely rare) case where a | 755 \item $B40A4$K6u$N%j%]%8%H%j$G$O$3$NJ}K!$O;H$($J$$!%6u$N%j%]%8%H%j$K$O%j(B |
707 repository is a merge of two or more formerly independent | 756 $B%S%8%g%s(B~$B%<%m$9$iB8:_$7$J$$$?$a$G$"$k!%(B |
708 repositories, and you still have those repositories around. | 757 |
758 %\item Neither will it work in the (extremely rare) case where a | |
759 % repository is a merge of two or more formerly independent | |
760 % repositories, and you still have those repositories around. | |
761 \item $BFHN)$7$?J#?t$N%j%]%8%H%j$r%^!<%8$7$F%j%]%8%H%j$r:n@.$7!$$3$l$i$N(B | |
762 $B%j%]%8%H%j$,0MA3$H$7$FB8:_$9$k$J$I$N!J$-$o$a$F5)$J!K>l9g$O$3$NJ}(B | |
763 $BK!$O;H$($J$$!%(B | |
709 \end{itemize} | 764 \end{itemize} |
710 Here are some uses to which you could put this identifier: | 765 %Here are some uses to which you could put this identifier: |
766 $B$3$N<1JL;R$N;HMQNc$r<($9(B: | |
711 \begin{itemize} | 767 \begin{itemize} |
712 \item As a key into a table for a database that manages repositories | 768 %\item As a key into a table for a database that manages repositories |
713 on a server. | 769 % on a server. |
714 \item As half of a \{\emph{repository~ID}, \emph{revision~ID}\} tuple. | 770 \item $B%5!<%P>e$G%j%]%8%H%j$r4IM}$9$k%G!<%?%Y!<%9MQ$N%F!<%V%k$X$N%-!<$H$7$F!%(B |
715 Save this information away when you run an automated build or other | 771 |
716 activity, so that you can ``replay'' the build later if necessary. | 772 %\item As half of a \{\emph{repository~ID}, \emph{revision~ID}\} tuple. |
773 % Save this information away when you run an automated build or other | |
774 % activity, so that you can ``replay'' the build later if necessary. | |
775 \item \{\emph{repository~ID}, \emph{revision~ID}\}$B%?%W%k$NH>J,$H$7$F!%<+(B | |
776 $BF0%S%k%I$d$=$NB>$NA`:n$r9T$&$H$-$K$3$N>pJs$r%;!<%V$7$F$*$-!$8e$G%S%k%I$r(B | |
777 $B:F8=$9$k$3$H$,I,MW$H$J$C$?$i(B``$B%j%W%l%$(B''$B$r9T$($k$h$&$K$9$k!%(B | |
778 | |
717 \end{itemize} | 779 \end{itemize} |
718 | 780 |
719 %\subsection{Mimicking Subversion's output} | 781 %\subsection{Mimicking Subversion's output} |
720 \subsection{Subversion$B=PNO$NLOJo(B} | 782 \subsection{Subversion$B=PNO$NLOJo(B} |
721 | 783 |
731 %produced above by Subversion with the template values we'd like to see | 793 %produced above by Subversion with the template values we'd like to see |
732 %expanded. | 794 %expanded. |
733 | 795 |
734 Subversion$B$N=PNO%9%?%$%k$O$+$J$jC1=c$J$N$G!$=PNO$+$i%U%!%$%k$X(Bhunk$B$r%3%T!<(B | 796 Subversion$B$N=PNO%9%?%$%k$O$+$J$jC1=c$J$N$G!$=PNO$+$i%U%!%$%k$X(Bhunk$B$r%3%T!<(B |
735 $B!u%Z!<%9%H$7!$(BSubversion$B$,@8@.$7$?%F%-%9%H$r%F%s%W%l!<%H$K$h$C$FCV49$9$k(B | 797 $B!u%Z!<%9%H$7!$(BSubversion$B$,@8@.$7$?%F%-%9%H$r%F%s%W%l!<%H$K$h$C$FCV49$9$k(B |
736 $B$N$O4JC1$G$"$k!%(B \interaction{template.svnstyle.template} | 798 $B$N$O4JC1$G$"$k!%(B |
799 \interaction{template.svnstyle.template} | |
737 | 800 |
738 %There are a few small ways in which this template deviates from the | 801 %There are a few small ways in which this template deviates from the |
739 %output produced by Subversion. | 802 %output produced by Subversion. |
740 | 803 |
804 $B%F%s%W%l!<%H$K$h$k=PNO$,(BSubversion$B$,@8@.$9$k=PNO$H0[$J$k(B2, 3$B$NNc$,$"$k!%(B | |
805 | |
741 \begin{itemize} | 806 \begin{itemize} |
742 \item Subversion prints a ``readable'' date (the ``\texttt{Wed, 27 Sep | 807 %\item Subversion prints a ``readable'' date (the ``\texttt{Wed, 27 Sep |
743 2006}'' in the example output above) in parentheses. Mercurial's | 808 % 2006}'' in the example output above) in parentheses. Mercurial's |
744 templating engine does not provide a way to display a date in this | 809 % templating engine does not provide a way to display a date in this |
745 format without also printing the time and time zone. | 810 % format without also printing the time and time zone. |
746 \item We emulate Subversion's printing of ``separator'' lines full of | 811 \item Subversion$B$OCf3g8L$G0O$^$l$?(B``$B2DFI$J(B''$BF|;~$r=PNO$9$k!%!J>e$NNc$G$O(B |
747 ``\texttt{-}'' characters by ending the template with such a line. | 812 ``\texttt{Wed, 27 Sep 2006}''$B!%!K(B Mercurial$B$N%F%s%W%l!<%H%(%s%8%s(B |
748 We use the templating engine's \tplkword{header} keyword to print a | 813 $B$O$3$N%U%)!<%^%C%H$G;~9o$H%?%$%`%>!<%s$r4^$^$J$$7A$GF|;~$r=PNO$9$k(B |
749 separator line as the first line of output (see below), thus | 814 $B$3$H$,$G$-$J$$!%(B |
750 achieving similar output to Subversion. | 815 |
751 \item Subversion's output includes a count in the header of the number | 816 %\item We emulate Subversion's printing of ``separator'' lines full of |
752 of lines in the commit message. We cannot replicate this in | 817 % ``\texttt{-}'' characters by ending the template with such a line. |
753 Mercurial; the templating engine does not currently provide a filter | 818 % We use the templating engine's \tplkword{header} keyword to print a |
754 that counts the number of items it is passed. | 819 % separator line as the first line of output (see below), thus |
820 % achieving similar output to Subversion. | |
821 \item Subversion$B$N(B``$B%;%Q%l!<%?(B''$B9T$N=PNO$r%F%s%W%l!<%H$r9TI}0lGU$N(B | |
822 ``\texttt{-}''$BJ8;z$G=*$($k$3$H$G%(%_%e%l!<%H$7$F$$$k!%%F%s%W%l!<%H(B | |
823 $B%(%s%8%s$N(B\tplkword{header}$B%-!<%o!<%I$r;H$C$F%;%Q%l!<%?9T$r=PNO$N(B | |
824 $B:G=i$N9T$H$7$F=PNO$9$k!%!J2<5-$r;2>H!%!K$3$l$K$h$C$F(BSubversion$B$H;w(B | |
825 $BDL$C$?=PNO$r9T$C$F$$$k!%(B | |
826 | |
827 %\item Subversion's output includes a count in the header of the number | |
828 % of lines in the commit message. We cannot replicate this in | |
829 % Mercurial; the templating engine does not currently provide a filter | |
830 % that counts the number of items it is passed. | |
831 \item Subversion$B$N=PNO$O%X%C%@Fb$K%3%_%C%H%a%C%;!<%8$N9T?t$N%+%&%s%H$r(B | |
832 $B4^$s$G$$$k!%(BMercurial$B$G$O$3$l$r:F8=$9$k$3$H$O$G$-$J$$!%%F%s%W%l!<(B | |
833 $B%H%(%s%8%s$O8=>u$G$OEO$5$l$?%"%$%F%`$r?t$($k%U%#%k%?$r:n$k$3$H$,(B | |
834 $B$G$-$J$$!%(B | |
755 \end{itemize} | 835 \end{itemize} |
756 It took me no more than a minute or two of work to replace literal | 836 %It took me no more than a minute or two of work to replace literal |
757 text from an example of Subversion's output with some keywords and | 837 %text from an example of Subversion's output with some keywords and |
758 filters to give the template above. The style file simply refers to | 838 %filters to give the template above. The style file simply refers to |
759 the template. | 839 %the template. |
840 | |
841 Subversion$B$N=PNO$r;29M$K!$%F%-%9%H$rCV49$9$k%-!<%o!<%I!$%F%s%W%l!<%H$NF~$C(B | |
842 $B$?%U%#%k%?$r=`Hw$9$k$N$K$O$[$s$N#1!$#2J,$7$+$+$+$i$J$+$C$?!%%9%?%$%k%U%!(B | |
843 $B%$%k$OC1=c$K%F%s%W%l!<%H$r;2>H$9$k$N$_$G$"$k(B | |
844 | |
760 \interaction{template.svnstyle.style} | 845 \interaction{template.svnstyle.style} |
761 | 846 |
762 We could have included the text of the template file directly in the | 847 %We could have included the text of the template file directly in the |
763 style file by enclosing it in quotes and replacing the newlines with | 848 %style file by enclosing it in quotes and replacing the newlines with |
764 ``\texttt{\\n}'' sequences, but it would have made the style file too | 849 %``\texttt{\\n}'' sequences, but it would have made the style file too |
765 difficult to read. Readability is a good guide when you're trying to | 850 %difficult to read. Readability is a good guide when you're trying to |
766 decide whether some text belongs in a style file, or in a template | 851 %decide whether some text belongs in a style file, or in a template |
767 file that the style file points to. If the style file will look too | 852 %file that the style file points to. If the style file will look too |
768 big or cluttered if you insert a literal piece of text, drop it into a | 853 %big or cluttered if you insert a literal piece of text, drop it into a |
769 template instead. | 854 %template instead. |
855 | |
856 $B%F%s%W%l!<%H%U%!%$%k$N%F%-%9%H$r%/%)!<%H$G3g$j!$2~9T$r(B``\texttt{\\n}''$B$G(B | |
857 $B%(%9%1!<%W$9$k$3$H$G%9%?%$%k%U%!%$%k$KD>@\DI2C$9$k$3$H$b2DG=$G$O$"$k!%$7(B | |
858 $B$+$7$=$&$7$?>l9g!$%9%?%$%k%U%!%$%k$,$[$H$s$IFI$a$J$$$[$IJ#;($K$J$C$F$7$^(B | |
859 $B$&$@$m$&!%%F%-%9%H$r%9%?%$%k%U%!%$%k$KF~$l$k$+!$%9%?%$%k%U%!%$%k$+$i8F$P(B | |
860 $B$l$k%F%s%W%l!<%H%U%!%$%k$KF~$l$k$+$O!$2DFI@-$r9MN8$7$F7hDj$9$Y$-$G$"$k!%(B | |
861 $B$b$7%F%-%9%H$rDI2C$7$?$3$H$G%9%?%$%k%U%!%$%k$,Bg$-$/$J$j2a$.$?$j!$Mp;($K(B | |
862 $B$J$C$?$j$7$?>l9g$O!$%F%s%W%l!<%H$X$N0\F0$r9MN8$9$k$H$h$$!%(B | |
770 | 863 |
771 %%% Local Variables: | 864 %%% Local Variables: |
772 %%% mode: yatex | 865 %%% mode: yatex |
773 %%% TeX-master: "00book" | 866 %%% TeX-master: "00book" |
774 %%% End: | 867 %%% End: |