python批量更新SVN文件夹

来源:互联网 发布:软件测试职业技能 编辑:程序博客网 时间:2024/05/29 17:24

#!/usr/bin/pythonimport os,os.pathimport subprocessdef getroot():import inspectcaller = inspect.stack()[1][1]return os.path.abspath(os.path.dirname(caller))##### begin#root = os.getcwd();root = getroot();print '\nwork folder: [ ' + root + ' ]\n'for parent,dirs,files in os.walk(root):for d in dirs:#print 'begin up:' + d;#subprocess.call(["svn ","up",d],shell=True)cmd = 'svn up ' + d;print '---------------------' + cmd + '-----------------'os.system(cmd)print 'done'break;



原创粉丝点击