Revision: 5595 http://ipcop.svn.sourceforge.net/ipcop/?rev=5595&view=rev Author: owes Date: 2011-04-05 20:29:34 +0000 (Tue, 05 Apr 2011)
Log Message: ----------- Update svn2cl to 0.13 to fix line wrapping problem. Modified Paths: -------------- ipcop/trunk/tools/svn2cl/ChangeLog ipcop/trunk/tools/svn2cl/NEWS ipcop/trunk/tools/svn2cl/README ipcop/trunk/tools/svn2cl/authors.xml ipcop/trunk/tools/svn2cl/svn2cl.1 ipcop/trunk/tools/svn2cl/svn2cl.sh ipcop/trunk/tools/svn2cl/svn2cl.xsl ipcop/trunk/tools/svn2cl/svn2html.css ipcop/trunk/tools/svn2cl/svn2html.xsl Modified: ipcop/trunk/tools/svn2cl/ChangeLog =================================================================== --- ipcop/trunk/tools/svn2cl/ChangeLog 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/ChangeLog 2011-04-05 20:29:34 UTC (rev 5595) @@ -1,3 +1,113 @@ +2010-08-13 09:39 arthur + + * [r145] svn2cl.sh: also pass -g, --use-merge-history, -c, + --change, -l, --trust-server-cert and --config-option to svn + commands + +2010-08-13 08:07 arthur + + * [r144] README: direct bugreports to the svn2cl-users mailing list + +2010-08-13 07:24 arthur + + * [r143] svn2cl.xsl: fix typo in comment + +2010-05-06 21:11 arthur + + * [r142] svn2cl.sh: properly quote $0 (thanks Vincent Lefevre) + +2010-03-03 21:02 arthur + + * [r141] ChangeLog, svn2cl.1, svn2cl.sh, svn2html.xsl: implement + ticket-highlighting with a --ticket-link option, based on a patch + by Neil Whitworth <neilwhitwo...@commontime.com> + +2010-03-03 20:55 arthur + + * [r140] svn2html.xsl: switch to a mechanism to more easily perform + more message log highlighting + +2010-03-03 19:54 arthur + + * [r139] svn2html.xsl: also perform correct line-highlighing for + last line + +2009-11-22 12:48 arthur + + * [r138] svn2html.xsl: call urlstolinks on every line separately + because we cannot store tags inside a variable + +2009-10-07 20:36 arthur + + * [r136] ChangeLog, NEWS, README, svn2cl.1, svn2cl.sh, svn2cl.xsl, + svn2html.xsl: get files ready for 0.12 release + +2009-10-07 20:31 arthur + + * [r135] svn2html.css: trim trailing whitespace + +2009-10-07 20:18 arthur + + * [r134] svn2cl.xsl, svn2html.xsl: fix line wrapping problem thanks + to Peter Samuelson <pe...@p12n.org>, Mike Hommey + <m...@glandium.org> and others (see http://bugs.debian.org/546990) + +2009-06-12 22:00 arthur + + * [r133] README, authors.xml, svn2cl.1, svn2html.xsl: replace + references to ch.tudelft.nl with arthurdejong.org + +2009-02-02 21:20 arthur + + * [r132] svn2cl.xsl: another simplification to get path stripping + compacter + +2009-02-02 21:00 arthur + + * [r131] svn2cl.xsl: simplification in printing path names + +2009-02-02 20:33 arthur + + * [r130] svn2cl.xsl: correctly flag additions + +2009-01-13 22:27 arthur + + * [r129] svn2cl.xsl, svn2html.xsl: properly get the previous + sibling fixing a problem when --group-by-day and + --ignore-message-starting were used + +2009-01-13 21:45 arthur + + * [r128] svn2html.xsl: perform URL highlighting (very basic) + +2009-01-13 21:44 arthur + + * [r127] svn2cl.sh: run svn info (not svn log) with + --non-interactive and don't hide errors + +2008-12-21 15:41 arthur + + * [r125] ChangeLog, NEWS, svn2cl.1, svn2cl.sh, svn2cl.xsl, + svn2html.xsl: get files ready for 0.11 release + +2008-09-22 21:34 arthur + + * [r124] svn2cl.sh: fix for OpenBSD's ksh by Carlo Marcelo Arenas + Belon <care...@sajinet.com.pe> + +2008-06-03 19:03 arthur + + * [r123] svn2cl.sh: make awk command configurable + +2008-06-03 19:02 arthur + + * [r122] svn2cl.sh: don't use GNU extensions to awk syntax + +2008-04-06 13:37 arthur + + * [r120] ChangeLog, NEWS, README, TODO, svn2cl.1, svn2cl.sh, + svn2cl.xsl, svn2html.xsl: get files ready for 0.10 release + 2008-04-06 13:27 arthur * [r119] svn2cl.1: include not about default revision range that is Modified: ipcop/trunk/tools/svn2cl/NEWS =================================================================== --- ipcop/trunk/tools/svn2cl/NEWS 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/NEWS 2011-04-05 20:29:34 UTC (rev 5595) @@ -1,3 +1,32 @@ +changes from 0.12 to 0.13 +------------------------- + +* add a --ticket-link option for the HTML output that replaces anything + that looks like a ticket reference (e.g. #123) with a link (thanks Neil + Whitworth) +* properly quote $0 in shell script (thanks Vincent Lefevre) +* also pass through -g, --use-merge-history, -c, --change, -l, + --trust-server-cert and --config-option options to svn log command + + +changes from 0.11 to 0.12 +------------------------- + +* fix line wrapping problem thanks to Peter Samuelson, Mike Hommey and others +* run svn command to find repository location with --non-interactive and don't + hide errors +* perform URL highlighting (very basic) in the HTML output +* some miscellaneous bugfixes and simplifications +* correctly flag file additions + + +changes from 0.10 to 0.11 +------------------------- + +* small portability improvements +* fix for OpenBSD's ksh by Carlo Marcelo Arenas Belon + + changes from 0.9 to 0.10 ------------------------ Modified: ipcop/trunk/tools/svn2cl/README =================================================================== --- ipcop/trunk/tools/svn2cl/README 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/README 2011-04-05 20:29:34 UTC (rev 5595) @@ -1,6 +1,6 @@ svn2cl - create a ChangeLog from a subversion log - Copyright (C) 2004, 2005, 2006, 2007, 2008 Arthur de Jong + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Arthur de Jong Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,9 +42,9 @@ INSTALLING SVN2CL ================= -Just unpack the tarball in some directory (e.g. /opt/svn2cl-0.10) +Just unpack the tarball in some directory (e.g. /opt/svn2cl-0.13) and symlink the svn2cl.sh script in your path somewhere (e.g. -ln -s /opt/svn2cl-0.10/svn2cl.sh /usr/local/bin/svn2cl). +ln -s /opt/svn2cl-0.13/svn2cl.sh /usr/local/bin/svn2cl). Note: Be sure to keep the svn2cl.xsl file in the same directory as the svn2cl.sh script as the script looks for it there (symlinking is ok). @@ -93,10 +93,10 @@ or pass --revision HEAD:1 as a parameter to svn2cl.sh. There will not be very frequent new releases but if there are they can be -found at: http://ch.tudelft.nl/~arthur/svn2cl/ +found at: http://arthurdejong.org/svn2cl/ FEEDBACK AND BUG REPORTS ======================== If you have any questions about svn2cl or would like to report a bug please -send an email to Arthur de Jong <art...@ch.tudelft.nl>. +send an email to svn2cl-us...@lists.arthurdejong.org. Modified: ipcop/trunk/tools/svn2cl/authors.xml =================================================================== --- ipcop/trunk/tools/svn2cl/authors.xml 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/authors.xml 2011-04-05 20:29:34 UTC (rev 5595) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <authors xmlns:html="http://www.w3.org/1999/xhtml"> <author uid="arthur"> - Arthur de Jong <<html:a href="mailto:art...@ch.tudelft.nl">art...@ch.tudelft.nl</html:a>> + Arthur de Jong <<html:a href="mailto:art...@arthurdejong.org">art...@arthurdejong.org</html:a>> </author> <author uid="nobody"> Who's this <nob...@example.com> Modified: ipcop/trunk/tools/svn2cl/svn2cl.1 =================================================================== --- ipcop/trunk/tools/svn2cl/svn2cl.1 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/svn2cl.1 2011-04-05 20:29:34 UTC (rev 5595) @@ -1,4 +1,4 @@ -.\" Copyright (C) 2005, 2006, 2007, 2008 Arthur de Jong +.\" Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Arthur de Jong .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -24,7 +24,7 @@ .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.TH "svn2cl" "1" "Apr 2008" "Version 0.10" "User Commands" +.TH "svn2cl" "1" "Oct 2010" "Version 0.13" "User Commands" .nh .SH "NAME" svn2cl - Create a ChangeLog from a subversion log. @@ -97,6 +97,13 @@ This option is ignored for normal text output. .TP +\fB\-\-ticket\-link\fR=\fINAME\fR +This option is used to generate links from references to tickets within the commit message in the generated HTML file. +Anything that looks like a ticket reference (e.g. '\fB#foo\fP') will be replaced with a link to NAME with the ticket part ('\fBfoo\fP' in the example) appended. +.br +This option is ignored for normal text output. + +.TP \fB\-\-ignore\-message\-starting\fR=\fISTRING\fR Any log messages that start with the specified \fISTRING\fR are ignored and will not show up in the output. The STRING comparison is case sensitive. @@ -143,7 +150,7 @@ <?xml version="1.0" encoding="utf\-8"?> <authors> <author uid="arthur"> - Arthur de Jong <art...@ch.tudelft.nl> + Arthur de Jong <art...@arthurdejong.org> </author> </authors> .ft R @@ -157,7 +164,7 @@ <?xml version="1.0" encoding="utf\-8"?> <authors xmlns:html="http://www.w3.org/1999/xhtml"> <author uid="arthur"> - Arthur de Jong <<html:b>art...@ch.tudelft.nl</html:b>> + Arthur de Jong <<html:b>art...@arthurdejong.org</html:b>> </author> </authors> .ft R @@ -166,7 +173,7 @@ As a bonus a plain text authors file that looks like the following is automatically converted to the XML representation: .ft B - arthur:Arthur de Jong <art...@ch.tudelft.nl> + arthur:Arthur de Jong <art...@arthurdejong.org> .ft R .SH "NOTES" @@ -202,7 +209,7 @@ .BR '\fBsvn\ help\ log\fP' .SH "COPYRIGHT" -Copyright \(co 2005, 2006, 2007, 2008 Arthur de Jong <art...@ch.tudelft.nl>. +Copyright \(co 2005, 2006, 2007, 2008, 2009, 2010 Arthur de Jong <art...@arthurdejong.org>. .br This is free software; see the license for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Modified: ipcop/trunk/tools/svn2cl/svn2cl.sh =================================================================== --- ipcop/trunk/tools/svn2cl/svn2cl.sh 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/svn2cl.sh 2011-04-05 20:29:34 UTC (rev 5595) @@ -3,7 +3,7 @@ # svn2cl.sh - front end shell script for svn2cl.xsl, calls xsltproc # with the correct parameters # -# Copyright (C) 2005, 2006, 2007, 2008 Arthur de Jong. +# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Arthur de Jong. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -36,7 +36,7 @@ set -u # svn2cl version -VERSION="0.10" +VERSION="0.13" # set default parameters PWD=`pwd` @@ -51,15 +51,17 @@ CHANGELOG="" OUTSTYLE="cl" SVNLOGCMD="svn --verbose --xml log" -SVNINFOCMD="svn info" +SVNINFOCMD="svn --non-interactive info" AUTHORSFILE="" IGNORE_MESSAGE_STARTING="" TITLE="ChangeLog" REVISION_LINK="#r" +TICKET_LINK="" TMPFILES="" +AWK="awk" # do command line checking -prog=`basename $0` +prog=`basename "$0"` while [ $# -gt 0 ] do case "$1" in @@ -124,6 +126,14 @@ REVISION_LINK=`echo "$1" | sed 's/^--[a-z-]*=//'` shift ;; + --ticket-link) + TICKET_LINKK="$2" + shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; } + ;; + --ticket-link=*) + TICKET_LINK=`echo "$1" | sed 's/^--[a-z-]*=//'` + shift + ;; --ignore-message-starting) IGNORE_MESSAGE_STARTING="$2" shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; } @@ -156,43 +166,40 @@ OUTSTYLE="html" shift ;; - -r|--revision|--targets|--limit) - # add these as extra options to the command (with argument) + -r|--revision|-c|--change|--targets|-l|--limit) + # add these as extra options to the log command (with argument) arg=`echo "$2" | sed "s/'/'\"'\"'/g"` SVNLOGCMD="$SVNLOGCMD $1 '$arg'" shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; } ;; - --username|--password|--config-dir) - # add these as extra options to the command (with argument) + --revision=*|--change=*|--targets=*|--limit=*) + # these are single argument versions of the above (with argument) + arg=`echo "$1" | sed "s/'/'\"'\"'/g"` + SVNLOGCMD="$SVNLOGCMD '$arg'" + shift + ;; + --username|--password|--config-dir|--config-option) + # add these as extra options to the log and info commands (with argument) arg=`echo "$2" | sed "s/'/'\"'\"'/g"` SVNLOGCMD="$SVNLOGCMD $1 '$arg'" - # also add to svn info command SVNINFOCMD="$SVNINFOCMD $1 '$arg'" shift 2 || { echo "$prog: option requires an argument -- $1";exit 1; } ;; - --revision=*|--targets=*|--limit=*) - # these are single argument versions of the above + --username=*|--password=*|--config-dir=*|--config-option=*) + # these are single argument versions of the above (with argument) arg=`echo "$1" | sed "s/'/'\"'\"'/g"` SVNLOGCMD="$SVNLOGCMD '$arg'" - shift - ;; - --username=*|--password=*|--config-dir=*) - # these are single argument versions of the above - arg=`echo "$1" | sed "s/'/'\"'\"'/g"` - SVNLOGCMD="$SVNLOGCMD '$arg'" - # also add to svn info command SVNINFOCMD="$SVNINFOCMD '$arg'" shift ;; - --stop-on-copy) - # add these as simple options + -g|--use-merge-history|--stop-on-copy) + # add these as simple options to the log command SVNLOGCMD="$SVNLOGCMD $1" shift ;; - --no-auth-cache|--non-interactive) - # add these as simple options + --no-auth-cache|--non-interactive|--trust-server-cert) + # add these as simple options to both the log and info commands SVNLOGCMD="$SVNLOGCMD $1" - # also add to svn info command SVNINFOCMD="$SVNINFOCMD $1" shift ;; @@ -200,7 +207,7 @@ echo "$prog $VERSION"; echo "Written by Arthur de Jong." echo "" - echo "Copyright (C) 2005, 2006, 2007 Arthur de Jong." + echo "Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Arthur de Jong." echo "This is free software; see the source for copying conditions. There is NO" echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit 0 @@ -209,8 +216,8 @@ echo "Usage: $prog [OPTION]... [PATH]..." echo "Generate a ChangeLog from a subversion repository." echo "" - echo " --strip-prefix=NAME prefix to strip from all entries, defaults" - echo " path inside the repository" + echo " --strip-prefix=NAME prefix to strip from all entries, defaults path" + echo " inside the repository" echo " --linelen=NUM maximum length of an output line" echo " --group-by-day group changelog entries by day" echo " --separate-daylogs put a blank line between grouped by day entries" @@ -221,6 +228,7 @@ echo " --reparagraph rewrap lines inside a paragraph" echo " --title=NAME title used in html file" echo " --revision-link=NAME link revision numbers in html output" + echo " --ticket-link=NAME change #foo strings to links" echo " --ignore-message-starting=STRING" echo " ignore messages starting with the string" echo " -o, --output=FILE output to FILE instead of ChangeLog" @@ -232,9 +240,10 @@ echo " -V, --version output version information and exit" echo "" echo "PATH arguments and the following options are passed to the svn log" - echo "command: -r, --revision, --targets --stop-on-copy, --username," - echo "--password, --no-auth-cache, --non-interactive, --config-dir and" - echo "--limit (see 'svn help log' for more information)." + echo "command: -r, --revision, -g, --use-merge-history, -c, --change," + echo "--targets, --stop-on-copy, -l, --username, --password, --no-auth-cache," + echo "--non-interactive, --trust-server-cert, --config-dir and --config-option" + echo "(see 'svn help log' for more information)." exit 0 ;; -*) @@ -288,13 +297,16 @@ if [ -z "$CHANGELOG" ] then CHANGELOG="ChangeLog" - [ "$OUTSTYLE" != "cl" ] && CHANGELOG="$CHANGELOG.$OUTSTYLE" + if [ "$OUTSTYLE" != "cl" ] + then + CHANGELOG="$CHANGELOG.$OUTSTYLE" + fi fi # try to determin a prefix to strip from all paths if [ "$STRIPPREFIX" = "AUTOMATICALLY-DETERMINED" ] then - STRIPPREFIX=`LANG=C eval "$SVNINFOCMD" 2> /dev/null | awk '/^URL:/{url=$2} /^Repository Root:/{root=$3} END{if(root){print substr(url,length(root)+2)}else{gsub("^.*/","",url);print url}}'` + STRIPPREFIX=`LANG=C eval "$SVNINFOCMD" | $AWK '/^URL:/{url=$2} /^Repository Root:/{root=$3} END{if(root){print substr(url,length(root)+2)}else{n=split(url,u,"/");print u[n]}}'` STRIPPREFIX=`echo "$STRIPPREFIX" | sed 's/%20/ /g'` fi @@ -317,6 +329,7 @@ --stringparam authorsfile "$AUTHORSFILE" \ --stringparam title "$TITLE" \ --stringparam revision-link "$REVISION_LINK" \ + --stringparam ticket-link "$TICKET_LINK" \ --stringparam ignore-message-starting "$IGNORE_MESSAGE_STARTING" \ --nowrite \ --nomkdir \ Modified: ipcop/trunk/tools/svn2cl/svn2cl.xsl =================================================================== --- ipcop/trunk/tools/svn2cl/svn2cl.xsl 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/svn2cl.xsl 2011-04-05 20:29:34 UTC (rev 5595) @@ -5,7 +5,7 @@ svn2cl.xsl - xslt stylesheet for converting svn log to a normal changelog - version 0.10 + version 0.13 Usage (replace ++ with two minus signs which aren't allowed inside xml comments): @@ -26,7 +26,7 @@ that I was not completely happy with and some other common xslt constructs found on the web. - Copyright (C) 2004, 2005, 2006, 2007 Arthur de Jong. + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Arthur de Jong. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -55,12 +55,6 @@ --> -<!DOCTYPE xsl:stylesheet [ - <!ENTITY tab "	"> - <!ENTITY newl "&#xA;"> - <!ENTITY space " "> -]> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> @@ -107,6 +101,20 @@ <xsl:key name="author-lookup" match="author" use="@uid" /> <xsl:variable name="authors-top" select="document($authorsfile)/authors" /> + <!-- determin the path part to strip --> + <xsl:variable name="strip-path"> + <!-- if strip-prefix does not start with a slash, prepend it --> + <xsl:if test="not(starts-with($strip-prefix,'/'))"> + <xsl:text>/</xsl:text> + </xsl:if> + <!-- the prefix itself --> + <xsl:value-of select="$strip-prefix" /> + <!-- if strip-prefix does not start with a slash, append it --> + <xsl:if test="substring($strip-prefix,string-length($strip-prefix),1)!='/'"> + <xsl:text>/</xsl:text> + </xsl:if> + </xsl:variable> + <!-- match the topmost log entry --> <xsl:template match="log"> <xsl:choose> @@ -119,7 +127,7 @@ </xsl:otherwise> </xsl:choose> <!-- add newlines at the end of the changelog --> - <xsl:text>&newl;</xsl:text> + <xsl:text> </xsl:text> </xsl:template> <!-- format one entry from the log --> @@ -127,15 +135,13 @@ <xsl:choose> <!-- if we're grouping we should omit some headers --> <xsl:when test="$groupbyday='yes'"> - <!-- save log entry number --> - <xsl:variable name="pos" select="position()" /> <!-- fetch previous entry's date --> <xsl:variable name="prevdate"> - <xsl:apply-templates select="../logentry[position()=(($pos)-1)]/date" /> + <xsl:apply-templates select="preceding-sibling::logentry[position()=1]/date" /> </xsl:variable> <!-- fetch previous entry's author --> <xsl:variable name="prevauthor"> - <xsl:value-of select="normalize-space(../logentry[position()=(($pos)-1)]/author)" /> + <xsl:value-of select="normalize-space(preceding-sibling::logentry[position()=1]/author)" /> </xsl:variable> <!-- fetch this entry's date --> <xsl:variable name="date"> @@ -149,33 +155,33 @@ <xsl:if test="($prevdate!=$date) or ($prevauthor!=$author)"> <!-- add newline --> <xsl:if test="not(position()=1)"> - <xsl:text>&newl;</xsl:text> + <xsl:text> </xsl:text> </xsl:if> <!-- date --> <xsl:value-of select="$date" /> <!-- two spaces --> - <xsl:text>&space;&space;</xsl:text> + <xsl:text>  </xsl:text> <!-- author's name --> <xsl:apply-templates select="author" /> <!-- two newlines --> - <xsl:text>&newl;</xsl:text> - <xsl:if test="$separate-daylogs!='yes'"><xsl:text>&newl;</xsl:text></xsl:if> + <xsl:text> </xsl:text> + <xsl:if test="$separate-daylogs!='yes'"><xsl:text> </xsl:text></xsl:if> </xsl:if> </xsl:when> <!-- write the log header --> <xsl:otherwise> <!-- add newline --> <xsl:if test="not(position()=1)"> - <xsl:text>&newl;</xsl:text> + <xsl:text> </xsl:text> </xsl:if> <!-- date --> <xsl:apply-templates select="date" /> <!-- two spaces --> - <xsl:text>&space;&space;</xsl:text> + <xsl:text>  </xsl:text> <!-- author's name --> <xsl:apply-templates select="author" /> <!-- two newlines --> - <xsl:text>&newl;&newl;</xsl:text> + <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> <!-- get paths string --> @@ -187,7 +193,7 @@ <xsl:if test="$include-rev='yes'"> <xsl:text>[r</xsl:text> <xsl:value-of select="@revision" /> - <xsl:text>]&space;</xsl:text> + <xsl:text>] </xsl:text> </xsl:if> </xsl:variable> <!-- trim trailing newlines --> @@ -195,7 +201,7 @@ <!-- add a line break before the log message --> <xsl:choose> <xsl:when test="$breakbeforemsg='yes'"> - <xsl:text>&newl;</xsl:text> + <xsl:text> </xsl:text> </xsl:when> <xsl:when test="number($breakbeforemsg)>0"> <xsl:call-template name="newlines"> @@ -208,14 +214,14 @@ </xsl:call-template> </xsl:variable> <!-- add newline here if separate-daylogs is in effect --> - <xsl:if test="$groupbyday='yes' and $separate-daylogs='yes'"><xsl:text>&newl;</xsl:text></xsl:if> + <xsl:if test="$groupbyday='yes' and $separate-daylogs='yes'"><xsl:text> </xsl:text></xsl:if> <!-- first line is indented (other indents are done in wrap template) --> - <xsl:text>&tab;*&space;</xsl:text> + <xsl:text>	* </xsl:text> <!-- set up the text to wrap --> <xsl:variable name="txt"> <xsl:value-of select="$rev" /> <xsl:if test="$paths!=''"> - <xsl:value-of select="concat($paths,':&space;')" /> + <xsl:value-of select="concat($paths,': ')" /> </xsl:if> <xsl:value-of select="$msg" /> </xsl:variable> @@ -232,7 +238,7 @@ <xsl:value-of select="substring($date,1,10)" /> <!-- output time part --> <xsl:if test="$groupbyday!='yes'"> - <xsl:text>&space;</xsl:text> + <xsl:text> </xsl:text> <xsl:value-of select="substring($date,12,5)" /> </xsl:if> </xsl:template> @@ -279,39 +285,20 @@ <xsl:choose> <!-- only handle paths that begin with the path and strip the path --> <xsl:when test="$strip-prefix != ''"> - <!-- if strip-prefix does not start with a slash, prepend it --> - <xsl:variable name="tmpstrip1"> - <xsl:choose> - <xsl:when test="starts-with($strip-prefix,'/')"> - <xsl:value-of select="$strip-prefix" /> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat('/',$strip-prefix)" /> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <!-- strip trailing slash from strip-prefix --> - <xsl:variable name="tmpstrip2"> - <xsl:choose> - <xsl:when test="substring($tmpstrip1,string-length($tmpstrip1),1)='/'"> - <xsl:value-of select="substring($tmpstrip1,1,string-length($tmpstrip1)-1)" /> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$tmpstrip1" /> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> <!-- filter on all entries within directory --> - <xsl:for-each select="path[starts-with(concat(normalize-space(.),'/'),concat($tmpstrip2,'/'))]"> + <xsl:for-each select="path[starts-with(concat(normalize-space(.),'/'),$strip-path)]"> <xsl:sort select="normalize-space(.)" data-type="text" /> <!-- unless we are the first entry, add a comma --> <xsl:if test="not(position()=1)"> - <xsl:text>,&space;</xsl:text> + <xsl:text>, </xsl:text> </xsl:if> - <!-- print the path name --> - <xsl:call-template name="printpath"> - <xsl:with-param name="path" select="substring(normalize-space(.),string-length($strip-prefix)+3)" /> - </xsl:call-template> + <!-- get path part --> + <xsl:variable name="path" select="substring(normalize-space(.),string-length($strip-path)+1)" /> + <!-- translate empty string to dot and print result --> + <xsl:if test="$path = ''"> + <xsl:text>.</xsl:text> + </xsl:if> + <xsl:value-of select="$path" /> <!-- add the action flag --> <xsl:if test="$include-actions='yes'"> <xsl:apply-templates select="." mode="action"/> @@ -324,7 +311,7 @@ <xsl:sort select="normalize-space(.)" data-type="text" /> <!-- unless we are the first entry, add a comma --> <xsl:if test="not(position()=1)"> - <xsl:text>,&space;</xsl:text> + <xsl:text>, </xsl:text> </xsl:if> <!-- print the path name --> <xsl:value-of select="normalize-space(.)" /> @@ -345,60 +332,34 @@ <xsl:when test="@copyfrom-path"> <xsl:text>[CPY]</xsl:text> </xsl:when> - <xsl:when test="@action='D'"> + <xsl:when test="@action='A'"> <xsl:text>[ADD]</xsl:text> </xsl:when> </xsl:choose> </xsl:template> - <!-- transform path to something printable --> - <xsl:template name="printpath"> - <!-- fetch the pathname --> - <xsl:param name="path" /> - <!-- strip leading slash --> - <xsl:variable name="tmp1"> - <xsl:choose> - <xsl:when test="starts-with($path,'/')"> - <xsl:value-of select="substring($path,2)" /> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$path" /> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <!-- translate empty string to dot --> - <xsl:choose> - <xsl:when test="$tmp1 = ''"> - <xsl:text>.</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$tmp1" /> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - <!-- string-wrapping template --> <xsl:template name="wrap"> <xsl:param name="txt" /> <xsl:variable name="normtxt" select="normalize-space($txt)" /> <xsl:choose> - <xsl:when test="contains($txt,'&newl;')"> + <xsl:when test="contains($txt,' ')"> <!-- text contains newlines, do the first line --> <xsl:call-template name="wrap"> - <xsl:with-param name="txt" select="substring-before($txt,'&newl;')" /> + <xsl:with-param name="txt" select="substring-before($txt,' ')" /> </xsl:call-template> <!-- print tab --> - <xsl:text>&tab;&space;&space;</xsl:text> + <xsl:text>	  </xsl:text> <!-- wrap the rest of the text --> <xsl:call-template name="wrap"> - <xsl:with-param name="txt" select="substring-after($txt,'&newl;')" /> + <xsl:with-param name="txt" select="substring-after($txt,' ')" /> </xsl:call-template> </xsl:when> <xsl:when test="(string-length($normtxt) < (($linelen)-9)) or not(contains($normtxt,' '))"> <!-- this is easy, nothing to do --> <xsl:value-of select="$normtxt" /> <!-- add newline --> - <xsl:text>&newl;</xsl:text> + <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> <!-- find the first line --> @@ -420,7 +381,7 @@ <!-- print line --> <xsl:value-of select="$line" /> <!-- print newline and tab --> - <xsl:text>&newl;&tab;&space;&space;</xsl:text> + <xsl:text> 	  </xsl:text> <!-- wrap the rest of the text --> <xsl:call-template name="wrap"> <xsl:with-param name="txt" select="normalize-space(substring($normtxt,string-length($line)+1))" /> @@ -449,26 +410,26 @@ <xsl:param name="txt" /> <xsl:choose> <!-- find starting newlines --> - <xsl:when test="substring($txt,1,1) = '&newl;'"> + <xsl:when test="substring($txt,1,1) = ' '"> <xsl:call-template name="trim-newln"> <xsl:with-param name="txt" select="substring($txt,2)" /> </xsl:call-template> </xsl:when> <!-- find trailing newlines --> - <xsl:when test="substring($txt,string-length($txt),1) = '&newl;'"> + <xsl:when test="substring($txt,string-length($txt),1) = ' '"> <xsl:call-template name="trim-newln"> <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" /> </xsl:call-template> </xsl:when> - <!-- if the message has paragrapgs, find the first one --> - <xsl:when test="$reparagraph='yes' and contains($txt,'&newl;&newl;')"> + <!-- if the message has paragraphs, find the first one --> + <xsl:when test="$reparagraph='yes' and contains($txt,' ')"> <!-- remove newlines from first paragraph --> - <xsl:value-of select="normalize-space(substring-before($txt,'&newl;&newl;'))" /> + <xsl:value-of select="normalize-space(substring-before($txt,' '))" /> <!-- paragraph separator --> - <xsl:text>&newl;&newl;</xsl:text> + <xsl:text> </xsl:text> <!-- do the rest of the text --> <xsl:call-template name="trim-newln"> - <xsl:with-param name="txt" select="substring-after($txt,'&newl;&newl;')" /> + <xsl:with-param name="txt" select="substring-after($txt,' ')" /> </xsl:call-template> </xsl:when> <!-- remove more single newlines --> @@ -485,7 +446,7 @@ <!-- insert a number of newlines --> <xsl:template name="newlines"> <xsl:param name="count" /> - <xsl:text>&newl;</xsl:text> + <xsl:text> </xsl:text> <xsl:if test="$count>1"> <xsl:call-template name="newlines"> <xsl:with-param name="count" select="($count)-1" /> Modified: ipcop/trunk/tools/svn2cl/svn2html.css =================================================================== --- ipcop/trunk/tools/svn2cl/svn2html.css 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/svn2html.css 2011-04-05 20:29:34 UTC (rev 5595) @@ -4,7 +4,7 @@ margin-left: 1.5em; margin-right: 1.5em; margin-top: 1.5em; - margin-bottom: 1em; + margin-bottom: 1em; } ul.changelog_entries { Modified: ipcop/trunk/tools/svn2cl/svn2html.xsl =================================================================== --- ipcop/trunk/tools/svn2cl/svn2html.xsl 2011-04-05 20:06:11 UTC (rev 5594) +++ ipcop/trunk/tools/svn2cl/svn2html.xsl 2011-04-05 20:29:34 UTC (rev 5595) @@ -5,7 +5,7 @@ svn2html.xsl - xslt stylesheet for converting svn log to a normal changelog fromatted in html - version 0.10 + version 0.13 Usage (replace ++ with two minus signs): svn ++verbose ++xml log | \ @@ -14,11 +14,13 @@ ++stringparam authorsfile FILE \ ++stringparam title NAME \ ++stringparam revision-link NAME \ + ++stringparam ticket-link NAME \ + ++stringparam ticket-prefix NAME \ svn2html.xsl - > ChangeLog.html This file is partially based on (and includes) svn2cl.xsl. - Copyright (C) 2005, 2006, 2007 Arthur de Jong. + Copyright (C) 2005, 2006, 2007, 2009, 2010 Arthur de Jong. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -47,11 +49,6 @@ --> -<!DOCTYPE xsl:stylesheet [ - <!ENTITY newl "&#xA;"> - <!ENTITY space " "> -]> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -76,6 +73,12 @@ <!-- link to use for linking revision numbers --> <xsl:param name="revision-link" select="'#r'" /> + <!-- link to use for linking ticket numbers --> + <xsl:param name="ticket-link" select="''" /> + + <!-- string to search for as prefix to ticket ID to use for linking ticket numbers --> + <xsl:param name="ticket-prefix" select="'#'" /> + <!-- match toplevel element --> <xsl:template match="log"> <html> @@ -100,7 +103,7 @@ </xsl:choose> </ul> <p class="changelog_footer"> - <xsl:text>Generated by </xsl:text><a href="http://ch.tudelft.nl/~arthur/svn2cl/">svn2cl 0.10</a> + <xsl:text>Generated by </xsl:text><a href="http://arthurdejong.org/svn2cl/">svn2cl 0.13</a> </p> </body> </html> @@ -111,15 +114,13 @@ <xsl:choose> <!-- if we're grouping we should omit some headers --> <xsl:when test="$groupbyday='yes'"> - <!-- save log entry number --> - <xsl:variable name="pos" select="position()" /> <!-- fetch previous entry's date --> <xsl:variable name="prevdate"> - <xsl:apply-templates select="../logentry[position()=(($pos)-1)]/date" /> + <xsl:apply-templates select="preceding-sibling::logentry[position()=1]/date" /> </xsl:variable> <!-- fetch previous entry's author --> <xsl:variable name="prevauthor"> - <xsl:value-of select="normalize-space(../logentry[position()=(($pos)-1)]/author)" /> + <xsl:value-of select="normalize-space(preceding-sibling::logentry[position()=1]/author)" /> </xsl:variable> <!-- fetch this entry's date --> <xsl:variable name="date"> @@ -134,7 +135,7 @@ <li class="changelog_entry"> <!-- date --> <span class="changelog_date"><xsl:value-of select="$date" /></span> - <xsl:text>&space;</xsl:text> + <xsl:text> </xsl:text> <!-- author's name --> <span class="changelog_author"><xsl:apply-templates select="author" /></span> </li> @@ -145,7 +146,7 @@ <li class="changelog_entry"> <!-- date --> <span class="changelog_date"><xsl:apply-templates select="date" /></span> - <xsl:text>&space;</xsl:text> + <xsl:text> </xsl:text> <!-- author's name --> <span class="changelog_author"><xsl:apply-templates select="author" /></span> </li> @@ -167,10 +168,10 @@ <span class="changelog_revision"> <a id="r{@revision}" href="{$revlink}">[r<xsl:value-of select="@revision" />]</a> </span> - <xsl:text>&space;</xsl:text> + <xsl:text> </xsl:text> <!-- get paths string --> <span class="changelog_files"><xsl:apply-templates select="paths" /></span> - <xsl:text>&space;</xsl:text> + <xsl:text> </xsl:text> <!-- get message text --> <xsl:variable name="msg"> <xsl:call-template name="trim-newln"> @@ -178,31 +179,140 @@ </xsl:call-template> </xsl:variable> <span class="changelog_message"> - <xsl:call-template name="newlinestobr"> + <xsl:call-template name="formatmessage"> <xsl:with-param name="txt" select="$msg" /> </xsl:call-template> </span> </li> </xsl:template> - <!-- template to replace line breaks with <br /> tags --> - <xsl:template name="newlinestobr"> + <!-- template to do formatting of log message --> + <xsl:template name="formatmessage"> <xsl:param name="txt" /> <xsl:choose> - <xsl:when test="contains($txt,'&newl;')"> + <!-- perform newline-to-br transformation --> + <xsl:when test="contains($txt,' ')"> <!-- text contains newlines, do the first line --> - <xsl:value-of select="substring-before($txt,'&newl;')" /> + <xsl:call-template name="formatmessage"> + <xsl:with-param name="txt" select="substring-before($txt,' ')" /> + </xsl:call-template> <!-- print new line --> <br /> - <!-- wrap the rest of the text --> - <xsl:call-template name="newlinestobr"> - <xsl:with-param name="txt" select="substring-after($txt,'&newl;')" /> + <!-- do the rest of the text --> + <xsl:call-template name="formatmessage"> + <xsl:with-param name="txt" select="substring-after($txt,' ')" /> </xsl:call-template> </xsl:when> + <!-- perform url highlighting --> + <xsl:when test="contains($txt,'http://')"> + <xsl:call-template name="urlstolinks"> + <xsl:with-param name="txt" select="$txt" /> + </xsl:call-template> + </xsl:when> + <!-- perform url highlighting --> + <xsl:when test="contains($txt,'https://')"> + <xsl:call-template name="urlstolinks"> + <xsl:with-param name="txt" select="$txt" /> + </xsl:call-template> + </xsl:when> + <!-- perform ticket highlighting --> + <xsl:when test="string-length($ticket-link) > 0 and contains($txt,$ticket-prefix)"> + <xsl:call-template name="ticketstolinks"> + <xsl:with-param name="txt" select="$txt" /> + </xsl:call-template> + </xsl:when> + <!-- there does not seem to be anything parseable left --> <xsl:otherwise> <xsl:value-of select="$txt" /> </xsl:otherwise> </xsl:choose> </xsl:template> + <!-- template to replace url-like strings with links --> + <xsl:template name="urlstolinks"> + <xsl:param name="txt" /> + <!-- see if the string contains something url-like --> + <xsl:variable name="before"> + <xsl:choose> + <xsl:when test="contains($txt,'http://')"> + <xsl:value-of select="substring-before($txt,'http://')" /> + </xsl:when> + <xsl:when test="contains($txt,'https://')"> + <xsl:value-of select="substring-before($txt,'https://')" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$txt" /> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <!-- output the first part --> + <xsl:call-template name="formatmessage"> + <xsl:with-param name="txt" select="$before" /> + </xsl:call-template> + <!-- get the rest of the text --> + <xsl:variable name="rest" select="substring($txt,string-length($before)+1)" /> + <!-- if there is a rest it's beginning is a URL --> + <xsl:if test="string-length($rest) > 0"> + <!-- get the url part --> + <xsl:variable name="url"> + <xsl:choose> + <xsl:when test="contains($rest,' ')"> + <xsl:value-of select="substring-before($rest,' ')" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$rest" /> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <!-- output the link --> + <a href="{$url}"><xsl:value-of select="$url" /></a> + <!-- parse the part after --> + <xsl:call-template name="formatmessage"> + <xsl:with-param name="txt" select="substring($rest,string-length($url)+1)" /> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <!-- template to replace ticket references with links --> + <xsl:template name="ticketstolinks"> + <xsl:param name="txt" /> + <!-- see if the string contains that looks like a ticket reference --> + <xsl:variable name="before"> + <xsl:choose> + <xsl:when test="contains($txt,$ticket-prefix)"> + <xsl:value-of select="substring-before($txt,$ticket-prefix)" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$txt" /> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <!-- output the first part --> + <xsl:call-template name="formatmessage"> + <xsl:with-param name="txt" select="$before" /> + </xsl:call-template> + <!-- get the rest of the text --> + <xsl:variable name="rest" select="substring($txt,string-length($before)+1)" /> + <!-- if there is a rest it's beginning is a ticket reference --> + <xsl:if test="string-length($rest) > 0"> + <!-- get the ticket part --> + <xsl:variable name="ticket"> + <xsl:choose> + <xsl:when test="contains($rest,' ')"> + <xsl:value-of select="substring-after(substring-before($rest,' '),$ticket-prefix)" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring-after($rest,$ticket-prefix)" /> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <!-- output the link --> + <a href="{$ticket-link}{$ticket}"><xsl:value-of select="$ticket-prefix" /><xsl:value-of select="$ticket" /></a> + <!-- parse the part after --> + <xsl:call-template name="formatmessage"> + <xsl:with-param name="txt" select="substring($rest,string-length($ticket-prefix)+string-length($ticket)+1)" /> + </xsl:call-template> + </xsl:if> + </xsl:template> + </xsl:stylesheet> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn