使用 Clearcase 远程客户端进行分支

发布于 2024-07-24 23:06:15 字数 88 浏览 4 评论 0原文

我正在尝试在 ClearCase 远程客户端中分支文件。 我已经设置了分支,并且更新了配置规范以处理该分支。 但我找不到这个选项,而且谷歌搜索也没有多大帮助。

I am trying to branch a file in ClearCase Remote Client.
I have the branch set up and the config spec is updated to handle the branch.
But I can't find the option, and the googling isn't helping much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

戏剧牡丹亭 2024-07-31 23:06:15

我理解你的问题的方式,听起来你想以某种方式从 Clearcase RC 菜单中选择一个命令并显式创建分支(?)

Clearcase 没有明确的“为此文件生成分支”命令; 在这种情况下,您需要“结账”命令。 分支是间接的,是在具有包含“-mkbranch”操作的配置规范的视图中签出文件版本的结果。 即,一旦我签出(对于任何和所有 vobs 和文件),以下配置规范将创建 dev_1.0_branch

element * CHECKEDOUT
element * .../dev_1.0_branch/LATEST
element * /main/LATEST -mkbranch dev_1.0_branch

第一行是您正在其中进行开发的视图的标准行,第 2 行将确保我看到任何具有 dev_1.0_branch 的文件(对于 checkout+mkbranch 按预期工作特别重要:-),第 3 行将选择任何不具有 dev_1.0_branch 的文件的最新版本当(且仅当)签出该规则选择的文件版本时,dev_1.0_branch and 将创建分支。

如果您觉得上述任何内容听起来很奇怪,请告诉我,特别是任何配置规范规则。 使用 ClearCase 很长时间后,我假设并使用了它的许多术语和概念,就好像它们是常识一样:-P。

值得注意的一件事:如果您签出该文件,然后立即取消签出该文件,您将在该文件上留下一个空分支(即在上面您将拥有一个版本如下的文件: foo.c@@/main/ dev_1.0_branch/0,但没有 /main/dev_1.0_branch/1 版本)。 许多站点更喜欢保持版本树干净并删除空分支(可以在 这篇 IBM Rational 技术文章

需要明确的是,我熟悉 ClearCase Base 和 ClearCase Base。 ClearCase MultiSite,但尚未与远程客户端一起使用。

--- 2009年6月29日更新
针对 Paul 下面的评论,如果您想选择性地对哪些文件进行分支,您可以将“*”修改得更具体。 例如,如果您只想在 FOODEV VOB 中分支 foo.c,但将其他所有内容保留在 main 上:

UNIX 配置规范:(

element * CHECKOUT 
element * .../my_dev_branch/LATEST
element /vobs/FOODEV/src/foo.c -mkbranch my_dev_branch 
element * /main/LATEST

对于 Windows,您需要使用 Windows 约定。即 \FOODEV\src\foo.c) 。

您还可以选择一个目录以及该目录下的所有元素(同样是 UNIX 配置规范):

element * CHECKOUT
element * .../my_dev_branch/LATEST
element /vobs/FOODEV/src/mycomponent/... -mkbranch my_dev_branch
element * /main/LATEST

config_spec 的主页(在 Windows 或 UNIX 上从命令行使用cleartool man config_spec)提供了不错的指导“模式”部分介绍如何编写元素/版本选择器(第二列)。

您可以使用配置规范进行许多复杂的版本选择。 如果您想了解更多详细信息或具体情况,请告诉我。

The way I understand your question, it sounds like you want to somehow select a command from a Clearcase RC menu(s) and have the branch explicitly created(?)

Clearcase has no explicit "Generate Branch for this File" command; you would want the "Checkout" command in this case. Branching is indirect and is a result of checking out a version of a file in a view that has a config spec with the '-mkbranch ' operation in it. I.e. the following config spec will create the dev_1.0_branch once I check it out (for any and all vobs and files):

element * CHECKEDOUT
element * .../dev_1.0_branch/LATEST
element * /main/LATEST -mkbranch dev_1.0_branch

The first line is standard for views in which you are doing development, line 2 will assure that I see any file that has a dev_1.0_branch (particularly important for the checkout+mkbranch to work as expected :-), and line 3 will select the latest version of any file that does not have a dev_1.0_branch and will create the branch if (and only if) the file version selected by that rule is checked out.

Please let me know if any of the above sounds greek to you, particularly any of the config spec rules. Having worked with ClearCase for a long time, I assume and use a lot of its terminology and concepts as if it's common knowledge :-P.

One thing of note: if you checkout the file, then immediately uncheckout the file, you will leave an empty branch on that file (i.e. in the above you would have a file with a version such as: foo.c@@/main/dev_1.0_branch/0, but no /main/dev_1.0_branch/1 version). Many sites prefer to keep the version tree clean and remove empty branches (one can be found in this IBM Rational Technical article)

Just to be clear, I'm familiar with ClearCase Base & ClearCase MultiSite, but have not worked with the Remote Client yet.

--- 2009-Jun-29 Update
In response to Paul's comment below, if you want to be selective in what files are branched, you can modify the "*" to be more specific. For example, if you want to only branch foo.c in the FOODEV VOB, but leave everything else on main:

UNIX config spec:

element * CHECKOUT 
element * .../my_dev_branch/LATEST
element /vobs/FOODEV/src/foo.c -mkbranch my_dev_branch 
element * /main/LATEST

(For windows, you would want to use Windows conventions. I.e. \FOODEV\src\foo.c).

You can also select a directory and all elements below the directory (again UNIX config spec):

element * CHECKOUT
element * .../my_dev_branch/LATEST
element /vobs/FOODEV/src/mycomponent/... -mkbranch my_dev_branch
element * /main/LATEST

The main page for config_spec (cleartool man config_spec from the command line on windows or unix) provides decent guidance in the "Pattern" section for how to write the element/version selector (2nd column).

You can do a lot of complex version selection with the config specs. Please let me know if you would like more details or specifics.

生活了然无味 2024-07-31 23:06:15

这是我用来修复特定错误的配置规范,更改了名称以掩盖一些错误。

element * CHECKEDOUT

element * .../TEMP.bugnum171238.jleffler/LATEST
mkbranch -override TEMP.bugnum171238.jleffler

include /clearcase/cspecs/project/version-1.23.45

为了创建分支,在每个 VOB 中,我使用了一个命令:

ct mkbrtype -c 'Branch for bug 171238' TEMP.bugnum171238.jleffler@/vobs/project

以前,我们使用配置规范,并将 -mkbranch 规则附加到各个 element 行。

Here's a config spec that I used for fixing a particular bug, with names changed to disguise some of the guilty.

element * CHECKEDOUT

element * .../TEMP.bugnum171238.jleffler/LATEST
mkbranch -override TEMP.bugnum171238.jleffler

include /clearcase/cspecs/project/version-1.23.45

To create the branch, in each VOB, I used a command:

ct mkbrtype -c 'Branch for bug 171238' TEMP.bugnum171238.jleffler@/vobs/project

Previously, we used config specs with -mkbranch rules appended to the various element lines.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文