TortoiseSVN的设置

想知道不同的设置是干什么用的,你只需将鼠标指针在编辑框/选项框上停留一秒钟...一个帮助提示气泡就会弹出来。

常规设置

图 5.50. 设置对话框,常规设置页面

设置对话框,常规设置页面


这个对话框允许你指定自己喜欢的语言,同时也可做那些与Subversion相关的特殊设置。

语言

选择你TSVN的用户界面语言。不然你还期望从这里得到啥别的?

每周自动检查新版本

如果检查过,TSVN将每周联系它的下载站点一次,来看看程序是否有个可用的新版本。若你想马上得到结果,使用 立即检查 按钮。无论如何,新版本不会被自动下载,而只是你将收到一条提示信息对话框,告诉你有新版本可用。

系统声音

TSVN已经默认安装了三个自定义声音。

  • 错误

  • 提示

  • 警告

你可以使用Windows控制面板中的声音属性,来选择不同的声音(或是把这些声音完全关掉)。配置 按钮是一个打开控制面板声音属性的快捷方式。

全局忽略样式

全局忽略模式被用来防止非版本控制的文件在例如提交时的对话框中被列出来。那些符合模式的文件,在执行导入操作时同样被忽略。通过在模式框中输入文件名或扩展名来忽略文件或文件夹。不同的模式之间以空格分隔,例如 */bin */obj *.bak *.~?? *.jar *.[Tt]mp。请记得这些模式可以用来处理含有 N 级父目录的路径。设置忽略模式并非象刚才显示的那么简单,所以请务必阅读 “忽略列表中的模式匹配”一节 以获得更多模式匹配语法信息,和如何检查路径。

值得注意的是,你在这里指定的忽略样式将同样作用于你本机上的其他Subversion客户端,包括命令行客户端。

小心

如果你象下面段落那样使用Subversion配置文件来设置一个 全局-忽略 样式,那么它将覆盖你在这里做的设置。该Subversion配置文件可以象下面段落描述的那样,通过 编辑 按钮来访问。

忽略样式将作用于你所有的项目工程。因为它是非版本控制的,所以它将不会对其他的用户起作用。相对而言,你也可以使用可版本控制的 svn:ignore 属性来把要忽略的文件或文件夹排斥在版本控制之外。阅读 “忽略文件和目录”一节 以获得更多信息。

Set file dates to the “last commit time

This option tells TortoiseSVN to set the file dates to the last commit time when doing a checkout or an update. Otherwise TortoiseSVN will use the current date. If you are developing software it is generally best to use the current date because build systems normally look at the date stamps to decide which files need compiling. If you use “last commit time” and revert to an older file revision, your project may not compile as you expect it to.

Subversion配置文件

Use Edit to edit the Subversion configuration file directly. Some settings cannot be modified directly by TortoiseSVN, and need to be set here instead. For more information about the Subversion config file see the Runtime Configuration Area. The section on Automatic Property Setting is of particular interest, and that is configured here. Note that Subversion can read configuration information from several places, and you need to know which one takes priority. Refer to Configuration and the Windows Registry to find out more.

Use _svn instead of .svn directories

在使用VS.NET环境做web工程时,将无法处理 .svn 文件夹,但Subversion是要用这些文件夹来储存自己的内部信息的。这可不是Subversion的bug,这bug是VS.NET和它使用的frontpage扩展带来的。阅读 “Subversion 的工作文件夹”一节 来获得有关此问题的更多信息。

若你想改变Subversion和TSVN的这些行为,就可以使用这个选项框来设置控制这些的环境变量。

你应该注意到: 改变该选项将不会使已存在的工作副本中的管理文件夹从“_svn”自动转换到“.svn”。你需要使用一个脚本(查看我们的FAQ)来自行完成这项工作,或是简单地重新检出一个新的工作副本。

右键菜单配置

图 5.51. 设置对话框,右键菜单页面

设置对话框,右键菜单页面


该页面允许你指定: 在TortoiseSVN的主上下文菜单中哪些条目可以直接在鼠标右键菜单显示,哪些在TortoiseSVN子菜单显示。默认情况下很多项未被勾选,只在子菜单显示。

获得锁会有一个特别的情况,你可以将其提升到顶级带但,但是大多数文件不需要锁定,这样做只是添加了混乱。然而,一个标记为svn:needs-lock属性的文件每次编辑前都需要那个操作,所以这个菜单会进入顶级菜单会比较方便。选定这个选项,会使设置svn:needs-lock属性的文件的Get Lock出现在顶级菜单中。

TSVN对话框设置一

图 5.52. 设置对话框,对话框一页面

设置对话框,对话框一页面


此对话框允许你按照喜欢的方式去配置一些TSVN的对话框。

默认的日志信息数

Limits the number of log messages that TortoiseSVN fetches when you first select TortoiseSVNShow Log Useful for slow server connections. You can always use Show All or Next 100 to get more messages.

日志信息字体

选择日志信息显示的字体样式和大小,作用域为版本日志对话框的中间窗格,以及提交对话框时填写日志信息的窗格。

日志信息使用短日期/时间格式

如果标准长度的日期/时间信息占在用了过多的屏幕空间,可以使用短格式。

进程对话框

当一个动作正确无误地完成时,TSVN可以自动关闭所有的进程对话框。这项设置允许你选择在何种情况下关闭对话框。默认(推荐)的设置是 手动关闭 ,允许你重新浏览所有信息并检查发生了什么。当然,你可能会决定忽略某些类型的信息并在你的操作没做出什么重大改变的情况下让对话框自动关闭。

如无合并、添加、删除操作,自动关闭 意味着如果有简单更新的话,进程对话框将关闭。但如果版本库的更改和你的内容进行了合并,或若有任何文件被添加或删除,对话框将保持打开。若操作中发生什么冲突和错误这些对话框也将同样保持打开。

对本地操作自动关闭(如无合并、添加或删除操作,自动关闭) 意味着进程对话框当 如无合并、添加或删除操作 时自动关闭,但仅限于那些如添加文件、还原等本地的操作。在做远程操作时对话框将保持打开。

无冲突时自动关闭 更放宽了标准,即使在无合并、添加、删除操作时也同样关闭对话框。当然,如果操作发生了任何冲突或错误,对话框将保持打开。

如无错误,自动关闭 即使在有冲突发生时也会关闭。维持对话框打开的唯一条件是发生了错误,使得Subversion无法完成任务。举个例子,一个更新操作由于服务器不可达而失败了,或是一个提交操作因为工作副本已经过期而失败。

Use URL of WC as the default “From:” URL

在合并对话框里,默认行为是在每次合并中记忆 起始: 的URL。无论如何,都有某些人喜欢在他们的版本进化树中从很多不同的位置执行合并操作,他们发现从当前工作副本的URL开始更方便些。该URL可以随后被编辑来指向一个同级路径或另一个分支。

缺省检出路径

你可以指定缺省的检出路径。如果你保持所有检出在同一个地方,那么预先填写的路径是极为有用的,这样你只需要在路径末尾增加新的目录名称即可。

缺省检出URL

你可以指定缺省的检出URL。如果你经常检出一些大项目的子工程,那么预先填写的URL是极为有用的,这样你只需要在路径末尾增加新的工程名称即可。

TSVN对话框设置二

图 5.53. 设置对话框,对话框二页面

设置对话框,对话框二页面


递归处理未进行版本控制的文件夹

若这个选项框被选中(默认状态),那么一个非版本控制的文件夹,不论在 添加提交检查更新 时显示的是什么状态,它的每个子文件和子文件夹都要同样显示。取消选择将减少这些对话框中的混乱程度。这样一来如果你选择添加一个非版本控制的文件夹,将会非递归地添加。

自动完成文件路径和关键词

The commit dialog includes a facility to parse the list of filenames being committed. When you type the first 3 letters of an item in the list, the auto-completion box pops up, and you can press Enter to complete the filename. Check the box to enable this feature.

自动完成分析的超时时间(秒)

The auto-completion parser can be quite slow if there are a lot of large files to check. This timeout stops the commit dialog being held up for too long. If you are missing important auto-completion information, you can extend the timeout.

仅在设置了 tsvn:projectlanguage 时才进行拼写检查

若你不愿意在所有提交操作时都进行拼写检查,就选择该选项。而后拼写检查功能将在项目属性做出明确要求时才生效。

日志中保留的最大条目数量

TSVN可以为每个版本库保存你访问时所输入的最后25条日志信息。你可以自定义该数目。若你有很多不同的版本库,你可能会希望减少该数目以防止向注册表中填入过多信息。

如果提交失败,自动重新打开提交和分支/标签对话框

当一个提交操作由于某些原因(工作副本需要更新、pre-commit钩子程序拒绝了提交、网络错误等等)失败了,你可以选择该选项来使提交对话框保持打开,以便重新操作。当然,你应该注意到这可能会导致一些问题。若发生的错误意味着你需要更新你的工作副本,而此更新操作将导致冲突,那么你必须先解决这些事情再说。

自动选择项目

The normal behaviour in the commit dialog is for all modified (versioned) items to be selected for commit automatically. If you prefer to start with nothing selected and pick the items for commit manually, uncheck this box.

启动时连接版本库

“检查更新”对话框将默认检查工作副本,但仅当你点击 检查版本库 时才连接你的版本库做检查。若你想总是去检查版本库,就可以使用该设置来使版本库检查的动作每次都自动启动。

在锁定文件之前显示加锁对话框

当你选择一个或多个文件,然后选择 TortoiseSVN加锁 后,一些项目的惯例是写加锁信息,解释你为什么锁定这些文件。如果你不使用加锁信息,可以取消此选择框,从而略过对话框,直接锁定文件。

如果你在目录上使用加锁命令,一定会出现加锁对话框,因为它要让你选择加锁的文件。

如果你的项目使用了 tsvn:lockmsgminsize 属性,那么不管你如何设置,都会看到加锁对话框,因为此项目需要加锁信息。

TortoiseSVN 颜色设置

图 5.54. 设置对话框,颜色页面

设置对话框,颜色页面


此对话框允许你按照你喜欢的方式来配置TSVN对话框使用的文本颜色。

可能或确实有冲突/问题

当更新时或合并时发生了冲突。如果对应于版本控制下的文件/文件夹,存在一个同名的非版本控制的文件/文件夹,此时做更新将被阻碍。

此颜色同样被用在进程对话框的错误信息中。

添加文件

向版本库添加的条目。

丢失/已删除/已替换

已从工作副本中遗失的条目;已从版本库中删除;或已经从工作副本删除并且被另一个同名文件替换。

已合并

从版本库所做的更改被成功地合并到工作副本,并无任何冲突产生。

已修改/已复制

已经增加(现在只是修改),或者在版本库中复制。也在包含复制条目的日志对话框中使用。

删除的节点

一个已经从版本库中删除了的条目。

添加的节点

一个通过添加、复制或移动操作,已经被添加到版本库的条目。

重命名的节点

一个在版本库中已经被重命名的条目。

替换的节点

该原始条目已经被删除,且有同名条目替换了的条目。

图标叠加设置

图 5.55. The Settings Dialog, Icon Overlays Page

The Settings Dialog, Icon Overlays Page


This page allows you to choose the items for which TortoiseSVN will display icon overlays.

By default, overlay icons and context menus will appear in all open/save dialogs as well as in Windows Explorer. If you want them to appear only in Windows Explorer, check the Show overlays and context menu only in explorer box.

Ignored items and Unversioned items are not usually given an overlay. If you want to show an overlay in these cases, just check the boxes.

You can also choose to mark folders as modified if they contain unversioned items. This could be useful for reminding you that you have created new files which are not yet versioned. This option is only available when you use the default status cache option (see below).

Since it takes quite a while to fetch the status of a working copy, TortoiseSVN uses a cache to store the status so the explorer doesn't get hogged too much when showing the overlays. You can choose which type of cache TortoiseSVN should use according to your system and working copy size here:

默认

Caches all status information in a separate process (TSVNCache.exe). That process watches all drives for changes and fetches the status again if files inside a working copy get modified. The process runs with the least possible priority so other programs don't get hogged because of it. That also means that the status information is not real time but it can take a few seconds for the overlays to change.

Advantage: the overlays show the status recursively, i.e. if a file deep inside a working copy is modified, all folders up to the working copy root will also show the modified overlay. And since the process can send notifications to the shell, the overlays on the left tree view usually change too.

缺点: 即使你已经不在项目下工作了,该进程仍然持续运行。取决于你工作副本的数量和大小,它将占用10-50 MB的RAM内存空间。

Windows 外壳

缓存在外壳扩展dll中直接完成,但仅仅是为那些当前可见的文件夹。每次你浏览到其他文件夹,状态信息就会被重新获取。

优点: 仅仅需要很少的内存(大约 1 MB),并且可以 实时 显示状态。

缺点: 因为仅有一个文件夹被缓存,图标重载不会递归地显示状态。在大一些的工作副本下,它在浏览器中显示一个文件夹将比默认缓存模式花费更多时间。而且 mime-type 列将无效。

在这种设置下,TSVN在浏览器里就完全不去获取状态了。因此,版本控制下的文件将不会获得任何图标重载。文件夹也仅仅有个“正常”状态的图标重载,其他的不会显示,也不会有其他额外的列可用。

优点: 绝对不会占用任何额外的内存,也完全不会减慢浏览器的浏览速度。

Disadvantage: Status information of files and folders is not shown in Explorer. To see if your working copies are modified, you have to use the “Check for modifications” dialog.

The next group allows you to select which classes of storage should show overlays. By default, only hard drives are selected. You can even disable all icon overlays, but where's the fun in that?

Network drives can be very slow, so by default icons are not shown for working copies located on network shares.

USB闪存看上去是个特殊情况,因为驱动类型是设备自主标识的。于是有些显示为固定驱动器,而有些显示为可移动磁盘。

排除路径 是被用来告诉TSVN 不用 在哪些路径下显示图标重载和状态列。如果你有些很大的工作副本,而这些工作副本仅仅包含你完全不想改变的库文件,从而你也不需要显示图标重载,这时该功能将会很有用。举个例子:

填写 f:\development\SVN\Subversion仅仅 在这个特殊文件夹上取消图标覆盖。 你仍然可以在该路径下的所有文件、文件夹上看到图标重载。

填写 f:\development\SVN\Subversion* 将在路径以 f:\development\SVN\Subversion 开始的 所有 文件和文件夹上取消图标重载。这意味着你在该路径下的任何文件/文件夹上都将看不到图标重载了。

包含路径 也使用同样的语法。除了有些反例: 即使该路径处在某个取消图标重载显示的特定驱动类型下,或是处在上面的排除路径之下, 也依然会显示图标重载。

Users sometimes ask how these three settings interact, and the definitive answer is:

if (path is in include list)
  show overlays
if (path is allowed drive type) AND (path is not in exclude list)
  show overlays

The include list always makes the overlays show. Otherwise, overlays are shown for all marked drive types unless the path is excluded.

TSVNCache.exe 同样使用这些路径来限制它的扫描。如果你想让它仅仅在某些特定文件夹里监视,就取消所有的驱动器类型,并仅仅包含你允许被扫描的文件夹。

排除 SUBST 磁盘

It is often convenient to use a SUBST drive to access your working copies, e.g. using the command

subst T: C:\TortoiseSVN\trunk\doc

However this can cause the overlays not to update, as TSVNCache will only receive one notification when a file changes, and that is normally for the original path. This means that your overlays on the subst path may never be updated.

An easy way to work around this is to exclude the original path from showing overlays, so that the overlays show up on the subst path instead.

Sometimes you will exclude areas that contain working copies, which saves TSVNCache from scanning and monitoring for changes, but you still want a visual indication that such folders are versioned. The Show excluded folders as 'normal' checkbox allows you to do this. With this option, versioned folders in any excluded area (drive type not checked, or specifically excluded) will show up as normal and up-to-date, with a green check mark. This reminds you that you are looking at a working copy, even though the folder overlays may not be correct. Files do not get an overlay at all. Note that the context menus still work, even though the overlays are not shown.

As a special exception to this, drives A: and B: are never considered for the Show excluded folders as 'normal' option. This is because Windows is forced to look on the drive, which can result in a delay of several seconds when starting Explorer, even if your PC does have a floppy drive.

图标集选择

图 5.56. 设置对话框,图标集页面

设置对话框,图标集页面


你可以选择你最喜欢的重载图标集。要注意的是,倘若改变了重载图标集,你可能需要重启计算机使更改生效。

网络设置

<placeholder-1> 如果需要穿透你公司的防火墙,在这里可以配置你的代理服务器。</placeholder-1>

If you need to set up per-repository proxy settings, you will need to use the Subversion servers file to configure this. Use Edit to get there directly. Consult the Runtime Configuration Area for details on how to use this file.

你同样可以在此指定SSH客户端程序,用来支持TortoiseSVN同使用svn+ssh协议的版本库建立安全连接。我们推荐您使用TortoisePlink.exe。这是著名的Plink程序的一个定制版本, 并且业已包含在TortoiseSVN之中,但它被编译成了一个无窗口的应用,因此当你每次认证的时候将不会看到弹出的DOS窗口。

You must specify the full path to the executable. For TortoisePlink.exe this is the standard TortoiseSVN bin directory. Use the Browse button to help locate it.

这里有个不弹出窗口的副作用: 将没有什么错误信息可供你追踪。因此倘若认证失败你将得到一个信息说: “Unable to write to standard output”。这样一来,我们就推荐你第一次设置时使用原始的Plink程序;而当一切工作正常之时,再使用定制版的TortoisePlink,并且重复利用那些相同的参数。

TortoisePlink does not have any documentation of its own because it is just a minor variant of Plink. Find out about command line parameters from the PuTTY website

To avoid being prompted for a password repeatedly, you might also consider using a password caching tool such as Pageant. This is also available for download from the PuTTY website.

Finally, setting up SSH on server and clients is a non-trivial process which is beyond the scope of this help file. However, you can find a guide in the TortoiseSVN FAQ listed under Subversion/TortoiseSVN SSH How-To.

外部程序设置

图 5.57. 设置对话框,差异查看页面

设置对话框,差异查看页面


在这里你可以定义你自己的差异查看/合并工具. 默认设置是使用与TortoiseSVN一同安装的TortoiseMerge。

阅读 “其他的比较/合并工具”一节 来了解人们为配合TortoiseSVN工作而使用的外部差异查看/合并程序列表。

差异查看器

有时你可能需要一个外部的差异查看程序来比较不同版本的文件。在为你的命令行填写各种可选参数的同时,要确保这些外部程序从中获得文件名。在TortoiseSVN编辑命令行时,使用以 % 开头的替代参数。当外部程序执行至遇到这些替代参数,它将从TortoiseSVN那里获取那些实际的值。参数的填写顺序将依赖于你使用的差异查看程序。

%base

没更改的原始文件

%bname

原始文件的窗口标题

%mine

你更改过的新文件

%yname

你新文件的窗口标题

窗口标题并不一定代表真正的文件名。TortoiseSVN把它伪装成一个名字用来创建和显示。因此,倘若你在对比一个版本为123的文件和你当前工作副本中的文件,名字将显示为 文件名 : 版本 123文件名 : 工作副本

例如,使用 ExamDiff Pro:

C:\Path-To\ExamDiff.exe %base %mine

或者使用 KDiff3:

C:\Path-To\kdiff3.exe %base %mine --L1 %bname --L2 %yname

或者使用 WinMerge:

C:\Path-To\WinMerge.exe -e -ub -dl %bname -dr %yname %base %mine

或者使用 Araxis:

C:\Path-To\compare.exe /max /wait /title1:%bname /title2:%yname
    %base %mine

If you use the svn:keywords property to expand keywords, and in particular the revision of a file, then there may be a difference between files which is purely due to the current value of the keyword. Also if you use svn:eol-style = native the BASE file will have pure LF line endings whereas your file will have CR-LF line endings. TortoiseSVN will normally hide these differences automatically by first parsing the BASE file to expand keywords and line endings before doing the diff operation. However, this can take a long time with large files. If Convert files when diffing against BASE is unchecked then TortoiseSVN will skip pre-processing the files.

你也可以使用 Subversion 属性来指定其它的比较工具。既然这些是简短的文本,你可能想要使用简单的查看器。

If you have configured an alternate diff tool, you can access TortoiseMerge and the third party tool from the context menus. Context menuDiff uses the primary diff tool, and Shift+ Context menuDiff uses the secondary diff tool.

合并工具

外部合并程序被用来解决文件冲突。像差异查看程序那样,替代参数同样被用在命令行中。

%base

没有被你或他人更改的原始文件

%bname

原始文件的窗口标题

%mine

你更改过的新文件

%yname

你新文件的窗口标题

%theirs

档案库中存放的文件

%tname

档案库中文件的窗口标题

%merged

发生冲突的文件,同时将被合并后的文件替换

%mname

合并文件的窗口标题

For example, with Perforce Merge:

C:\Path-To\P4Merge.exe %base %theirs %mine %merged

or with KDiff3:

C:\Path-To\kdiff3.exe %base %mine %theirs -o %merged
    --L1 %bname --L2 %yname --L3 %tname

or with Araxis:

C:\Path-To\compare.exe /max /wait /3 /title1:%tname /title2:%bname
    /title3:%yname %theirs %base %mine %merged /a2

or with WinMerge (2.8 or later):

C:\Path-To\WinMerge.exe %merged

差异查看/合并工具的高级设置

图 5.58. 高级差异比较设置/高级合并设置的对话框

高级差异比较设置/高级合并设置的对话框


In the advanced settings, you can define a different diff and merge program for every file extension. For instance you could associate Photoshop as the “Diff” Program for .jpg files :-) You can also associate the svn:mime-type property with a diff or merge program.

为了使用文件扩展,你需要指定扩展。使用 .BMP 来描述 Windows 位图文件。如果使用svn:mime-type属性,要指定多媒体文件类型,包含斜线,例如text/xml

统一的差异查看器

一个统一差异文件(补丁文件)的查看程序。不需要任何参数。默认 选项遵循先检查 .diff 文件,再检查 .txt 文件的顺序。如果你没有 .diff 文件的查看器,就需要用记事本来查看了。

原始Windows记事本程序对未使用标准“回车-换行”结束符的文件支持的并不好。而很多统一差异文件都仅仅使用“换行”结束符,因此他们的格式在记事本中显示的并不好。无论如何,你可以下载一个免费的记事本2 Notepad2,它不但可以正确地显示结束符,更可以为差异文件中添加和删除的那些行做颜色标记。

已保存数据的设置

图 5.59. 设置对话框,已保存数据设置页面

设置对话框,已保存数据设置页面


为您方便着想,TortoiseSVN保存了很多你用过的设置,并记录你最近浏览过的地址。如果你想清空这些数据缓存,就在这里操作。

URL历史记录

每次你检出一个工作副本,合并那些更改的文件,或仅仅是在使用版本库浏览器时,TortoiseSVN都将保存一个记录,记录那些最近使用过的URL,并在一个下拉列表框中显示出来。有时列表会被逐渐增多的过期URL弄得乱糟糟的,所以有定期清理一下的必要。

If you want to remove a single item from one of the combo boxes you can do that in-place. Just click on the arrow to drop the combo box down, move the mouse over the item you want to remove and type Shift+Del.

日志信息(输入对话框)

TortoiseSVN同时也储存你最近提交时填写的日志信息。对应每个版本库都要储存这些信息,所以如果你访问过很多版本库,这个列表将变得非常大。

日志信息(显示日志对话框)

TortoiseSVN caches log messages fetched by the Show Log dialog to save time when you next show the log. If someone else edits a log message and you already have that message cached, you will not see the change until you clear the cache. Log message caching is enabled on the Dialogs 1 tab.

窗口大小及位置

许多对话框都可以记录你最后一次使用时的窗口大小和位置。

认证数据

当你在登陆某个Subversion服务器,填写认证信息时,用户名和密码也可以被保存在本地,你也就不用每次都输入了。但考虑到一些安全因素,你可能会有清除这些认证信息的愿望,或者你仅仅是想换个不同的用户名登陆...John知道你正在用他的机器么?(规范点儿,用你自己的用户名登陆版本库吧,伙计 *by Jax)

If you want to clear authentication data for one particular server only, read “认证”一节 for instructions on how to find the cached data.

动作日志

TortoiseSVN keeps a log of everything written to its progress dialogs. This can be useful when, for example, you want to check what happened in a recent update command.

The log file is limited in length and when it grows too big the oldest content is discarded. By default 4000 lines are kept, but you can customize that number.

From here you can view the log file content, and also clear it.

日志缓存

图 5.60. 设置对话框,日志缓存页面

设置对话框,日志缓存页面


This dialog allows you to configure the log caching feature of TortoiseSVN, which retains a local copy of log messages and changed paths to avoid time-consuming downloads from the server. Using the log cache can dramatically speed up the log dialog and the revision graph. Another useful feature is that the log messages can still be accessed when offline.

启用日志缓存

Enables log caching whenever log data is requested. If checked, data will be retrieved from the cache when available, and any messages not in the cache will be retrieved from the server and added to the cache.

If caching is disabled, data will always be retrieved directly from the server and not stored locally.

如果不能连接版本库

If you are working offline, or if the repository server is down, the log cache can still be used to supply log messages already held in the cache. Of course the cache may not be up-to-date, so there are options to allow you to select whether this feature should be used.

When log data is being taken from the cache without contacting the server, the dialog using those message will show the offline state in its title bar.

Timeout before updating the HEAD revision

When you invoke the log dialog you will normally want to contact the server to check for any newer log messages. If the timeout set here is non-zero then the server will only be contacted when the timeout has elapsed since the last time contact. This can reduce server round-trips if you open the log dialog frequently and the server is slow, but the data shown may not be completely up-to-date. If you want to use this feature we suggest using a value of 300 (5 minutes) as a compromise.

Below the settings you can see a list of the repositories that are cached locally, and the space used for the cache. If you select one of the repositories you can then use the buttons underneath.

日志缓存统计

图 5.61. 设置对话框,日志缓存统计

设置对话框,日志缓存统计


Click on the Details button to see detailed statistics for a particular cache. Many of the fields shown here are mainly of interest to the developers of TortoiseSVN, so they are not all described in detail.

RAM

The amount of memory required to service this cache.

磁盘

The amount of disk space used for the cache. Data is compressed, so disk usage is generally fairly modest.

连接

Shows whether the repository was available last time the cache was used.

Last update

The last time the cache content was changed.

Last head update

The last time we requested the HEAD revision from the server.

作者

The number of different authors with messages recorded in the cache.

路径

The number of paths listed, as you would see using svn log -v.

Skip ranges

The number of revision ranges which we have not fetched, simply because they haven't been requested. This is a measure of the number of holes in the cache.

Max revision

The highest revision number stored in the cache.

Revision count

The number of revisions stored in the cache. This is another measure of cache completeness.

Click on the Update to completely refresh the cache and fill in any holes. For a large repository this could be very time consuming, but useful if you are about to go offline and want the best available cache.

Click on the Export button to export the entire cache as a set of CSV files. This could be useful if you want to process the log data using an external program, although it is mainly useful to the developers.

Click on Delete to remove all cached data for the selected repositories. This does not disable caching for the repository so the next time you request log data, a new cache will be created.

客户端钩子脚本

图 5.62. 设置对话框,钩子脚本页

设置对话框,钩子脚本页


这个对话框允许你指定当特定 Subversion 动作执行时,自动执行的钩子脚本。与 “钩子脚本”一节 中说明的钩子脚本相反,这些脚本在客户端本地执行。

应用程序,例如钩子,可能调用如SubWCRev.exe这样的程序,来更新提交后的版本号,可能还会出发重新构建。

由于各种安全理由和实现问题,钩子脚本在本地机器定义,而不是象工程属性那样。不管是谁提交,都可以定义它做什么事情。当然,你也可以选择调用一个受版本控制的脚本。

图 5.63. 设置对话框,配置钩子脚本页面

设置对话框,配置钩子脚本页面


要增加钩子脚本,直接点击 增加 ,然后输入脚本即可。

现在有六种钩子脚本类型可用

开始提交

Called before the commit dialog is shown. You might want to use this if the hook modifies a versioned file and affects the list of files that need to be committed and/or commit message.

提交之前

在提交对话框点击确认之后,实际提交之前调用。

提交之后

在提交结束后调用(无论成功或失败)

开始更新

在更新到版本对话框显示之前调用

更新之前

在 Subversion 更新实际开始之前调用

更新之后

在更新之后调用(无论成功或失败)

为特定工作目录定义的钩子。你只要指定顶级路径;如果在子目录内执行提交,TortoiseSVN 会自动向上搜索匹配路径。

然后你要指定要执行的命令行,以钩子脚本或可执行文件的路径开始。它可以是批处理文件,可执行文件,或者有效的windows关联的其它文件类型,例如perl文件。

The command line includes several parameters which get filled in by TortoiseSVN. The parameters available depend upon which hook is called. Each hook has its own parameters which are passed in the following order:

开始提交

PATHMESSAGEFILECWD

提交之前

PATHDEPTHMESSAGEFILECWD

提交之后

PATHDEPTHMESSAGEFILEREVISIONERRORCWD

开始更新

PATHCWD

更新之前

PATHDEPTHREVISIONCWD

更新之后

PATHDEPTHREVISIONERRORCWD

The meaning of each of these parameters is described here:

PATH

指向临时文件的路径,此文件包含了操作开始时的所有路径。在临时文件中,每个路径占一行。

DEPTH

提交/更新的深度。

可能的取值是:

-2

svn_depth_unknown

-1

svn_depth_exclude

0

svn_depth_empty

1

svn_depth_files

2

svn_depth_immediates

3

svn_depth_infinity

MESSAGEFILE

Path to a file containing the log message for the commit. The file contains the text in UTF-8 encoding. After successful execution of the start-commit hook, the log message is read back, giving the hook a chance to modify it.

REVISION

更新或提交完成后的版本库的版本

ERROR

Path to a file containing the error message. If there was no error, the file will be empty.

CWD

The current working directory with which the script is run. This is set to the common root directory of all affected paths.

如果你想Subversion 操作直到钩子完成才结束,就选择等待脚本结束

Normally you will want to hide ugly DOS boxes when the script runs, so Hide the script while running is checked by default.

Issue Tracker Integration

TortoiseSVN can use a COM plugin to query issue trackers when in the commit dialog. The use of such plugins is described in “Getting Information from the Issue Tracker”一节. If your system administrator has provided you with a plugin, which you have already installed and registered, this is the place to specify how it integrates with your working copy.

图 5.64. The Settings Dialog, Issue Tracker Integration Page

The Settings Dialog, Issue Tracker Integration Page


Click on Add... to use the plugin with a particular working copy. Here you can specify the working copy path, choose which plugin to use from a drop down list of all registered issue tracker plugins, and any parameters to pass. The parameters will be specific to the plugin, but might include your user name on the issue tracker so that the plugin can query for issues which are assigned to you.

TortoiseBlame 的设置

图 5.65. 设置对话框,TortoiseBlame 页面

设置对话框,TortoiseBlame 页面


TortoiseBlame 使用的配置被主上下文菜单控制,不是被 TortoiseBlame 自己直接控制。

颜色

TortoiseBlame 可以使用背景色指示文件中行的年龄。你设置最新和最旧版本的颜色后,TortoiseBlame 使用线性插补算法根据每行的版本设置其颜色。

字体

你可以选择显示文本的字体和大小。它同时对文件内容,在左窗格显示的作者和版本信息等生效。

制表

定义在文件中出现的制表字符用多少空格扩展。

注册表设置

一些极不常用的设置只有通过直接修改注册表的方式才能生效。

配置

通过编辑注册表 HKCU\Software\TortoiseSVN\ConfigDir,你可以为Subversion的配置文件指定一个不同位置。这将影响到TSVN的所有操作。

缓存托盘图标

要为TSVNCache程序添加一个缓存托盘图标,先在 HKCU\Software\TortoiseSVN\CacheTrayIcon 的位置,创建一个 DWORD 值,取值为1。这确实只对开发者才有点用处,因为它允许你来优雅地关闭TSVNCache,而不是在进程列表里kill掉它。(托盘图标可以显示当前已缓存了的文件夹数目 *by Jax)

在自动完成列表的文件名称没有扩展名

The auto-completion list shown in the commit message editor displays the names of files listed for commit. To also include these names with extensions removed, create a DWORD key with a value of 1 at HKCU\Software\TortoiseSVN\AutocompleteRemovesExtensions.

Explorer columns everywhere

The extra columns the TortoiseSVN adds to the details view in Windows Explorer are normally only active in a working copy. If you want those to be accessible everywhere, not just in working copies, create a DWORD key with a value of 1 at HKCU\Software\TortoiseSVN\ColumnsEveryWhere.

合并日志分隔符

When you merge revisions from another branch, and merge tracking information is available, the log messages from the revisions you merge will be collected to make up a commit log message. A pre-defined string is used to separate the individual log messages of the merged revisions. If you prefer, you can create a SZ key at HKCU\Software\TortoiseSVN\MergeLogSeparator containing a separator string of your choice.

始终用 TortoiseMerge 追溯改变

TortoiseSVN allows you to assign external diff viewer. Most such viewers, however, are not suited for change blaming (“追溯不同点”一节), so you might wish to fall back to TortoiseMerge in this case. To do so, create a DWORD key with a value of 1 at HKCU\Software\TortoiseSVN\DiffBlamesWithTortoiseMerge.

Subversion 的工作文件夹

VS.NET 2003 when used with web projects can't handle the .svn folders that Subversion uses to store its internal information. This is not a bug in Subversion. The bug is in VS.NET 2003 and the frontpage extensions it uses.

As of Version 1.3.0 of Subversion and TortoiseSVN, you can set the environment variable SVN_ASP_DOT_NET_HACK. If that variable is set, then Subversion will use _svn folders instead of .svn folders. You must restart your shell for that environment variable to take effect. Normally that means rebooting your PC. To make this easier, you can now do this from the general settings page using a simple checkbox - refer to “常规设置”一节.

For more information, and other ways to avoid this problem in the first place, check out the article about this in our FAQ.