简体   繁体   English

ClearCase:如何使用分支类型创建分支

[英]ClearCase: How to create branch with branch type

I'm trying to use mkbranch command to create branch from main/abc branch. 我正在尝试使用mkbranch命令从main / abc分支创建分支。

I create branch type with following command: 我使用以下命令创建分支类型:

mkbrtype –c "bugfix branch from abc" bugfixAbc

Now I need to create branch with that branch type. 现在,我需要使用该分支类型创建分支。

How I'll create new branch from main/abc branch with branch type bugfixAbc? 如何使用分支类型为bugfixAbc的main / abc分支创建新分支?

You need to modify your config spec in order to create new versions starting from abc . 您需要修改配置规范,才能从abc开始创建新版本。 see for example " Where do new elements appear when mkelem is used? ": 参见例如“ 使用mkelem时新元素出现在mkelem ”:

element * CHECKEDOUT
element * .../bugfixAbc/LATEST
element * .../abc -mkbranch(bugfixAbc)
element * /main/0 -mkbranch(bugfixAbc)
element * /main/LATEST

The ellipsis .../ in a selection rule allows for ClearCase to select that branch abc , from whatever branch it comes from: /main , or any other branch. 选择规则中的省略号.../允许ClearCase从它来自的任何分支/main或任何其他分支中选择该分支abc

Using cleartool mkbranch is not the solution here: it won't scale if you have to do it for many files, and it creates a version 0 left in checked-out state, that you should checkin. 使用cleartool mkbranch并不是这里的解决方案:如果您必须对许多文件进行操作,它将无法缩放,并且会创建处于签出状态的版本0,您应该签入。 (or cancel the checkout, which would delete the branch) (或取消结帐,这将删除分支)

By using a config spec, you will create automatically that branch each time you checkout an element present in the abc branch. 通过使用配置规范,每次签出abc分支中存在的元素时,您将自动创建该分支。 Any element, not just a given file. 任何元素,而不仅仅是给定的文件。

I find out that I can give the path of the file like this: 我发现我可以给出这样的文件路径:

mkbranch -c "bugfix branch from abc" bugfixAbc util.java@@/main/abc/27

So, this created branch from abc branch with branch type bugfixAbc 因此,这是从abc分支创建的分支,分支类型为bugfixAbc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM