#!/usr/bin/ptyhon from svncmd import SvnCmd import sys #first1 parameter aciton #second parameter svnpath #third parameter servertype # action include 'svnst','svnci','svnupdate','svnrevision','svnrollback' commands. #Task = SvnCmd('/xinmi_data/zhangwj/test','test') if len(sys.argv) == 4: Task = SvnCmd(sys.argv[2],sys.argv[3]) elif len(sys.argv) == 3: Task = SvnCmd(sys.argv[2]) else: print "Parameter number is Error!" sys.exit(1) if sys.argv[1] == 'svnst': status,output = Task.svnst() print output if status != 0: sys.exit(status) elif sys.argv[1] == 'svnci': status,output = Task.svnpreci() print output if status != 0: sys.exit(status) status1,output1 = Task.svnci() print output1 if status1 != 0: sys.exit(status1) status2,output2 = Task.svnupdate() print output2 if status1 != 0: sys.exit(status2) elif sys.argv[1] == 'svnupdate': status,output = Task.svnupdate() print output if status != 0: sys.exit(status) elif sys.argv[1] == 'svnrevision': status,output = Task.svnrevision() print output if status != 0: sys.exit(status) elif sys.argv[1] == 'svnrollback': status,output = Task.svnrollback() print output if status != 0: sys.exit(status) status1,output1 = Task.svnci() print output1 if status1 != 0: sys.exit(status) status2,output2 = Task.svnupdate() print output2 if status2 != 0: sys.exit(status2) sys.exit(0)
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。