Revision: 1464
http://mrbs.svn.sourceforge.net/mrbs/?rev=1464&view=rev
Author: jberanek
Date: 2010-09-22 22:49:05 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
* Updated to svn2cl 0.12.
Modified Paths:
--------------
tools/trunk/svn2cl/ChangeLog
tools/trunk/svn2cl/NEWS
tools/trunk/svn2cl/README
tools/trunk/svn2cl/authors.xml
tools/trunk/svn2cl/svn2cl.1
tools/trunk/svn2cl/svn2cl.sh
tools/trunk/svn2cl/svn2cl.xsl
tools/trunk/svn2cl/svn2html.css
tools/trunk/svn2cl/svn2html.xsl
Modified: tools/trunk/svn2cl/ChangeLog
===================================================================
--- tools/trunk/svn2cl/ChangeLog 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/ChangeLog 2010-09-22 22:49:05 UTC (rev 1464)
@@ -1,3 +1,69 @@
+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 <[email protected]>, Mike Hommey
+ <[email protected]> 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 <[email protected]>
+
+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: tools/trunk/svn2cl/NEWS
===================================================================
--- tools/trunk/svn2cl/NEWS 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/NEWS 2010-09-22 22:49:05 UTC (rev 1464)
@@ -1,3 +1,21 @@
+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: tools/trunk/svn2cl/README
===================================================================
--- tools/trunk/svn2cl/README 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/README 2010-09-22 22:49:05 UTC (rev 1464)
@@ -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 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.12)
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.12/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 <[email protected]>.
+send an email to Arthur de Jong <[email protected]>.
Modified: tools/trunk/svn2cl/authors.xml
===================================================================
--- tools/trunk/svn2cl/authors.xml 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/authors.xml 2010-09-22 22:49:05 UTC (rev 1464)
@@ -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:[email protected]">[email protected]</html:a>>
+ Arthur de Jong <<html:a
href="mailto:[email protected]">[email protected]</html:a>>
</author>
<author uid="nobody">
Who's this <[email protected]>
Modified: tools/trunk/svn2cl/svn2cl.1
===================================================================
--- tools/trunk/svn2cl/svn2cl.1 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/svn2cl.1 2010-09-22 22:49:05 UTC (rev 1464)
@@ -1,4 +1,4 @@
-.\" Copyright (C) 2005, 2006, 2007, 2008 Arthur de Jong
+.\" Copyright (C) 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
@@ -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" "Apr 2008" "Version 0.12" "User Commands"
.nh
.SH "NAME"
svn2cl - Create a ChangeLog from a subversion log.
@@ -143,7 +143,7 @@
<?xml version="1.0" encoding="utf\-8"?>
<authors>
<author uid="arthur">
- Arthur de Jong <[email protected]>
+ Arthur de Jong <[email protected]>
</author>
</authors>
.ft R
@@ -157,7 +157,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>[email protected]</html:b>>
+ Arthur de Jong <<html:b>[email protected]</html:b>>
</author>
</authors>
.ft R
@@ -166,7 +166,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 <[email protected]>
+ arthur:Arthur de Jong <[email protected]>
.ft R
.SH "NOTES"
@@ -202,7 +202,7 @@
.BR '\fBsvn\ help\ log\fP'
.SH "COPYRIGHT"
-Copyright \(co 2005, 2006, 2007, 2008 Arthur de Jong <[email protected]>.
+Copyright \(co 2005, 2006, 2007, 2008, 2009 Arthur de Jong
<[email protected]>.
.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: tools/trunk/svn2cl/svn2cl.sh
===================================================================
--- tools/trunk/svn2cl/svn2cl.sh 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/svn2cl.sh 2010-09-22 22:49:05 UTC (rev 1464)
@@ -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 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.12"
# set default parameters
PWD=`pwd`
@@ -51,12 +51,13 @@
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"
TMPFILES=""
+AWK="awk"
# do command line checking
prog=`basename $0`
@@ -200,7 +201,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 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
@@ -288,13 +289,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
Modified: tools/trunk/svn2cl/svn2cl.xsl
===================================================================
--- tools/trunk/svn2cl/svn2cl.xsl 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/svn2cl.xsl 2010-09-22 22:49:05 UTC (rev 1464)
@@ -5,7 +5,7 @@
svn2cl.xsl - xslt stylesheet for converting svn log to a normal
changelog
- version 0.10
+ version 0.12
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;')">
+ <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: tools/trunk/svn2cl/svn2html.css
===================================================================
--- tools/trunk/svn2cl/svn2html.css 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/svn2html.css 2010-09-22 22:49:05 UTC (rev 1464)
@@ -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: tools/trunk/svn2cl/svn2html.xsl
===================================================================
--- tools/trunk/svn2cl/svn2html.xsl 2010-09-22 12:54:28 UTC (rev 1463)
+++ tools/trunk/svn2cl/svn2html.xsl 2010-09-22 22:49:05 UTC (rev 1464)
@@ -5,7 +5,7 @@
svn2html.xsl - xslt stylesheet for converting svn log to a normal
changelog fromatted in html
- version 0.10
+ version 0.12
Usage (replace ++ with two minus signs):
svn ++verbose ++xml log | \
@@ -18,7 +18,7 @@
This file is partially based on (and includes) svn2cl.xsl.
- Copyright (C) 2005, 2006, 2007 Arthur de Jong.
+ Copyright (C) 2005, 2006, 2007, 2009 Arthur de Jong.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -47,11 +47,6 @@
-->
-<!DOCTYPE xsl:stylesheet [
- <!ENTITY newl "&#xA;">
- <!ENTITY space " ">
-]>
-
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
@@ -100,7 +95,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.12</a>
</p>
</body>
</html>
@@ -111,15 +106,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 +127,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 +138,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,20 +160,25 @@
<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">
<xsl:with-param name="txt" select="msg" />
</xsl:call-template>
</xsl:variable>
- <span class="changelog_message">
+ <xsl:variable name="msg2">
<xsl:call-template name="newlinestobr">
<xsl:with-param name="txt" select="$msg" />
</xsl:call-template>
+ </xsl:variable>
+ <span class="changelog_message">
+ <xsl:call-template name="urlstolinks">
+ <xsl:with-param name="txt" select="$msg2" />
+ </xsl:call-template>
</span>
</li>
</xsl:template>
@@ -189,14 +187,14 @@
<xsl:template name="newlinestobr">
<xsl:param name="txt" />
<xsl:choose>
- <xsl:when test="contains($txt,'&newl;')">
+ <xsl:when test="contains($txt,' ')">
<!-- text contains newlines, do the first line -->
- <xsl:value-of select="substring-before($txt,'&newl;')" />
+ <xsl:value-of select="substring-before($txt,' ')" />
<!-- 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;')" />
+ <xsl:with-param name="txt" select="substring-after($txt,' ')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@@ -205,4 +203,47 @@
</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:value-of select="$before" />
+ <!-- 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="urlstolinks">
+ <xsl:with-param name="txt" select="substring($rest,string-length($url)+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.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits