# $Id: history.sdp,v 1.2 2001/11/09 02:06:32 yuichi Exp yuichi $ # # >>Title:: History Filter Plug-In # # >>Copyright:: # Copyright (c) 2001, yuichi TAKAHASHI # You may distribute under the terms specified in the LICENSE file. # # >>History:: # ----------------------------------------------------------------------- # Date Who Change # 04-Jul-2001 yuichi original coding # 08-Nov-2001 yuichi style=plain, 2 or more rows in a revision. # ----------------------------------------------------------------------- # # >>Purpose:: # To make history table from Log parameter of CVS. # # >>Description:: # # >>Limitations:: # # history filter ... filter that make history table form CVS Log. # #!on filter "testhistory";; \ # $name='history'; \ # $params.='pre="Hi there#Tim";post="post"'; # #!block testhistory #This is normal text #!endblock # #!on filter "product_defines";; \ # $name='history'; \ # $params.=';pre="!block products data#Name:Jump"'; \ # $params.=';exec="&AddProduct(\$line)"'; \ # $params.=';post="!endblock#!DefineProducts"' # @_history_FilterParams = ( 'Name Type Rule', ); push(@_history_FilterParams,@_table_FilterParams); sub history_Filter { local(*text, %param) = @_; local($style, $line, $pre, $post, $other_params); @tmp = @text; # for English @text = ( 'P1: history', '!block table; style="plain"' ); $x = 'Rev Date Editor Change'; # for Japanese @text = ( 'P1: 変更履歴', '!block table; style="plain"' ); $x = '版数 変更日 変更者 変更点'; while( @tmp ){ $l = shift( @tmp ); next if $l =~ /^\$Log/; if ( $l =~ /^Revision +([0-9.]+) +([0-9\/]+) +([0-9:]+) +(.*)/ ){ push( @text, $x ); $x = sprintf "%-6s %-10s %-8s ", ( $1, $2, $4 ); } elsif ( $l ne '' ) { $x = $x . ' ' . $l; push( @text, $x ); $x = ' '; } } push( @text, $x ); push( @text, '!endblock' ); # print STDERR join("\n",@text); } # package return value 1;