Index: svn2cl.sh =================================================================== --- svn2cl.sh +++ svn2cl.sh 2009-11-30 10:33:33.000000000 +0100 @@ -49,6 +49,7 @@ SEPARATEDAYLOGS="no" ACTIONS="no" CHANGELOG="" +CHANGELOG_BAK="" OUTSTYLE="cl" SVNLOGCMD="svn --verbose --xml log" SVNINFOCMD="svn --non-interactive info" @@ -57,6 +58,7 @@ TITLE="ChangeLog" REVISION_LINK="#r" TMPFILES="" +ACCUM="no" AWK="awk" # do command line checking @@ -157,6 +159,10 @@ OUTSTYLE="html" shift ;; + --accum) + ACCUM="yes" + shift + ;; -r|--revision|--targets|--limit) # add these as extra options to the command (with argument) arg=`echo "$2" | sed "s/'/'\"'\"'/g"` @@ -229,6 +235,7 @@ echo " --stdout output to stdout instead of ChangeLog" echo " --authors=FILE file to read for authors" echo " --html output as html instead of plain text" + echo " --accum add to an existing file" echo " -h, --help display this help and exit" echo " -V, --version output version information and exit" echo "" @@ -305,6 +312,19 @@ # redirect stdout to the changelog file if needed if [ "x$CHANGELOG" != "x-" ] then + if [ "$ACCUM" = "yes" ] + then + date=`sed -ne 's/^\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\s\+\(\w\+\s\+\)\?[0-9][0-9]:[0-9][0-9]\).*/\1/;T;p;q' $CHANGELOG 2>/dev/null` + if [ -n "$date" ] + then + SVNLOGCMD="$SVNLOGCMD -r 'HEAD:{$date}'" + else + echo "no date found in existing changelog file, accum skipped" + ACCUM="no" + fi + CHANGELOG_BAK="$CHANGELOG.bak" + cp -f "$CHANGELOG" "$CHANGELOG_BAK" + fi exec > "$CHANGELOG" fi @@ -327,6 +347,8 @@ --nonet \ "$XSL" - +[ -n "$CHANGELOG_BAK" ] && cat "$CHANGELOG_BAK" + # clean up temporary files [ -n "$TMPFILES" ] && eval "rm -f $TMPFILES"