Reverting to an Older Version of a File 恢复一个文件的旧版本
Developers occasionally need to undo changes that have already been checked in. Going back to a specific file revision in TortoiseCVS is easy: 开发员有时候需要撤销一个已经签入的修改,回复到一个指定文件的版本在TCVS中是很容易的www.yippeesoft.com
Right-click on the file and select CVS → History to bring up the History Dialog. 右键,选择文件,选择 CVS-历史,弹出历史对话框www.yippeesoft.com
Right-click on the revision you need and choose the "Save this revision as…" option. 选择你需要的版本右键,选择 保存该版本为 选项www.yippeesoft.com
When the Save As dialog appears, do not click the "Save" button; instead, double-click on the file\’s name in the directory listing. 当另存为对话框弹出,不要选择保存按钮,双击目录列表下的同名文件。 Answer "Yes" when TortoiseCVS prompts you to overwrite the file. TCVS将询问是否覆盖时选择确定。www.yippeesoft.com
Branching And Merging 分支和合并
One of the features of version control systems, is the ability to isolate changes onto a separate line of development. This line is known as a Branch. 版本控制系统的一个特色,可以在开发过程中通过分割线隔离修改,www.yippeesoft.com称之为分支。
Branching is useful to control changes during the lifecycle of a software project. For example, suppose you have made the first release of your software project version 1.0. You now begin adding new features in preparation for your next major release 2.0. Between your initial release and the new version it is discovered that there are bugs in the software. The current revision of the sources code is in a state of flux and are not expected to be stable for at least another month and therefore there is no way to make a bugfix release based on the newest sources. 在一个软件项目周期中,分支是一个很有用的修改控制。例如,如果你已经推出了你的软件的第一个版本1.0,现在你已经在下一个版本2.0增加新功能。此时你的第一个版本发现了BUG,你的新版本的源代码正在开发阶段,推出稳定版本至少需要一个月的时间,www.yippeesoft.com因此无法基于最新版本推出一个修正原有BUG的版本。
Instead of attempting to make the fix to the current version, or the HEAD branch, you would create a branch on the revision trees for all the files that made up release 1.0. You can then make modifications to the branch without disturbing the head branch. When the modifications are finished you can either incorporate them on the head branch or leave them on the release 1.0 branch. 你不要试图在当前版本或者主分支中作这种BUG修改,你应该在版本树中创建一个分支,所有文件都是基于释放 版本1.0的,于是你就可以在这个分支上修改而不会干扰主分支了。当修改完成后,你可以把它们合并到主分支或者把它们保留在1.O分支上。www.yippeesoft.com
Creating a Branch 创建分支
To create a branch, select the directory or files that you want to branch. Right-click the on the selection, and choose CVS → Create Branch… from the context-menu. 创建分支,选择你想分支的文件或者目录,右键,选择 CVS-创建分支。Figure 3.4. Branch Dialog 分支对话框
You will then be presented with the Branch Dialog. Here you can enter a label in the Branch field. The same name restrictions that apply to Tags, apply to branches as well. Once you have entered the desired branch name click the OK. Unlike most CVS operations, the branch is immediately applied to the repository, and no commit is required. The branch, however, is only applied on the repository. To start working on the newly created branch select the branch to work on. 你将看到分支对话框,这里你可以在分支文本框中输入标签。规则如同标签TOG。你输入想要的分支名称,点击确定,分支将立即在仓库中生效,不需要提交。分支只是在仓库中生效,在新创建的分支上工作--选择工作分支
Selecting a Branch to Work On选择工作分支www.yippeesoft.com
To start working on a branch instead of the default development line, you have to bind your local copy to the branch. This is needed to make sure that actions such as updates, commits etc. work on the branch rather than on the main line of development. 在分支上工作而不是在默认得开发线上,你必须绑定你的本地拷贝到分支上,www.yippeesoft.com如同更新、提交操作,需要仔细区分工作与分支还是工作在主开发线上。
To move your local copy to another branch, select the top level folder of the project. You can also select the exact folders and files that are part of the desired branch if you know this information. Right-click the on the selection, and choose CVS → Update Special…. 修改你的本地拷贝到另外一个分支,选择最顶层工作目录,你也可以选择特定的文件或者目录(你知道这些信息并确认希望得到这些文件的分支)右键 选择CVS-www.yippeesoft.com更新到指定版本 Figure 3.5. Update Special Dialog 更新到指定版本对话框
You will then be presented with the Update Special Dialog. Here you can enter the branch name in the Get Tag/Branch/Revision field you wish to select. Click the OK button, and TortoiseCVS will now do the necessary updates to move your working copy to the desired branch. The updating may also include adding or removing files depending on the state of the branch. 更新到指定版本对话框,你可以在此输入你需要的分支名称与 获得 标签/分支/版本 文本框,点击 确定,TCVS将更新你的本地文件到指定的分支。根据分支的状态将增加或者删除一些文件。www.yippeesoft.com
TortoiseCVS puts what is known as sticky tags on the files that are affected by the branch. To remove the sticky tags you must go back to the head branch. TCVS将在这些分支文件上设置粘性标志,移除这些粘性标志,你必须返回到主分支中。www.yippeesoft.com
历史博文
- 20080806 YippeeSoft@pick xpi - 2009
- 20071016 gui ide 可视化 - 2008
- 20070203 perl ping - 2007
- 0306 VC debug trace afxDump AfxDump 调试 - 2006
- 单片机C51复习-入门1 - 2005
- 乱七八糟猜想18门户网站19DUDU加速器病毒 - 2005
- 从ASP.NET看BIN DLL所放置的目录 - 2005
- vs.net c# 一个调用外部程序的例子 - 2005
- vs.net环境下开发C# asp.net时,试图运行项目时出错 - 2005