Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > contrib-release-src > by-pkgid > cc3dfe88329520ee251807804f6e13b0 > files > 2

svn2cl-0.9-2mdv2008.1.src.rpm

--- svn2cl-0.8/svn2cl.sh.accum	2006-10-18 23:38:06.000000000 +0200
+++ svn2cl-0.8/svn2cl.sh	2006-12-29 15:54:10.000000000 +0100
@@ -48,6 +48,7 @@
 REPARAGRAPH="no"
 SEPARATEDAYLOGS="no"
 CHANGELOG=""
+CHANGELOG_BAK=""
 OUTSTYLE="cl"
 SVNLOGCMD="svn --verbose --xml log"
 SVNINFOCMD="svn info"
@@ -55,6 +56,7 @@
 TITLE="ChangeLog"
 REVISION_LINK="#r"
 TMPFILES=""
+ACCUM="no"
 
 # do command line checking
 prog=`basename $0`
@@ -142,6 +144,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"`
@@ -211,6 +217,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 ""
@@ -284,6 +291,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
 
@@ -304,6 +324,8 @@
            --nonet \
            "$XSL" -
 
+[ -n "$CHANGELOG_BAK" ] && cat "$CHANGELOG_BAK"
+
 # clean up temporary files
 [ -n "$TMPFILES" ] && eval "rm -f $TMPFILES"