Python SVN 更新 脚本

#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 更新 脚本

上一篇:javascript ajax请求(一般处理程序)


下一篇:Python Special Syntax 9 : 异常捕获