`

TortoiseSVN 命令 (命令行执行工具)

 
阅读更多

TortoiseSVN是一个GUI客户端,这个自动化指导为你展示了让TortoiseSVN对话框显示并收集客户输入,如果你希望编写不需要输入的脚本,你应该使用官方的Subversion命令行客户端。

TortoiseSVN的GUI程序叫做TortoiseProc.exe。所有的命令通过参数/command:abcd指定,其中abcd是必须的命令名。大多数此类命令至少需要一个路径参数,使用/path:"some\path"指定。在下面的命令表格中,命令引用的是/command:abcd参数,余下的代表了/path:"some\path"参数。

因为一些命令需要一个目标路径的列表(例如提交一些特定的文件),/path参数可以接收多个路径,使用*分割。

TortoiseSVN 使用临时文件在 shell 扩展和主程序之间传递多个参数。从 TortoiseSVN 1.5.0 开始,废弃/notempfile参数,不再需要增加此参数。

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.

如果想在进度对话框执行完毕后自动关闭,而又不必设置永久性的参数,可以传递/closeonend参数。

  • /closeonend:0 不自动关闭对话框

  • /closeonend:1 如果没发生错误则自动关闭对话框

  • /closeonend:2 如果没发生错误和冲突则自动关闭对话框

  • /closeonend:3如果没有错误、冲突和合并,会自动关闭

  • /closeonend:4如果没有错误、冲突和合并,会自动关闭

下面的列表列出了所有可以使用TortoiseProc.exe访问的命令,就像上面的描述,必须使用/command:abcd的形式,在列表中,因为节省空间的关系省略了/command的前缀。

表 D.1. 有效命令及选项列表

命令 描述
:about 显示关于对话框。如果没有给命令也会显示。
:log 打开日志对话框,/path 指定了显示日志的文件或目录,另外还有三个选项可以设置: /startrev:xxx/endrev:xxx/strict
:checkout 打开检出对话框,/path指定了目标路径,而/url制定了检出的URL。
:import 打开导入对话框,/path 指定了数据导入路径。
:update 将工作副本的/path更新到HEAD,如果给定参数/rev,就会弹出一个对话框询问用户需要更新到哪个修订版本。为了防止指定修订版本号/rev:1234的对话框,需要选项/nonrecursive/ignoreexternals
:commit 打开提交对话框,/path 指定了目标路径或需要提交的文件列表,你也可以使用参数 /logmsg 给提交窗口传递预定义的日志信息,或者你不希望将日志传递给命令行,你也可以使用/logmsgfile:pathpath 指向了保存日志信息的文件。为了预先填入bug的ID(如果你设置了集成bug追踪属性),你可以使用/bugid:"the bug id here"完成这个任务。
:add /path的文件添加到版本控制 。
:revert 恢复工作副本的本地修改,/path说明恢复哪些条目。
:cleanup 清理中断和终止的操作,将工作副本的/path解锁。
:resolve /path指定文件的冲突标示为解决,如果给定/noquestion,解决不会向用户确认操作。
:repocreate /path创建一个版本库。
:switch 打开选项对话框。/path 指定目标目录。
:export /path的工作副本导出到另一个目录,如果/path指向另一个未版本控制目录,对话框会询问要导出到/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 打开设置对话框。
:remove 从版本控制里移除/path中的文件。
:rename 重命名/path的文件,会在对话框中询问新文件,为了防止一个步骤中询问相似文件,传递/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 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 打开重定位对话框,/path指定了重定位的工作副本路径。
:help 打开帮助文件
:repostatus 打开为修改检出对话框,/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/wcspecifies the path from where to read and use the project properties.
:ignore /path中的对象加入到忽略列表,也就是将这些文件添加到 svn:ignore 属性。
:blame

为 /path 选项指定的文件打开追溯对话框。

如果设置了 /startrev 和 /endrev 选项,不会显示询问追溯范围对话框,直接使用这些选项中的版本号。

如果设置了 /line:nnn 选项,TortoiseBlame 会显示指定行数。

也支持 /ignoreeol/ignorespaces 和 /ignoreallspaces 选项。

:cat /path指定的工作副本或URL的文件保存到/savepath:path,修订版本号在/revision:xxx,这样可以得到特定修订版本的文件。
:createpatch 创建/path下的补丁文件。
: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 给出的路径之属性对话框。


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://tortoisesvn.net/docs/release/TortoiseSVN_zh_CN/tsvn-automation.html
<script type="text/javascript"></script>
分享到:
评论

相关推荐

    TortoiseSVN客户端常用命令

    TortoiseSVN客户端常用命令

    基于TortoiseSVN的版本控制工具(与Delphi I

    TortoiseSVN2IDE最初来源于DelphiAddinForTortoiseSVN,这是一个把TortoiseSVN集成到Delphi IDE环境中的一个小工具,但博主嫌它是个英文软件且名字又不直观,于是就对它按照TortoiseSVN的官方中文包进行了中文化并...

    TortoiseSVN客户端服务器+汉化工具64位

    TortoiseSVN1.9.1的安装工具以及安装方法 。还有汉化工具。一套 白痴教程

    集成redmine和TortoiseSVN的一个工具插件

    集成redmine和TortoiseSVN的一个工具插件。

    TortoiseSVN客户端程序

    然后在 repos1 文件夹上“右键-&gt;TortoiseSVN-&gt;Create Repository here...”,然后可以选择版本库模式,这里使用默认的FSFS即可,然后就创建了一系列文件夹和文件,同命令行建立的一样。 四、运行独立服务器 此时 ...

    TortoiseSVN 密码找回工具,简单实用

    本机的TortoiseSVN 密码忘记了,想要重装系统苦于密码忘记。 用此工具,轻松显示本机TortoiseSVN 密码。

    TortoiseSVN+比较工具

    TortoiseSVN+语言包+比较工具

    版本控制工具(TortoiseSVN)

    版本控制工具(TortoiseSVN)

    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.8.7.25475-x64-svn-1.8.9-2 尚硅谷封捷SVN课程

    TortoiseSVN版本管理工具课程,包含服务端及客户端搭建。版本控制,使用命令行模式访问SVN服务器。单一版本库权限控制。多版本共享配置。在eclipse中安装svn客户端插件。TortoiseSVN的简介及优良特性。TortoiseSVN的...

    svn密码查看工具TortoiseSVN Password Decrypter

    有时候svn密码被重置了或者忘记了,可以用这个小工具查看。直接解压运行,即可查看当前svn密码信息,很方便。

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

    目录 前言 1. 什么是 TortoiseSVN? 2. TortoiseSVN 的特性 3. 许可协议 4. 开发 5. 阅读指南 6. 本文使用的术语 ... 命令行交叉索引 ... F. 实现细节 ... G. 语言包和拼写检查器 ... 术语表 ... 索引 ...

    TortoiseSVN

     CVS 只能追踪单个文件的历史,但是 Subversion 实现了一个“虚拟”文件系统,可以追踪整个目录树的修改,文件和目录都是版本控制的,结果就是可以在客户端对文件和目录执行移动和复制命令。  原子提交  提交要么...

    TortoiseSVN1.6.17-32位

    TortoiseSVN 是一个 Subversion 客户端,我们也很愿意为你展示一些 Subversion 本身的特性: 目录版本控制 CVS 只能追踪单个文件的历史,但是 Subversion 实现了一个“虚拟”文件系统,可以追踪整个目录树的修改,...

    svn工具64(TortoiseSVN-1.8.4.24972-1.8.5 Slik-Subversion-1.8.5)

    svn客户端工具(小乌龟) TortoiseSVN-1.8.4.24972-x64-svn-1.8.5.msi 命令行工具 Slik-Subversion-1.8.5-x64.msi 环境变量配置 有问题的童鞋可以留言,大家共同学习!

    TortoiseSVN 1.9.7 中文汉化语言包

    【TortoiseSVN 1.9.7 中文汉化语言包】。先安装TortoiseSVN,然后安装语言包,之后在TortoiseSVN设置中选择简体中文即可。

    TortoiseSVN v1.12.0.zip

    TortoiseSVN与Windows外壳(例如资源管理器)无缝集成,你可以保持在熟悉的工具上工作,不需要在每次使用版本控制功能时切换应用程序。 2、重载图标 每个版本控制的文件和目录的状态使用小的重载图标表示,可以让你...

    配置管理工具TortoiseSVN

    你是否在一个团队中工作? 是否发生过这样的情况: 当你在修改一个文件时,其他人也在修改这个文件?而你是否因此丢失过自己所作的修改...如果这些问题中的任何一个回答“是”的话,那么 TortoiseSVN 就是为你准备的!

    小乌龟TortoiseSVN及破解

    TortoiseSVN 破解版

Global site tag (gtag.js) - Google Analytics