Updating your Sandbox 更新你的沙盒www.shengfang.org Occasionally you may want changes done by others to get incorporated in your local working copy. The process of getting changes from the server to your local copy is known as Updating. Updating may be done on single files, a set of selected files, or recursively on entire folder hierarchies. To update, highlight the files and/or folders you want, right-click and select CVS Update. The Progress Dialog will pop up displaying the progress of the update as it runs. 有时候你可能需要把别人的修改合并到你的本地拷贝当中来。这个从服务器获得修改合并到你的本地拷贝的过程称之为更新。你可以只对一个文件更新,也可以对多个文件,或者是整个文件夹递归更新。你首先选择你想要更新的文件或者文件夹,点击鼠标右键,选择 CVS更新。www.shengfang.org当在更新的时候,TCVS将弹出一个状态对话框显示过程。Figure 2.3. Updating Files and Folders 更新文件和文件夹 Changes done by others will be merged into your files, keeping any changes you may have done to the same files. The repository is not affected by performing an update. 别人的修改将合并到你的文件,你的修改仍然保留在同一个文件中,仓库不会受到更新操作的影响。If you receive reports of conflicts during the update, please read Resolving Conflicts. 如果你在更新过程中看到冲突的信息,请阅读 解决冲突 For more information see Getting Other People's Changes: CVS Update. 请参见 获得别人的修改:CVS更新获得更多资料www.shengfang.org Committing your Changes to the Repository 提交你的修改到仓库中去 Making local modifications available in the repository is known as committing the changes. Before committing, you should do an update to make sure there are no conflicts (see Updating your Sandbox). www.shengfang.org让本地的修改同样体现到仓库中去,我们称之为 提交修改。在提交之前,你应该首先进行更新,确保文件没有冲突。To commit your changes start by selecting the file(s) or folder(s) that you want to commit. Right-click on the selection, and choose the CVS Commit... menu item. 同样选择文件或者文件夹,右键,选择提交对话框 Figure 2.4. Commit Dialog 提交对话框 You will then be presented with the Commit Dialog where you can enter a brief summary of what was changed. You can also exclude changed files from the commit by unchecking their checkboxes. Once you are satisfied with what you are committing, click the OK on the dialog to go ahead with the commit operation. 你可以在提交对话框中输入简要的修改说明,去掉文件的勾选,表示排除这些文件提交。如果你已经确认OK,www.shengfang.org那么点击确定按钮开始提交吧。 Please note that committing changes will not automatically add new files that you have created to the repository. See Adding Files and Directories to the Repository on how to add files. 请注意提交修改不能知道增加你创建的新文件,www.shengfang.org请参见 增加文件和文件夹到仓库 Resolving Conflicts 合并冲突 Sometimes, the CVS server will report a conflict when you update your files from the repository. A conflict occurs when two or more developers have changed the same lines of a file. As CVS knows nothing of your project, it leaves resolving the conflicts to the developers. 有时候当你从仓库更新你的文件的时候,CVS服务器将会报告文件冲突。如果两个或多个程序员修改了同一个文件的同一行,冲突就会产生。由于CVS对你的项目毫不知情,www.shengfang.org所以它只能让程序员自己解决冲突Each conflicting file is marked with a "C" in the progress dialog (see Progress Dialog). When the update is complete, the Resolve Conflicts dialog is shown: 每个冲突的文件会打上C标志显示在过程对话框中,当更新完成后,解决冲突对话框将会弹出 Figure 2.5. Resolve Conflicts Dialog Right-click on the conflicting file(s) and select Merge Conflicts.... TortoiseCVS will now invoke the merge application that you have selected in Preferences/Tools/Merge application. Resolve each conflict, save the resulting file, and exit the merge application. TortoiseCVS will ask you to confirm that you want to save the result of the merge. 在冲突的文件上点击右键,选择合并冲突对话框,TCVS将调用你在 参数-工具-www.shengfang.org合并程序中指定的应用程序。解决完冲突,保存最终文件,退出合并程序,TCVS将询问你是否保存合并结果。 You can also bring up this dialog after closing the progress dialog by right-clicking in the sandbox and selecting the CVS → Resolve Conflicts... menu item. 你可以在关闭更新状态对话框后右键点击沙盒选择CVS -合并冲突 菜单项 www.shengfang.org再次显示 合并冲突对话框 字体:大 中 小 |