Python開發SVN批量提交命令指令碼

來源:互聯網
上載者:User

標籤:python開發svn批量提交命令指令碼

############# Svn commit data scripts #############

指令碼功能說明:

將用戶端添加、修改、刪除過的檔案及檔案夾提交


執行方法:

python svn_commit.py 提交目錄


如:

python svn_commit.py E:\test


############# Scripts demo #############

#!/usr/bin/env python#coding:utf-8import osfile_name = sys.argv[1]#file_name = raw_input(‘你要啟動並執行程式:‘)os.chdir(file_name)r=os.popen(‘svn st‘)info = r.readlines()for line in info:    line = line.strip(‘\n‘).split(‘       ‘)    one=line[0]    tow=line[1]    if one == ‘?‘:        os.system(‘svn add %s‘ % tow )    elif one == ‘!‘:        os.system(‘svn delete %s‘ % tow)os.system(‘svn commit -m "commit"‘ )


############# 修改過的內容如下 #############

svn st 列出修改過的檔案

!為刪除的檔案

? 為新增加的檔案

M 為修改的檔案

650) this.width=650;" src="http://s2.51cto.com/wyfs02/M00/8B/6A/wKioL1hOM_Lw5324AAAbY1kwVGQ782.png-wh_500x0-wm_3-wmp_4-s_3268772430.png" title="1.png" alt="wKioL1hOM_Lw5324AAAbY1kwVGQ782.png-wh_50" />


############# 執行指令碼展示 #############

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/8B/6E/wKiom1hONImjxqY5AABgZa5SxOM367.png-wh_500x0-wm_3-wmp_4-s_3267302422.png" title="1.png" alt="wKiom1hONImjxqY5AABgZa5SxOM367.png-wh_50" />


############# 再次查看提交內容 #############

650) this.width=650;" src="http://s2.51cto.com/wyfs02/M01/8B/6E/wKiom1hONLTwSbQIAAASmW_Rcxo566.png-wh_500x0-wm_3-wmp_4-s_3005110489.png" title="1.png" alt="wKiom1hONLTwSbQIAAASmW_Rcxo566.png-wh_50" />

本文出自 “wsyht90的部落格” 部落格,請務必保留此出處http://wsyht90.blog.51cto.com/9014030/1881892

Python開發SVN批量提交命令指令碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.