TortoiseSVN是一個(gè)GUI客戶端,這個(gè)自動(dòng)化指導(dǎo)為你展示了讓TortoiseSVN對(duì)話框顯示并收集客戶輸入,如果你希望編寫不需要輸入的腳本,你應(yīng)該使用官方的Subversion命令行客戶端。
TortoiseSVN的GUI程序叫做TortoiseProc.exe 。所有的命令通過(guò)參數(shù)/command:abcd 指定,其中abcd 是必須的命令名。大多數(shù)此類命令至少需要一個(gè)路徑參數(shù),使用/path:"some\path" 指定。在下面的命令表格中,命令引用的是/command:abcd 參數(shù),余下的代表了/path:"some\path" 參數(shù)。
因?yàn)橐恍┟钚枰粋€(gè)目標(biāo)路徑的列表(例如提交一些特定的文件),/path 參數(shù)可以接收多個(gè)路徑,使用* 分割。
TortoiseSVN 使用臨時(shí)文件在 shell 擴(kuò)展和主程序之間傳遞多個(gè)參數(shù)。從 TortoiseSVN 1.5.0 開(kāi)始,廢棄/notempfile 參數(shù),不再需要增加此參數(shù)。
The progress dialog which is used for commits, updates and many more commands usually stays open after the command has finished until the user presses theOK button. This can be changed by checking the corresponding option in the settings dialog. But using that setting will close the progress dialog, no matter if you start the command from your batch file or from the TortoiseSVN context menu.
To specify a different location of the configuration file, use the parameter /configdir:"path\to\config\directory" . This will override the default path, including any registry setting.
如果想在進(jìn)度對(duì)話框執(zhí)行完畢后自動(dòng)關(guān)閉,而又不必設(shè)置永久性的參數(shù),可以傳遞/closeonend 參數(shù)。
-
/closeonend:0 不自動(dòng)關(guān)閉對(duì)話框
-
/closeonend:1 如果沒(méi)發(fā)生錯(cuò)誤則自動(dòng)關(guān)閉對(duì)話框
-
/closeonend:2 如果沒(méi)發(fā)生錯(cuò)誤和沖突則自動(dòng)關(guān)閉對(duì)話框
-
/closeonend:3 如果沒(méi)有錯(cuò)誤、沖突和合并,會(huì)自動(dòng)關(guān)閉
-
/closeonend:4 如果沒(méi)有錯(cuò)誤、沖突和合并,會(huì)自動(dòng)關(guān)閉
下面的列表列出了所有可以使用TortoiseProc.exe訪問(wèn)的命令,就像上面的描述,必須使用/command:abcd 的形式,在列表中,因?yàn)楣?jié)省空間的關(guān)系省略了/command 的前綴。
表 D.1. 有效命令及選項(xiàng)列表
命令 | 描述 |
:about |
顯示關(guān)于對(duì)話框。如果沒(méi)有給命令也會(huì)顯示。 |
:log |
打開(kāi)日志對(duì)話框,/path 指定了顯示日志的文件或目錄,另外還有三個(gè)選項(xiàng)可以設(shè)置: /startrev:xxx 、/endrev:xxx 和/strict |
:checkout |
打開(kāi)檢出對(duì)話框,/path 指定了目標(biāo)路徑,而/url 制定了檢出的URL。 |
:import |
打開(kāi)導(dǎo)入對(duì)話框,/path 指定了數(shù)據(jù)導(dǎo)入路徑。 |
:update |
將工作副本的/path 更新到HEAD,如果給定參數(shù)/rev ,就會(huì)彈出一個(gè)對(duì)話框詢問(wèn)用戶需要更新到哪個(gè)修訂版本。為了防止指定修訂版本號(hào)/rev:1234 的對(duì)話框,需要選項(xiàng)/nonrecursive 和/ignoreexternals 。 |
:commit |
打開(kāi)提交對(duì)話框,/path 指定了目標(biāo)路徑或需要提交的文件列表,你也可以使用參數(shù) /logmsg 給提交窗口傳遞預(yù)定義的日志信息,或者你不希望將日志傳遞給命令行,你也可以使用/logmsgfile:path ,path 指向了保存日志信息的文件。為了預(yù)先填入bug的ID(如果你設(shè)置了集成bug追蹤屬性),你可以使用/bugid:"the bug id here" 完成這個(gè)任務(wù)。 |
:add |
將/path 的文件添加到版本控制 。 |
:revert |
恢復(fù)工作副本的本地修改,/path 說(shuō)明恢復(fù)哪些條目。 |
:cleanup |
清理中斷和終止的操作,將工作副本的/path 解鎖。 |
:resolve |
將/path 指定文件的沖突標(biāo)示為解決,如果給定/noquestion ,解決不會(huì)向用戶確認(rèn)操作。 |
:repocreate |
在/path 創(chuàng)建一個(gè)版本庫(kù)。 |
:switch |
打開(kāi)選項(xiàng)對(duì)話框。/path 指定目標(biāo)目錄。 |
:export |
將/path 的工作副本導(dǎo)出到另一個(gè)目錄,如果/path 指向另一個(gè)未版本控制目錄,對(duì)話框會(huì)詢問(wèn)要導(dǎo)出到/path 的URL。 |
:merge |
Opens the merge dialog. The /path specifies the target directory. For merging a revision range, the following options are available: /fromurl:URL , /revrange:string . For merging two repository trees, the following options are available: /fromurl:URL , /tourl:URL , /fromrev:xxx and /torev:xxx . These pre-fill the relevant fields in the merge dialog. |
:mergeall |
Opens the merge all dialog. The /path specifies the target directory. |
:copy |
Brings up the branch/tag dialog. The /path is the working copy to branch/tag from. And the /url is the target URL. You can also specify the /logmsg switch to pass a predefined log message to the branch/tag dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:path , where path points to a file containing the log message. |
:settings |
打開(kāi)設(shè)置對(duì)話框。 |
:remove |
從版本控制里移除/path 中的文件。 |
:rename |
重命名/path 的文件,會(huì)在對(duì)話框中詢問(wèn)新文件,為了防止一個(gè)步驟中詢問(wèn)相似文件,傳遞/noquestion 。 |
:diff |
Starts the external diff program specified in the TortoiseSVN settings. The /path specifies the first file. If the option /path2 is set, then the diff program is started with those two files. If /path2 is omitted, then the diff is done between the file in /path and its BASE. To explicitly set the revision numbers use /startrev:xxx and /endrev:xxx . If/blame is set and /path2 is not set, then the diff is done by first blaming the files with the given revisions. |
:showcompare |
Depending on the URLs and revisions to compare, this either shows a unified diff (if the option unified is set), a dialog with a list of files that have changed or if the URLs point to files starts the diff viewer for those two files.
The options url1 , url2 , revision1 and revision2 must be specified. The options pegrevision , ignoreancestry , blame and unified are optional.
|
:conflicteditor |
Starts the conflict editor specified in the TortoiseSVN settings with the correct files for the conflicted file in /path . |
:relocate |
打開(kāi)重定位對(duì)話框,/path 指定了重定位的工作副本路徑。 |
:help |
打開(kāi)幫助文件 |
:repostatus |
打開(kāi)為修改檢出對(duì)話框,/path 指定了工作副本目錄。 |
:repobrowser |
Starts the repository browser dialog, pointing to the URL of the working copy given in /path or /path points directly to an URL. An additional option /rev:xxx can be used to specify the revision which the repository browser should show. If the /rev:xxx is omitted, it defaults to HEAD. If /path points to an URL, the /projectpropertiespath:path/to/wc specifies the path from where to read and use the project properties. |
:ignore |
將/path 中的對(duì)象加入到忽略列表,也就是將這些文件添加到 svn:ignore 屬性。 |
:blame |
為 /path 選項(xiàng)指定的文件打開(kāi)追溯對(duì)話框。
如果設(shè)置了 /startrev 和 /endrev 選項(xiàng),不會(huì)顯示詢問(wèn)追溯范圍對(duì)話框,直接使用這些選項(xiàng)中的版本號(hào)。
如果設(shè)置了 /line:nnn 選項(xiàng),TortoiseBlame 會(huì)顯示指定行數(shù)。
也支持 /ignoreeol ,/ignorespaces 和 /ignoreallspaces 選項(xiàng)。
|
:cat |
將/path 指定的工作副本或URL的文件保存到/savepath:path ,修訂版本號(hào)在/revision:xxx ,這樣可以得到特定修訂版本的文件。 |
:createpatch |
創(chuàng)建/path 下的補(bǔ)丁文件。 |
:revisiongraph |
顯示/path 目錄下的版本變化圖。 |
:lock |
Locks a file or all files in a directory given in /path . The 'lock' dialog is shown so the user can enter a comment for the lock. |
:unlock |
Unlocks a file or all files in a directory given in /path . |
:rebuildiconcache |
Rebuilds the windows icon cache. Only use this in case the windows icons are corrupted. A side effect of this (which can't be avoided) is that the icons on the desktop get rearranged. To suppress the message box, pass /noquestion . |
:properties |
顯示 /path 給出的路徑之屬性對(duì)話框。 |
Examples (which should be entered on one line):
TortoiseProc.exe /command:commit
/path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
/logmsg:"test log message" /closeonend:0
TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0
TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
/startrev:50 /endrev:60 /closeonend:0
From:http:///docs/release/TortoiseSVN_zh_CN/tsvn-automation.html
|