码迷,mamicode.com
首页 > 移动开发 > 详细

查看某一个开发者代码修改量的脚本(ios平台可用)

时间:2016-02-01 20:37:17      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

#!/bin/sh
# This is a script that help you get your team members productivity 
# by analyzing his/her code commiting in SVN repository, for the day before
# 
# You can get a rough num for comparing between team members by using it in the way below
# ./svn_ana.sh SVN_ACCOUNT_NAME | wc -l
#
uname=walker
password=123

if [ $# -lt 1 ]
then
    echo Usage: $0 ACCOUNT
    echo -e "   Where ACCOUNT is the SVN acconut name you want to analyze"
    exit -1
fi
user=$1
today=`date +%Y-%m-%d`
yesterday=`date -v -1d +%Y-%m-%d`
revisions=$(svn log -r{$today}:{$yesterday} --username $uname --password $password |grep $user\ |awk {print $1})
echo "$revision"
lastrev=init
for rawrev in $revisions
do
        echo "$rawrev"
    rev=$(echo $rawrev|tr -d r)
    rev2=`expr $rev - 1`
    if [ "$lastrev" = "init" ]; then
        lastrev=$rev
    fi
    dummy=$(echo $revisions|grep $rev2)
    if [ $? -eq 0 ]
    then
        continue
    fi

    svn diff -r$rev2:$lastrev --username $uname --password $password --diff-cmd diff -x -d |grep -v =======================|grep -v \---
    lastrev=init
done

 

查看某一个开发者代码修改量的脚本(ios平台可用)

标签:

原文地址:http://www.cnblogs.com/jhj117/p/5176014.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!