天天看點

TortoiseSVN 指令 (指令行執行工具)

TortoiseSVN是一個GUI用戶端,這個自動化指導為你展示了讓TortoiseSVN對話框顯示并收集客戶輸入,如果你希望編寫不需要輸入的腳本,你應該使用官方的Subversion指令行用戶端。

TortoiseSVN的GUI程式叫做<code>TortoiseProc.exe</code>。所有的指令通過參數<code>/command:xxxx</code>指定,其中<code>xxxx</code>是必須的指令名。大多數此類指令至少需要一個路徑參數,使用<code>/path:"some\path"</code>指定。在下面的指令表格中,指令引用的是<code>/command:xxxx</code>參數,餘下的代表了<code>/path:"some\path"</code>參數。

因為一些指令需要一個目标路徑的清單(例如送出一些特定的檔案),<code>/path</code>參數可以接收多個路徑,使用<code>*</code>分割。

TortoiseSVN 使用臨時檔案在 shell 擴充和主程式之間傳遞多個參數。從 TortoiseSVN 1.5.0 開始,廢棄<code>/notempfile</code>參數,不再需要增加此參數。

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 <code>/configdir:"path\to\config\directory"</code>. This will override the default path, including any registry setting.

如果想在進度對話框執行完畢後自動關閉,而又不必設定永久性的參數,可以傳遞<code>/closeonend</code>參數。

<code>/closeonend:0</code> 不自動關閉對話框

<code>/closeonend:1</code> 如果沒發生錯誤則自動關閉對話框

<code>/closeonend:2</code> 如果沒發生錯誤和沖突則自動關閉對話框

<code>/closeonend:3</code>如果沒有錯誤、沖突和合并,會自動關閉

<code>/closeonend:4</code>如果沒有錯誤、沖突和合并,會自動關閉

下面的清單列出了所有可以使用TortoiseProc.exe通路的指令,就像上面的描述,必須使用<code>/command:xxxxxx</code>的形式,在清單中,因為節省空間的關系省略了<code>/command</code>的字首。

<a></a>

表 D.1. 有效指令及選項清單

指令

描述

:about

顯示關于對話框。如果沒有給指令也會顯示。

:log

打開日志對話框,<code>/path</code> 指定了顯示日志的檔案或目錄,另外還有三個選項可以設定: <code>/startrev:xxx</code>、<code>/endrev:xxx</code>和<code>/strict</code>

:checkout

打開檢出對話框,<code>/path</code>指定了目标路徑,而<code>/url</code>制定了檢出的URL。

:import

打開導入對話框,<code>/path</code> 指定了資料導入路徑。

:update

将工作副本的<code>/path</code>更新到HEAD,如果給定參數<code>/rev</code>,就會彈出一個對話框詢問使用者需要更新到哪個修訂版本。為了防止指定修訂版本号<code>/rev:1234</code>的對話框,需要選項<code>/nonrecursive</code>和<code>/ignoreexternals</code>。

:commit

打開送出對話框,<code>/path</code> 指定了目标路徑或需要送出的檔案清單,你也可以使用參數 <code>/logmsg</code> 給送出視窗傳遞預定義的日志資訊,或者你不希望将日志傳遞給指令行,你也可以使用<code>/logmsgfile:path</code>,<code>path</code> 指向了儲存日志資訊的檔案。為了預先填入bug的ID(如果你設定了內建bug追蹤屬性),你可以使用<code>/bugid:"the bug id here"</code>完成這個任務。

:add

将<code>/path</code>的檔案添加到版本控制 。

:revert

恢複工作副本的本地修改,<code>/path</code>說明恢複哪些條目。

:cleanup

清理中斷和終止的操作,将工作副本的<code>/path</code>解鎖。

:resolve

将<code>/path</code>指定檔案的沖突标示為解決,如果給定<code>/noquestion</code>,解決不會向使用者确認操作。

:repocreate

在<code>/path</code>建立一個版本庫。

:switch

打開選項對話框。<code>/path</code> 指定目标目錄。

:export

将<code>/path</code>的工作副本導出到另一個目錄,如果<code>/path</code>指向另一個未版本控制目錄,對話框會詢問要導出到<code>/path</code>的URL。

:merge

Opens the merge dialog. The <code>/path</code> specifies the target directory. For merging a revision range, the following options are available: <code>/fromurl:URL</code>, <code>/revrange:string</code>. For merging two repository trees, the following options are available: <code>/fromurl:URL</code>, <code>/tourl:URL</code>, <code>/fromrev:xxx</code> and <code>/torev:xxx</code>. These pre-fill the relevant fields in the merge dialog.

:mergeall

Opens the merge all dialog. The <code>/path</code> specifies the target directory.

:copy

Brings up the branch/tag dialog. The <code>/path</code> is the working copy to branch/tag from. And the <code>/url</code> is the target URL. You can also specify the <code>/logmsg</code> 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 <code>/logmsgfile:path</code>, where <code>path</code> points to a file containing the log message.

:settings

打開設定對話框。

:remove

從版本控制裡移除<code>/path</code>中的檔案。

:rename

重命名<code>/path</code>的檔案,會在對話框中詢問新檔案,為了防止一個步驟中詢問相似檔案,傳遞<code>/noquestion</code>。

:diff

Starts the external diff program specified in the TortoiseSVN settings. The <code>/path</code> specifies the first file. If the option <code>/path2</code> is set, then the diff program is started with those two files. If <code>/path2</code> is omitted, then the diff is done between the file in <code>/path</code> and its BASE. To explicitly set the revision numbers use <code>/startrev:xxx</code> and <code>/endrev:xxx</code>. If<code>/blame</code> is set and <code>/path2</code> 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 <code>unified</code> 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 <code>url1</code>, <code>url2</code>, <code>revision1</code> and <code>revision2</code> must be specified. The options <code>pegrevision</code>, <code>ignoreancestry</code>, <code>blame</code> and <code>unified</code> are optional.

:conflicteditor

Starts the conflict editor specified in the TortoiseSVN settings with the correct files for the conflicted file in <code>/path</code>.

:relocate

打開重定位對話框,<code>/path</code>指定了重定位的工作副本路徑。

:help

打開幫助檔案

:repostatus

打開為修改檢出對話框,<code>/path</code> 指定了工作副本目錄。

:repobrowser

Starts the repository browser dialog, pointing to the URL of the working copy given in <code>/path</code> or <code>/path</code> points directly to an URL. An additional option <code>/rev:xxx</code> can be used to specify the revision which the repository browser should show. If the <code>/rev:xxx</code> is omitted, it defaults to HEAD. If <code>/path</code> points to an URL, the <code>/projectpropertiespath:path/to/wc</code>specifies the path from where to read and use the project properties.

:ignore

将<code>/path</code>中的對象加入到忽略清單,也就是将這些檔案添加到 <code>svn:ignore</code> 屬性。

:blame

為 <code>/path</code> 選項指定的檔案打開追溯對話框。

如果設定了 <code>/startrev</code> 和 <code>/endrev</code> 選項,不會顯示詢問追溯範圍對話框,直接使用這些選項中的版本号。

如果設定了 <code>/line:nnn</code> 選項,TortoiseBlame 會顯示指定行數。

也支援 <code>/ignoreeol</code>,<code>/ignorespaces</code> 和 <code>/ignoreallspaces</code> 選項。

:cat

将<code>/path</code>指定的工作副本或URL的檔案儲存到<code>/savepath:path</code>,修訂版本号在<code>/revision:xxx</code>,這樣可以得到特定修訂版本的檔案。

:createpatch

建立<code>/path</code>下的更新檔檔案。

:revisiongraph

顯示<code>/path</code>目錄下的版本變化圖。

:lock

Locks a file or all files in a directory given in <code>/path</code>. 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 <code>/path</code>.

: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 <code>/noquestion</code>.

:properties

顯示 <code>/path</code> 給出的路徑之屬性對話框。

Examples (which should be entered on one line):

本文轉自 netcorner 部落格園部落格,原文連結: http://www.cnblogs.com/netcorner/p/5034006.html  ,如需轉載請自行聯系原作者

繼續閱讀