TortoiseSVN是一个GUI客户端,这个自动化指导为你展示了让TortoiseSVN对话框显示并收集客户输入,如果你希望编写不需要输入的脚本,你应该使用官方的Subversion命令行客户端。
TortoiseSVN的GUI程序叫做TortoiseProc.exe
。所有的命令通过参数/command:asdf
指定,其中asdf
是必须的命令名(命令名详见”表 1. 有效命令及选项列表“)。大多数此类命令至少需要一个路径参数,使用/path:"some\path"
指定。在下面的命令表格中,命令引用的是/command:asdf
参数,余下的代表了/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
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
如果没有错误、冲突和合并,会自动关闭
下面的列表列出了所有可以使用TortoiseProc.exe访问的命令,就像上面的描述,必须使用/command:asdf
的形式,在列表中,因为节省空间的关系省略了/command
的前缀。
表 1. 有效命令及选项列表
命令 | 描述 |
:about | 显示关于对话框。如果没有给命令也会显示。 |
:log | 打开日志对话框, |
:checkout | 打开检出对话框, |
:import | 打开导入对话框, |
:update | 将工作副本的 |
:commit | 打开提交对话框, |
:add | 将 |
:revert | 恢复工作副本的本地修改, |
:cleanup | 清理中断和终止的操作,将工作副本的 |
:resolve | 将 |
:repocreate | 在 |
:switch | 打开选项对话框。 |
:export | 将 |
:merge | Opens the merge dialog. The |
:mergeall | Opens the merge all dialog. The |
:copy | Brings up the branch/tag dialog. The |
:settings | 打开设置对话框。 |
:remove | 从版本控制里移除 |
:rename | 重命名 |
:diff | Starts the external diff program specified in the TortoiseSVN settings. The |
:showcompare | Depending on the URLs and revisions to compare, this either shows a unified diff (if the option The options |
:conflicteditor | Starts the conflict editor specified in the TortoiseSVN settings with the correct files for the conflicted file in |
:relocate | 打开重定位对话框, |
:help | 打开帮助文件 |
:repostatus | 打开为修改检出对话框, |
:repobrowser | Starts the repository browser dialog, pointing to the URL of the working copy given in |
:ignore | 将 |
:blame | 为 如果设置了 如果设置了 也支持 |
:cat | 将 |
:createpatch | 创建 |
:revisiongraph | 显示 |
:lock | Locks a file or all files in a directory given in |
:unlock | Unlocks a file or all files in a directory given in |
: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 |
:properties | 显示 |
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