bugtraq:label 这个属性用来指定将显示在提交窗口中流水号输入框前的标签里的文字。如果没有设置的话,默认显示的是Bug-ID/Issue-Nr:。注意,窗口不会变化大小去适应这个标签的,所以要保证文字不要超过20-25个字符。 bugtraq:number 该属性为true时,流水号将只允许数字输入。逗号是个例外,你可以输入多个用逗号隔开的数字。有效的属性值为true或者false。如果没有定义,默认为true。 bugtraq:warnifnoissue 如果想要让TortoiseSVN提醒不要输入空流水号,那就把这个属性设置为true。有效的属性值为true或者false。如果没有定义,默认为false。
某些tsvn:属性需要一个true或者false的值。另外,TSVN会懂得把yes当作true,把no当作false。
Set the Properties on Folders
These properties must be set on folders for the system to work. When you commit a file or folder the properties are read from that folder. If the properties are not found there, TortoiseSVN will search upwards through the folder tree to find them until it comes to an unversioned folder, or the tree root (eg. C:\\) is found. If you can be sure that each user checks out only from e.g trunk/ and not some subfolder, then it's enough if you set the properties on trunk/. If you can't be sure, you should set the properties recursively on each subfolder. A property setting deeper in the project hierarchy overrides settings on higher levels (closer to trunk/).
For tsvn: properties only you can use the Recursive checkbox to set the property to all subfolders in the hierarchy, without also setting it on all files. 4.11. 加入新文件和新目录Adding New Files And Directories 图4.11. 没有版本控制文件的菜单
如果你想把在开发过程中创建了新文件或新的目录加入到源代码控制之下,可以这样做:选中文件或目录,然后在菜单中选择Add命令。
在把文件或目录加入到控制之下后,这些文件或目录就会显示为一个added覆盖图标的样子,这就意味着你应该赶紧把你的工作副本commit一下,以便其他开发人员能够看到这些文件或目录。添加一个文件或目录并不会影响到仓库! Many Adds
You can also use the Add command on already versioned folders. In that case, the add dialog will show you all unversioned files inside that versioned folder. This helps if you have many new files and need them to add at once. 要把工作副本之外的文件加入进来,可以使用拖拽来搞定: 1. 选中你要添加的文件先。
2. 按下鼠标右键将文件拖拽到工作副本中的某个地方。 3. 松开鼠标右键。
4. 在跳出来的菜单中选择add files to Subversion here。这些文件马上就会被复制到工作副本中并且加入到了版本控制。
4.12. 忽略文件和目录Ignoring Files And Directories 图4.12. 没有版本控制文件的菜单
在很多项目中,有一些文件或目录是不应该被版本控制影响到的。包括那些编译器产生的*.obj, *.lst,还有一些存放可执行文件的输出目录。当提交修改时,TSVN就会把没有版本控制的文件列出来,占满了提交窗口的文件列表。当然你可以选择不显示他们,但这样可能会把一些需要添加的新加入的源代码文件漏掉。
避免这个问题的最好办法就是把这些文件加入项目的忽略列表。这样他们就不会再在提交窗口中出现了,而真正没有版本控制的源文件还是会被标记显示出来。
在没有版本控制的一个文件上单击鼠标右键,然后在TSVN的菜单中选择Ignore命令,这时会有一个子菜单出现,可以让你选择仅仅是这个文件,或者所有这个扩展名的文件。如果你最开始选中的是多个文件,那就不会有这个子菜单出现,而只能选择把这些选中的文件或目录加入忽略列表。
要把一个文件从忽略列表中去掉,必须编辑父目录的属性,把文件名从svn:ignore属性中移除。更多信息请阅读第4.9节 获取(修改)文件(目录)信息Get/Set Information About Files/Directories。
The Global Ignore List
Another way to ignore files is to add them to the global ignore list. The big difference here is that the global ignore list is a client property. It applies to all subversion projects, but on the client PC only. In general it is better to use the svn:ignore property where possible, because it can be applied to specific project areas, and it works for everyone who checks out the project. Read Section 4.21, “TortoiseSVN's Settings” for more information.
4.13. 删除、重命名、移动Deleting, Renaming And Moving
和CVS不一样,Subversion允许对文件和目录进行改名和移动操作。因此在TortoiseSVN的子菜单中有delete和rename。 图4.13. 版本控制下文件的菜单
如果使用TSVN删除了一个文件或目录,这个文件就已经从工作副本中删除了,并被标记为删除状态。这个文件的父目录将显示为一个“deleted”覆盖图标。要恢复这个文件,只需对他的父目录进行revert操作即可。
如果要在工作副本内移动文件,可以使用鼠标来拖拽: 1. 选中要移动的文件或目录。
2. 用鼠标右键拖拽他们到工作副本中一个新的目录。 3. 松开鼠标右键。
4. 在跳出的菜单中选择move files in Subversion to here。
如果一个删除操作不是在版本控制下完成的,比如就像平常删除文件那样删除的。提交时,对话框窗口还是会显示这些删除的文件,并让你把他们从版本控制下删除。所以如果忘记使用TortoiseSVN来删除这些文件,这些都不是什么大不了的问题。 Commit the parent folder
Since renames and moves are done as a delete followed by an add you must commit the parent folder of the renamed/moved file. Only that way the deleted part of the rename/move will show up in the commit dialog. If you don't commit the removed part of the rename/move, it will stay behind in the repository and an update of your coworkers won't remove the old file. Getting a deleted file or folder back
If you have deleted a file or a folder and already committed that delete operation to the repository, then a normal Revert can't bring it back anymore. But the file or folder is not lost at all. If you know the revision the file or folder got deleted (if you don't, use the log dialog to find out) open the repository browser and switch to that revision. Then select the file or folder you deleted, right-click and select Copy to... as the target for that copy operation select the path to your working copy. 4.14. 取消改变Undo Changes
如果要取消对一个文件所做的修改,只需用鼠标右键单击该文件,选择TSVN子菜单中的revert命令,在跳出的窗口中会显示你选择的文件,这时可以再次勾选文件,然后按下OK按钮就好了。注意这里所做的取消修改只能返回到该文件上次update时的状态。 图4.14. Revert dialog
Undoing Changes which have been Committed
Revert will only undo your local changes. It does not undo any changes which have already been committed. If you want to undo all the changes which were committed in a particular revision, read Section 4.15, “Revision Log Dialog” for further information.
4.15. 修订日志窗口Revision Log Dialog
每一次修改和提交,都应该做好日志记录。这样开发过程中就有了一个详细的记录,以后便可找出每一个修改是如何修改以及为什么这样修改的。 日志对话框会显示所有日志信息。显示分成3个部分:
1. 最上面部分显示的是所有被提交的版本列表。显示有日期时间、提交者、修订版本号和日志信息的前面一部分。
用蓝色显示的行表示有某些文件被复制到了这个版本。(也许是从一个分支来的)Lines shown in blue indicate that something has been copied to this development line (perhaps from a branch).
2. 中间部分显示的是选中版本的所有日志信息。 3. 底部显示的是选中版本所做修改的文件和目录列表。 还不仅仅是这些,对话框中还提供了很多的菜单命令可以使用。
4.15.1. Invoking The Log Dialog