your working copy is and how much RAM Windows can use for file index caching. Usually it's only very slow the first time you browse such a directory - if you browse the same directory later again it's much faster.
If you want to disable the recursive overlays for some folders but not for all then you can do that by creating a file called _tsvnexcluderecursive inside that folder. This will disable the recursive overlays for that folder, but not for the files or folders inside it.
You can also disable the overlays completely for a folder by creating a file called _tsvnexcludethis inside that folder. Again, this disables the overlays only for that folder, not the folders inside it. You can define specific paths to be excluded from showing overlays on the settings page (Section 4.21.2, “The Settings Dialog, Look and Feel Tab”).
和TortoiseCVS(CVS客户端)不一样,没有被版本控制的文件是没有覆盖图标的。所以这样做,是因为覆盖图标的数量是有限的,我们应该节约点使用:)
4.5.2. 资源管理器中TortoiseSVN的专栏
和覆盖图标一样有用(或更有用)的信息可以显示在浏览器详细资料视图方式时的附加栏中。 Simply right click on one of the headings of a column, choose More... from the context menu displayed. A dialog will appear where you can specify the columns and their order, which is displayed in the \starting with SVN come into view. Check the ones you would like to have displayed and close the dialog by pressing OK. The columns will be appended to the right of those currently displayed. You can reorder them by drag and drop, or resize them, so that they fit your needs. 技巧Tip
If you want the current layout to be displayed in all your working copies, you may want to make this the default view.
4.5.3. 仓库状态Status Of The Repository
图 4.6. 检查修改Check for Modifications
清楚地知道自己修改了哪些文件以及别人修改提交了哪些文件是很有用的。这就是命令Check For Modifications用的着的地方了。这个对话框显示出你的工作副本中修改过的每一个文件,没有在版本控制下的文件也会被显示出来。点击Check Repository按钮,可以检查仓库中的改动。在做update之前,你可以这么做一下,来检查是否有冲突的可能。
在其中选择文件或文件夹单击鼠标右键,在菜单中我们可以选择查看文件的差别,或者把本地的修改取消。TortoiseSVN会从仓库中自动下载最新的版本来进行比较。
4.5.4. Viewing Diffs
我们经常会想要在文件里面查看哪些地方修改了。你可以先选择已经修改的文件,单击鼠标右键,选择TortoiseSVN的命令Diff。然后会打开一个比较查看器,它会对本地的文件和仓库中最新版本的内容进行详细的对比。 技巧Tip
不在工作目录中,或者你有多个版本的文件在一起的时候,你也可以使用比较功能:
在资源管理器中选中你要进行比较的两个文件(使用Ctrl键和鼠标),然后选择TortoiseSVN的菜单命令Diff。最后被点选的文件(焦点所在的那个,也就被虚线矩形框住的那个)将被认为是被修改过的那个。
4.6. 更新工作副本Update Your Working Copy With Changes From Others 图 4.7. 已完成更新的对话框
有时候你想要把别人做的修改融合到自己的本地副本当中。这个把改动从服务器拿到本地的过程就是我们已经知道的updating。Updating操作可以针对一个文件,或几个被选择的文件,或某个目录中的所有文件。选择你想要进行update操作的文件和(或)文件夹,单击鼠标右键,在菜单中选择Update。这时会跳出一个窗口显示正在update的进程。别人做的修改会合并到你的文件中,而你所做的修改会被保留。Update操作对仓库是不会产生任何影响的。 进程对话框用不同颜色的文字来表示不同的update动作。 蓝色
加入到你的工作副本中的新条目。 深红
从你的副本中删除的条目。 绿色
成功将改动合并到本地的条目。 亮红
合并改动到本地,但是有冲突需要解决。 黑色
所有其它的。
如果你在更新中产生了冲突(当你和别人同时修改了同一个文件的同一行并且改动的不同会发生这种情况),对话框中会用红色文字显示出冲突。双击对应的行就可以启动外挂程序来解决冲突。 TortoiseSVN 同时也允许你更新工作副本到一个特定的版本,并不仅仅是最新的版本。这个命令就是Update to Revision…,他会跳出一个对话框来让你输入你需要的版本。 小心Caution
If you update a file or folder to a specific revision, you will get out of date error
messages when you try to commit them! If you want to undo changes to a file and start afresh from an earlier revision, you must either use the Revert changes from this revision command from the log dialog or the Merge... menu command. 命令Update to Revision...可以让你的工作回复到以前的版本。比如说你的工作副本现在的版本是100,但你想要看看版本为50的时候是什么样子,那就可以简单的将版本更新到50即可。
一般来说,更新一个单独的文件到以前的版本并不太好,因为这会导致你的工作副本处于一个不一致的状态。假如你更新的文件改过名字,有可能你只是发现那个文件消失了,因为在以前的那个版本,根本不存在那个名字的文件。如果你只是需要某个文件的老版本副本,最好在日志对话框中使用Save revision to...命令来搞定。 警告Warning
If you updated your working copy to an earlier revision, you must not make changes to the files! You will get out of date errors if you try to commit those changes. If you want to revert some changes in your working copy, then use the repository browser and save the file in question over the file in your working copy. Or you can use the log dialog and use the command Revert changes in this revision. This will undo only those changes made in the selected revision. Changes made after that revision will be retained. For reverting multiple revisions, you should use the merge command, where you can specify the range of revisions you want to undo. 多个文件或文件夹Multiple Files/Folders
If you select multiple files and folders in the explorer and then select Update, all of those files/folders are updated one by one. TortoiseSVN makes sure that all files/folders which are from the same repository are updated to the exact same revision! Even if between those updates another commit occurred. 本地文件已存在Local File Already Exists
Sometimes when you try to update, the update fails with a message to say that there is already a local file of the same name. This typically happens when Subversion tries to checkout a newly versioned file, and finds that an unversioned file of the same name already exists in your working folder. Subversion will never overwrite an unversioned file - it might contain something you are working on, which coincidentally has the same filename as another developer has used for his newly committed file.
If you get this error message, the solution is simply to rename the local unversioned file. After completing the update, you can check whether the renamed file is still needed.
If you keep getting error messages, use Check for modifications instead to list all
the problem files. That way you can deal with them all at once. 4.7. 解决冲突Resolving Conflicts
有时候,你从仓库更新文件时会发生一些冲突。当两个或更多开发人员对同一个文件的某几行做了修改,就会产生冲突。因为Subversion对你的项目一无所知,他会把冲突留给开发人员来解决。只要冲突产生了,你就应该打开有问题的文件,然后找到以“<<<<<<<”开头的那几行,有冲突的区域会被下面这样标示: <<<<<<< filename your changes =======
code merged from repository >>>>>>> revision
另外,对每一个有冲突的文件,Subversion都会在你的目录中放三个另外的文件: filename.ext.mine
这个文件是更新工作副本之前,冲突文件在你的工作副本中原来的样子。其中没有任何冲突标记。 filename.ext.rOLDREV
这个文件是版本号为OLDREV时的文件。也就是你做修改之前最后一次取出的文件。 filename.ext.rNEWREV
这是你更新时Subversion客户端从服务器收到的最新版本的文件。他是仓库的最新版本。 你可以在菜单中选择Edit Conflict来打开一个合并工具或冲突编辑器,或者用其他编辑器来解决这个冲突。你必须决定这些代码到底该是什么样子,做一些必要的修改,然后保存文件。 然后选择菜单中的Resolved命令执行,接着提交修改到仓库。请注意,命令Resolved并没有真正的解决冲突,它只不过是把filename.ext.mine 和 filename.ext.r*删除,并允许你提交修改而已。
4.8. 把你的修改发送到仓库Sending Your Changes To The Repository
发送你对工作副本的修改就是提交修改。在提交之前,你应该确认你的工作副本是最新的。你可以直接作一次Update操作,或者先Check for Modifications看看在本地或在服务器上哪些文件修改过。
如果你的副本是最新的,并且没有冲突,你就可以提交你的修改了。选中你想要提交的任意文件或文件夹,然后选择在菜单中选择Commit…。 图 4.8. 提交对话框