如何检查CVS分支点? [英] How to check out a CVS branch point?

查看:100
本文介绍了如何检查CVS分支点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我必须承认我对CVS有所了解。我有一个发布标签 releaseX ,该发布标签是在一段时间之前完成的(即,不是HEAD)。然后,我决定当时需要一个维护分支。我不是在添加 releaseX 添加中创建分支标记( branchX ),而是删除发行标签,并创建了一个错误地名为 releaseX 的分支标签。然后,我继续在那个维护分支上工作,并创建了 releaseX1 releaseX2 等。

First, I have to admit I screwed up a little with CVS. I had a release tag releaseX, which was done some time back (i.e., not HEAD). Then I decided I need a maintenance branch at that point. Instead of creating a branch tag (branchX) in addition to releaseX, I deleted the release tag and created a branch tag (erroneously) named releaseX. I then proceeded to work on that maintenance branch, and created releaseX1, releaseX2 etc.

我的问题:检出 releaseX 时,我得到了分支头,即该分支的最新代码。我现在需要的是分支点的代码 ,即 former releaseX 代码。

My problem: when I check out releaseX, I get the branch head, i.e. the latest code from that branch. What I need now is the code at the branch point, i.e. the former releaseX code.

有什么方法吗?

从备份恢复到较早的存储库版本不是选项。

Reverting to earlier repository version from backup is not an option.

编辑:我知道我可以通过执行基于日期的结帐来解决此问题。我想知道是否仍然可以进行基于标签的操作。

I know I can work around it by doing a date-based checkout. I would like to know if it's possible to still do a tag-based one.

更新(回复@Philip Derbeko):我知道CVS在文件之间不相关。但是CVS 确实具有分支发生位置的信息。在ViewVC中,我什至可以看到它:

Update (Re @Philip Derbeko): I know that CVS does not correlate between files. But CVS does have the information where the branch occured. In ViewVC, I can even see it:

文件X-版本1.y-分支:MAIN-发行版的分支点

下一个文件修订为:

文件X-修订1.y.2.1-分支:releaseX-CVS标签:releaseX1

元数据显然在那里。因此,我的问题是:是否可以检出分支 point ,而不是分支 HEAD

The metadata is apparently there. Hence my question: Is it possible to check out the branch point, not the branch HEAD?

推荐答案

由于分支时未设置标签,因此,我看到的唯一方法是使用日期方法。
但是您仍然可以立即设置该标签。假设您要将该初始版本称为 ReleaseX0,因为不幸的是分支的名称已被 ReleaseX占用。根据要在分支还是在MAIN分支上设置标签,可以使用以下两种签出命令:

Since you did not set a tag when branching, the only way I see, is to use the date approach. But you can still set that tag now. Lets assume you want to call that initial release "ReleaseX0", because unfortunately the name "ReleaseX" is already occupied for the branch. Depending on whether you want to set the tag on the branch or on the MAIN branch you can use either of these checkout commands:

cvs co -r releaseX -D "2008-12-30" modulename
cvs co -D "2008-12-30" modulename

然后设置标签:

cvs tag releaseX0

从现在开始,您可以以签出其他版本的相同方式签出该版本。

From now on you can checkout this release in the same way as you checkout the other releases.

正如您在对我的最初回复的评论中所指出的那样,将分支从releaseX重命名为releaseX_branch就像这样不起作用

As you pointed out in your comment to my initial response, renaming the branch from releaseX to releaseX_branch like this does not work:

cvs rtag -r releaseX releaseX_branch modulename
cvs rtag -d releaseX modulename

要重命名分支,需要使用 cvs admin -N< old>:< new>。但是,无论如何,重命名分支都是一个坏主意。 (很抱歉首先提出它;-)。),重命名会弄乱其他用户的工作副本。因此,最好保留原始名称。

To rename a branch "cvs admin -N < old >:< new >" needs to be used. But renaming a branch is a bad idea anyway. (I am sorry for bringing it up in the first place ;-).), Renaming will mess up the working copies of other users. So it is probably best to stick with the original name.

这篇关于如何检查CVS分支点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆