首页 > 代码库 > Python SVN 更新 脚本

Python SVN 更新 脚本

#configsPROJECTS = {"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 osWORKSPACE = 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()