SVN up


If you do a svn up, you want to know what happened in between, right?

Log entries, Files changed. You can either go step by step through the revisions or let this bash script do the svn up for you:

#!/bin/bash
oldrev=$(svn info |grep '^Revision: '|sed 's/Revision: //g')
svn up
newrev=$(svn info |grep '^Revision: '|sed 's/Revision: //g')
[ "$oldrev" == "$newrev" ] || {
echo "Made the step from $oldrev to $newrev; Log: "
for i in $(seq $oldrev $newrev); do
svn log -r $i
echo Files:
svn diff --diff-cmd diff -x -q -c $i | grep '^Index:' | sed 's/^Index://g'
echo
done
}

  1. #1 by JohannesBuchner on May 25th, 2008

    I noticed this is stupid, because svn log provides a -v option that prints out all changed files. However, I liked it that the above script prints out log entries slowly so you can read them.

    Thus I replaced the for loop with:

    svn log -v -r$oldrev:$newrev|while read line; do
    echo "$line"; sleep 0.1; echo "$line" |
    grep -q -- "-----" && sleep 5;
    done
  2. #2 by panzi on August 15th, 2008

    REPLY:
    Another problem exists if your $LANG isn’t “en”. So do:

    oldlang=$LANG
    export LANG=C
    ...
    export LANG=$oldlang
    
(will not be published)

  1. No trackbacks yet.