#!/bin/sh
# This script recursively gets the list of externals of the current
# directory, and uses svn log to evaluate the lag of each. Any
# external that takes more than one second gets printed on the
# standard output.
#
# The url parsing is quite adhoc; it will break down if a directory
# name contains 'http'. When that happens, rewrite the sed script.
#
# 2014-12-25 -- julien.guertault@gameloft.com
allstart=`date +"%s"`
for i in `svn propget svn:externals -R . | sed 's/.*\(http[^ ]*\).*/\1/'`; do
echo "testing $i"
start=`date +"%s"`
svn log -l 1 "$i" > /dev/null 2> /dev/null
end=`date +"%s"`
duration=`expr $end - $start`
if [ $duration -gt 1 ]; then
echo "$i: ${duration}s"
fi
done
allend=`date +"%s"`
allduration=`expr $allend - $allstart`
echo "Total time: ${allduration}s"