Revision: 2986 http://geany.svn.sourceforge.net/geany/?rev=2986&view=rev Author: ntrel Date: 2008-09-23 14:46:42 +0000 (Tue, 23 Sep 2008)
Log Message: ----------- Add svn-changes.sh script to print SVN working copy changes in ChangeLog format, and warn about unknown files.
Modified Paths: -------------- trunk/scripts/changelist.pl
Added Paths: ----------- trunk/scripts/svn-changes.sh
Modified: trunk/scripts/changelist.pl =================================================================== --- trunk/scripts/changelist.pl 2008-09-23 11:37:20 UTC (rev 2985) +++ trunk/scripts/changelist.pl 2008-09-23 14:46:42 UTC (rev 2986) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # Author: Nick Treleaven -# License: GPL V2 or later +# License: GNU GPL V2 or later
# Searches a ChangeLog file for a line matching 'matchstring', then matches # all lines until two consecutive empty lines are found. The process then
Added: trunk/scripts/svn-changes.sh =================================================================== --- trunk/scripts/svn-changes.sh (rev 0) +++ trunk/scripts/svn-changes.sh 2008-09-23 14:46:42 UTC (rev 2986) @@ -0,0 +1,48 @@ +#!/bin/bash +# Author: Nick Treleaven +# License: GNU GPL V2 or later + +# Displays a summary of Subversion working copy changes in ChangeLog +# format, plus warnings about any unknown files. + +# -s for spaces instead of comma separation +if [[ $1 == -s ]]; then + SPACES="set" + shift +fi + +status=`svn st $*` + +# get list of files changed. +# remove extraneous text, e.g. ? entries +files=`echo "$status" |egrep '^[A-Z]'` +# get filenames on one line +files=`echo "$files" |egrep -o '[^A-Z].[ ]+(.+)' |xargs` +# add commas if -s argument is not given +if [[ -z $SPACES ]]; then + files=`echo "$files" |sed "s/ /, /g"` +fi + +# show modifications +if [[ -n $files ]]; then + echo 'Changes:' + if [[ -z $SPACES ]]; then + files+=':' + fi + # indent and wrap + OUTFILE=/tmp/fmt + echo -n ' '$files | fmt -w 72 >$OUTFILE + # put ' * ' for first line + cat $OUTFILE | sed '1s/ / * /' +else + echo 'No changes.' +fi + +# warn about anything that isn't a modification or addition +warn=`echo "$status" |egrep '^[^MA]'` +if [[ -n $warn ]]; then + echo 'Warnings:' + echo $warn +else + echo 'No warnings.' +fi
Property changes on: trunk/scripts/svn-changes.sh ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.