[GRASS-SVN] r70714 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 1 06:48:03 PST 2017


Author: hcho
Date: 2017-03-01 06:48:03 -0800 (Wed, 01 Mar 2017)
New Revision: 70714

Added:
   grass/trunk/tools/svnlog.sh
Log:
tools/svnlog.sh: Add a new script to collect log messages from individual SVN revisions

Added: grass/trunk/tools/svnlog.sh
===================================================================
--- grass/trunk/tools/svnlog.sh	                        (rev 0)
+++ grass/trunk/tools/svnlog.sh	2017-03-01 14:48:03 UTC (rev 70714)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+############################################################################
+#
+# MODULE:       Create a combined log message for all or specified SVN revisions
+# AUTHOR(S):    Huidae Cho <grass4u gmail.com>
+# PURPOSE:      Create a log message for backporting and release news
+# COPYRIGHT:    (C) 2017 by Huidae Cho
+#                and the GRASS Development Team
+#
+#               This program is free software under the GNU General
+#               Public License (>=v2). Read the file COPYING that
+#               comes with GRASS for details.
+#
+#############################################################################
+
+# collect revision numbers from command line arguments, if any
+# e.g., r70666, r70637 => -r70666 -r70637
+revs=""
+for i; do
+	# remove any non-numeric characters
+	r=`echo $i | sed 's/[^0-9]//g'`
+	if [ "$r" = "" ]; then
+		continue
+	fi
+	# prepare svn log options
+	revs="$revs -r$r"
+done
+
+svn log $revs | awk '
+/^------------------------------------------------------------------------$/{
+	if(msg != ""){
+		gsub(/\n+$/, "", msg)
+		split(msg, lines, /\n/)
+		printf "%s", msg
+		if(length(lines) == 1)
+			printf " (backport %s)\n", rev
+		else
+			# add a separator for multiple lines
+			printf "\n(backport %s)\n%s\n", rev, $0
+	}
+	started = 1
+	msg = ""
+	next
+}
+{
+	if(started){
+		rev = $1
+		started = 0
+		getline
+		next
+	}
+	msg = msg $0 "\n"
+}'


Property changes on: grass/trunk/tools/svnlog.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the grass-commit mailing list