Advertisement
Guest User

Untitled

a guest
Apr 14th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #!/bin/sh
  2. # This is a script that help you get your team member's productivity
  3. # by analyzing his/her code commiting in SVN repository, for the day before
  4. #
  5. # You can get a rough num for comparing between team members by using it in the way below
  6. # ./svn_ana.sh SVN_ACCOUNT_NAME | wc -l
  7. #
  8. uname=vr
  9. password=reader
  10.  
  11. if [ $# -lt 1 ]
  12. then
  13. echo Usage: $0 ACCOUNT
  14. echo -e " Where ACCOUNT is the SVN acconut name you want to analyze"
  15. exit -1
  16. fi
  17. user=$1
  18. today=`date +%Y-%m-%d`
  19. yesterday=`date -d '-1 day' +%Y-%m-%d`
  20. revisions=$(svn log -r{$today}:{$yesterday} --username $uname --password $password |grep $user'\ '|awk '{print $1}')
  21. lastrev=init
  22. for rawrev in $revisions
  23. do
  24. rev=$(echo $rawrev|tr -d r)
  25. rev2=`expr $rev - 1`
  26. if [ "$lastrev" = "init" ]; then
  27. lastrev=$rev
  28. fi
  29. dummy=$(echo $revisions|grep $rev2)
  30. if [ $? -eq 0 ]
  31. then
  32. continue
  33. fi
  34.  
  35. svn diff -r$rev2:$lastrev --username $uname --password $password --diff-cmd diff -x -d |grep -v =======================|grep -v '\---'
  36. lastrev=init
  37. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement