码迷,mamicode.com
首页 > 编程语言 > 详细

Python SVN 更新 脚本

时间:2014-07-05 19:12:03      阅读:301      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   art   cti   

#configs
PROJECTS = {
"away3d":"svn://svnurl/away3d",
"Away3DUCtrl":"svn://svnurl/Away3DUCtrl",
"Editor":"svn://svnurl/Editor",
"EditorUI":"svn://svnurl/EditorUI",
"SkillEditor":"svn://svnurl/SkillEditor",
"ParticleEditor":"svn://svnurl/ParticleEditor","clayuiV3":"svn://svnurl/clayuiV3",
"RFProjectV3":"svn://svnurl/RFProjectV3",
"RFGameV3":"svn://svnurl/RFGameV3",
}

SVN_USER = "user"
SVN_PWD = "pss"


import os

WORKSPACE = os.getcwd()
print("WORKSPACE:\"%s\"" % WORKSPACE)


    
    
def svnUpdate(targetDir):
    #url, SVN_USER, SVN_PWD, targetDir
    cmd = "svn up \"%s\" --non-interactive"
    os.system(cmd% targetDir)
def svnCheckout(url, targetDir):
    #url, SVN_USER, SVN_PWD, targetDir
    cmd = "svn checkout %s --username %s --password %s --non-interactive %s"
    os.system(cmd% (url, SVN_USER, SVN_PWD, targetDir))
    
def updateAll():
    for key in PROJECTS:
        url = PROJECTS[key]
        dir = WORKSPACE+"\\"+key
        if os.path.exists(dir) == False:
            print("Checkout SVN \"%s\" \n from \"%s\""% (key, url))
            svnCheckout(url, dir)
        else:
            print("Update SVN \"%s\" \n from \"%s\""% (key, url))
            svnUpdate(dir)
updateAll()

 

Python SVN 更新 脚本,布布扣,bubuko.com

Python SVN 更新 脚本

标签:style   blog   color   os   art   cti   

原文地址:http://www.cnblogs.com/tary-hit/p/3822690.html

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