`

TortoiseSVN Commands

阅读更多

这里只列出来英文版的,摘自:http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html

这有个中文版的地址:http://tony.san.blog.163.com/blog/static/92936752201023093842512/

 

 

Since all commands for TortoiseSVN are controlled through command line parameters, you can automate it with batch scripts or start specific commands and dialogs from other programs (e.g. your favourite text editor).

Important

Remember that TortoiseSVN is a GUI client, and this automation guide shows you how to make the TortoiseSVN dialogs appear to collect user input. If you want to write a script which requires no input, you should use the official Subversion command line client instead.

TortoiseSVN Commands

The TortoiseSVN GUI program is called TortoiseProc.exe. All commands are specified with the parameter /command:abcd where abcd is the required command name. Most of these commands need at least one path argument, which is given with /path:"some\path". In the following table the command refers to the /command:abcd parameter and the path refers to the /path:"some\path" parameter.

Since some of the commands can take a list of target paths (e.g. committing several specific files) the /path parameter can take several paths, separated by a * character.

You can also specify a file which contains a list of paths, separated by newlines. The file must be in UTF-16 format, without a BOM. If you pass such a file, use /pathfile instead of /path. To have TortoiseProc delete that file after the command is finished, you can pass the parameter /deletepathfile.

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 the OK 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.

To close the progress dialog at the end of a command automatically without using the permanent setting you can pass the /closeonendparameter.

  • /closeonend:0 don't close the dialog automatically

  • /closeonend:1 auto close if no errors

  • /closeonend:2 auto close if no errors and conflicts

  • /closeonend:3 auto close if no errors, conflicts and merges

To close the progress dialog for local operations if there were no errors or conflicts, pass the /closeforlocal parameter.

The table below lists all the commands which can be accessed using the TortoiseProc.exe command line. As described above, these should be used in the form /command:abcd. In the table, the /command prefix is omitted to save space.

 

Table D.1. List of available commands and options

Command Description
:about Shows the about dialog. This is also shown if no command is given.
:log Opens the log dialog. The /path specifies the file or folder for which the log should be shown. Additional options can be set: /startrev:xxx,/endrev:xxx/strict enables the 'stop-on-copy' checkbox, /merge enables the 'include merged revisions' checkbox, /findstring:"filterstring" fills in the filter text, /findtext forces the filter to use text, not regex, or /findregex forces the filter to use regex, not simple text search, and/findtype:X with X being a number between 0 and 511. The numbers are the sum of the following options:
  • /findtype:0 filter by everything

  • /findtype:1 filter by messages

  • /findtype:2 filter by path

  • /findtype:4 filter by authors

  • /findtype:8 filter by revisions

  • /findtype:16 not used

  • /findtype:32 filter by bug ID

  • /findtype:64 not used

  • /findtype:128 filter by date

  • /findtype:256 filter by date range

If /outfile:path\to\file is specified, the selected revisions are written to that file when the log dialog is closed. The revisions are written in the same format as is used to specify revisions in the merge dialog.
:checkout Opens the checkout dialog. The /path specifies the target directory and the /url specifies the URL to checkout from. If you specify the key/blockpathadjustments, the automatic checkout path adjustments are blocked. The /revision:XXX specifies the revision to check out.
:import Opens the import dialog. The /path specifies the directory with the data to import. You can also specify the /logmsg switch to pass a predefined log message to the import 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.
:update Updates the working copy in /path to HEAD. If the option /rev is given then a dialog is shown to ask the user to which revision the update should go. To avoid the dialog specify a revision number /rev:1234. Other options are /nonrecursive/ignoreexternals and /includeexternals. The/stickydepth indicates that the specified depth should be sticky, creating a sparse checkout. The /skipprechecks can be set to skip all checks that are done before an update. If this is specified, then the Show log button is disabled, and the context menu to show diffs is also disabled after the update.
:commit Opens the commit dialog. The /path specifies the target directory or the list of files to commit. You can also specify the /logmsg switch to pass a predefined log message to the commit 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. To pre-fill the bug ID box (in case you've set up integration with bug trackers properly), you can use the /bugid:"the bug id here" to do that.
:add Adds the files in /path to version control.
:revert Reverts local modifications of a working copy. The /path tells which items to revert.
:cleanup Cleans up interrupted or aborted operations and unlocks the working copy in /path. Use /noui to prevent the result dialog from popping up (either telling about the cleanup being finished or showing an error message). /noprogressui also disables the progress dialog. /nodlg disables showing the cleanup dialog where the user can choose what exactly should be done in the cleanup. The available actions can be specified with the options /cleanup for status cleanup, /revert/delunversioned/delignored/refreshshell and /externals.
:resolve Marks a conflicted file specified in /path as resolved. If /noquestion is given, then resolving is done without asking the user first if it really should be done.
:repocreate Creates a repository in /path
:switch Opens the switch dialog. The /path specifies the target directory and /url the URL to switch to.
:export Exports the working copy in /path to another directory. If the /path points to an unversioned directory, a dialog will ask for an URL to export to the directory in /path. If you specify the key /blockpathadjustments, the automatic export path adjustments are blocked.
:dropexport Exports the working copy in /path to the directory specified in /droptarget. This exporting does not use the export dialog but executes directly. The option /overwrite specifies that existing files are overwritten without user confirmation, and the option /autorename specifies that if files already exist, the exported files get automatically renamed to avoid overwriting them. The option /extended can specify eitherlocalchanges to only export files that got changed locally, or unversioned to also export all unversioned items as well.
:dropvendor Copies the folder in /path recursively to the directory specified in /droptarget. New files are added automatically, and missing files get removed in the target working copy, basically ensuring that source and destination are exactly the same.
: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. For doing a reintegrate merge, use the following options: /fromurl:URL and /reintegrate. 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. To already check the option Switch working copy to new branch/tag you can pass the /switchaftercopy switch. 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 pathpoints to a file containing the log message.
:settings Opens the settings dialog.
:remove Removes the file(s) in /path from version control.
:rename Renames the file in /path. The new name for the file is asked with a dialog. To avoid the question about renaming similar files in one step, pass /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, and for the optional peg revision use /pegrevision:xxx. If /blame is set and /path2 is not set, then the diff is done by first blaming the files with the given revisions. The parameter /line:xxx specifies the line to jump to when the diff is shown.
: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 url1url2revision1 and revision2 must be specified. The options pegrevisionignoreancestryblame 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 Opens the relocate dialog. The /path specifies the working copy path to relocate.
:help Opens the help file.
:repostatus Opens the check-for-modifications dialog. The /path specifies the working copy directory. If /remote is specified, the dialog contacts the repository immediately on startup, as if the user clicked on the Check repository button.
: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.

If /outfile:path\to\file is specified, the selected URL and revision are written to that file when the repository browser is closed. The first line in that text file contains the URL, the second line the revision in text format.

:ignore Adds all targets in /path to the ignore list, i.e. adds the svn:ignore property to those files.
:blame

Opens the blame dialog for the file specified in /path.

If the options /startrev and /endrev are set, then the dialog asking for the blame range is not shown but the revision values of those options are used instead.

If the option /line:nnn is set, TortoiseBlame will open with the specified line number showing.

The options /ignoreeol/ignorespaces and /ignoreallspaces are also supported.

:cat Saves a file from an URL or working copy path given in /path to the location given in /savepath:path. The revision is given in /revision:xxx. This can be used to get a file with a specific revision.
:createpatch Creates a patch file for the path given in /path. To skip the file Save-As dialog you can pass /savepath:path to specify the path where to save the patch file to directly. To prevent the unified diff viewer from being started showing the patch file, pass /noview.
:revisiongraph

Shows the revision graph for the path given in /path.

To create an image file of the revision graph for a specific path, but without showing the graph window, pass /output:path with the path to the output file. The output file must have an extension that the revision graph can actually export to. These are: .svg.wmf.png.jpg.bmpand .gif.

Since the revision graph has many options that affect how it is shown, you can also set the options to use when creating the output image file. Pass these options with /options:XXXX, where XXXX is a decimal value. The best way to find the required options is to start the revision graph the usual way, set all user-interface options and close the graph. Then the options you need to pass on the command line can be read from the registry HKCU\Software\TortoiseSVN\RevisionGraphOptions.

: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

Shows the properties dialog for the path given in /path.

For dealing with versioned properties this command requires a working copy.

Revision properties can be viewed/changed if /path is an URL and /rev:XXX is specified.

To open the properties dialog directly for a specific property, pass the property name as /property:name.

 

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
分享到:
评论

相关推荐

    svn TortoiseSVN 1.14.5 (64-bit)

    svn TortoiseSVN 1.14.5 (64-bit) svn客户端svn TortoiseSVN 1.14.5 (64-bit) svn客户端svn TortoiseSVN 1.14.5 (64-bit) svn客户端svn TortoiseSVN 1.14.5 (64-bit) svn客户端svn TortoiseSVN 1.14.5 (64-bit) svn...

    TortoiseSVN-1.14.5中文使用手册

    TortoiseSVN中文使用手册知识点总结 TortoiseSVN是一款功能强大的Subversion客户端工具,专门为Windows平台设计。下面是TortoiseSVN中文使用手册中的知识点总结: 什么是TortoiseSVN? TortoiseSVN是一个基于...

    TortoiseSVN 1.9.7 中文汉化语言包

    《TortoiseSVN 1.9.7 中文汉化语言包详解及应用》 TortoiseSVN是一款在Windows环境下广泛使用的Subversion(SVN)版本控制系统客户端,其强大的功能和友好的用户界面使其成为开发者和团队协作的理想工具。1.9.7版本...

    TortoiseSVN 1.8.12中文版

    《TortoiseSVN 1.8.12中文版:XP系统下的版本控制利器》 TortoiseSVN是一款广泛应用于软件开发领域的版本控制系统,它以Subversion(SVN)为核心,为用户提供图形化的界面操作,使得版本管理变得更加直观和便捷。...

    TortoiseSVN+汉化包

    TortoiseSVN是一款在Windows操作系统上非常流行的版本控制系统客户端,它基于Subversion(SVN)服务器进行工作。这个“TortoiseSVN+汉化包”包含了两个重要的安装文件,用于提供中文语言支持和TortoiseSVN的基础功能...

    TortoiseSVN-1.14.5客户端

    TortoiseSVN-1.14.5客户端是一款基于Subversion(SVN)版本控制系统,专为Windows用户设计的图形界面工具。该客户端让用户能够更直观、方便地管理源代码和其他项目文件的版本控制。在本文中,我们将深入探讨...

    TortoiseSVN-1.14.3中文版(TortoiseSVN-1.14.3-zh_CN.pdf,针对Windows 平台)

    《TortoiseSVN-1.14.3中文版》是专为Windows平台设计的Subversion客户端操作手册,由Stefan Küng、Lübbe Onken和Simon Large共同编著。该手册详尽地介绍了如何使用TortoiseSVN进行版本控制,帮助用户理解和操作这...

    TortoiseSVN 中文语言包-1.9.4

    TortoiseSVN是一款在Windows操作系统上非常流行的版本控制系统客户端,它基于Subversion(SVN)服务器进行工作。1.9.4是该软件的一个版本,这个版本包含了对中文语言的支持,使得中国用户可以更加方便地使用这款工具...

    TortoiseSVN1.14.3安装包+中文语言包

    TortoiseSVN是一款在Windows操作系统上广泛使用的版本控制系统客户端,尤其适合软件开发团队进行源代码管理和协同工作。它的最新版本是1.14.3,这个安装包包含了该版本的完整程序以及中文语言包,使得中国用户可以...

    TortoiseSVN 1.9.4 中文版

    TortoiseSVN 1.9.4 是一个流行的版本控制系统客户端,专为Subversion(SVN)设计,尤其适用于Windows用户。这个中文版确保了中国用户能够方便地使用其功能,无需面对语言障碍。TortoiseSVN以其直观的图形用户界面...

    TortoiseSVN1.9.5和中文包

    **TortoiseSVN** 是一个非常流行的版本控制系统,它是一个与Windows文件系统集成的Subversion(SVN)客户端。这个工具提供了图形化的用户界面,使得在Windows环境下使用SVN进行版本控制变得更加直观和便捷。...

    TortoiseSVN

    TortoiseSVN是一款强大的版本控制系统客户端,专为Subversion(SVN)设计,用于Windows操作系统。它将SVN的功能深度集成到文件资源管理器中,使得用户可以在熟悉的环境中进行版本控制操作,大大提升了工作效率。 ...

    TortoiseSVN升级后右键菜单没有TortoiseSVN的相关选项解决方案

    《TortoiseSVN升级后右键菜单缺失修复指南》 在日常的版本控制系统使用中,TortoiseSVN作为一款强大的Subversion(SVN)客户端,因其直观的图形界面和丰富的右键菜单功能,深受开发者喜爱。然而,当TortoiseSVN进行...

    小乌龟TortoiseSVN及破解

    TortoiseSVN 破解版

    TortoiseSVN使用简介_图文

    TortoiseSVN 使用简介 本文档将详细介绍 TortoiseSVN 的使用过程,包括下载和安装、什么是 SVN、为什么要用 SVN、建立 SVN Repository、新增档案及目录、更新档案及目录、更新至特定版本、复制档案及目录、制作 Tag...

    TortoiseSVN中文.zip

    TortoiseSVN是一款在Windows操作系统上非常流行的版本控制系统客户端,它与Subversion(SVN)服务器紧密结合,为用户提供了直观且易于使用的图形界面。这个“TortoiseSVN中文.zip”压缩包显然包含了该软件的中文语言...

    TortoiseSVN客户端常用命令

    TortoiseSVN 客户端常用命令 TortoiseSVN 是一个流行的 SVN 客户端工具,提供了许多实用的命令来管理版本控制。下面我们将详细介绍 TortoiseSVN 客户端常用命令。 一、安装 TortoiseSVN 首先,我们需要下载并安装...

    TortoiseSVN适合64位的win7

    《TortoiseSVN在64位Windows 7系统中的应用》 TortoiseSVN是一款广受欢迎的Subversion(SVN)版本控制系统客户端,专为Windows用户设计。在64位的Windows 7操作系统环境下,TortoiseSVN提供了一个高效、直观的界面...

Global site tag (gtag.js) - Google Analytics