Warning, file /sdk/kde-dev-scripts/generate_changelog was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/bin/sh
0002 # Collects the SVN logs for all changes between two releases of a SVN module
0003 # SVNURL must be set
0004 
0005 if test $# -ne 4; then
0006 
0007   echo "Usage: $0 <basename> <src> <tag_old_version> <tag_new_version>"
0008   echo "where src is the relative repository path to the sources,"
0009   echo "and tag_version and tag_last_version are the tag names in tags/."
0010   echo
0011   echo "Example: $0 kdepim branches/kdepim/proko2/kdepim kdepim/proko2_0_3 kdepim/proko2_0_4"
0012   exit 1
0013 fi
0014 
0015 test -n "$SVNURL" || { echo "Please set SVNURL first"; exit 1; }
0016 
0017 # Abort at first error
0018 set -e
0019 
0020 APP=$1
0021 SRCREP="$SVNURL/$2"
0022 LASTVER=$3
0023 VER=$4
0024 TAGSREP="$SVNURL/tags"
0025 
0026 changelog=$APP.changelog
0027 
0028 # Grep the version number of the move
0029 rev=`svn info $TAGSREP/$VER/ | grep "Last Changed Rev" | sed s/Last\ Changed\ Rev:\ //g`
0030 # Grep the log for the copyfrom revision (which is the real revision that this is taged from)
0031 tag=`svn log -r $rev $TAGSREP/$VER -v --xml | grep copyfrom-rev | sed s/.*copyfrom-rev=\"//g | sed s/\"//g | head -n 1`
0032 
0033 rev=`svn info $TAGSREP/$LASTVER/ | grep "Last Changed Rev" | sed s/Last\ Changed\ Rev:\ //g`
0034 lasttag=`svn log -r $rev $TAGSREP/$LASTVER -v --xml | grep copyfrom-rev | sed s/.*copyfrom-rev=\"//g | sed s/\"//g | head -n 1`
0035 
0036 cat > changelog.xslt <<EOF
0037 <?xml version="1.0" encoding="UTF-8" ?>
0038 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
0039 <xsl:output method="text"/>
0040 <xsl:template match="/"><xsl:for-each select="//logentry">
0041 * <xsl:value-of select="msg" />
0042 </xsl:for-each>
0043 </xsl:template>
0044 </xsl:stylesheet>
0045 EOF
0046 
0047 # Get the log between the two versions
0048 # We do it for each subdirectory, to separate the logs a bit.
0049 cp -f /dev/null $changelog
0050 for subdir in `svn ls $SRCREP`; do
0051   subdir=`echo $subdir | sed -e 's,/$,,'`
0052   svn log -r $tag:$lasttag $SRCREP/$subdir --xml > xml
0053   xsltproc -o xmlout changelog.xslt xml
0054   if test -s xmlout; then
0055     echo $subdir >> $changelog
0056     echo '------' >> $changelog
0057     cat xmlout >> $changelog
0058     echo >> $changelog
0059   fi
0060   rm -f xml xmlout
0061 done
0062 
0063 rm -f changelog.xslt
0064 
0065 echo "Changelog written to $changelog"