将Clear VOB中的Labeled Nodes从一个分支复制到另一个分支

时间:2011-12-29 01:46:57

标签: clearcase

我有两个分支:分支-1:稳定分支,分支-2:开发分支。

Branch-2中有几个签到节点。其中,大约3个节点有标签:L1,L2& L3:

x  [Branch-1: Stable Branch (only one node)]
   \ 
    x - x - x (L1) - x - x(L2) - x (L3) - x - x 

[Branch-2: Dev Branch (several checked-in
 nodes), 3 nodes labelled with: L1, L2, L3 => I want to copy these 3 nodes 
 to Branch-1]

请你提供明确的命令来执行此操作吗?

感谢。

最诚挚的问候,

Sandeep Singh

1 个答案:

答案 0 :(得分:0)

首先你需要一个dynamic view

因此,您可以定义动态视图以更新Branch1(即选择规则以-mkbranch Branch1结尾:有关您需要的三个选择规则,请参阅“How to create a branch”。

然后,您需要查找L1的每个相关版本并将其复制到当前视图之上,例如在Branch1create a L1B1 lbtype first中为该新版本添加不同的标签):
Windows语法:

 cleartool find . -ver "lbtype(LBL1)" \
 -exec "cleartool co -c \"LBL1 import\" \"%CLEARCASE_PN%\" ; \
        cp \"%CLEARCASE_XPN%\" \"%CLEARCASE_PN%\" ; \
        cleartool ci -nc \"%CLEARCASE_PN%\" ; \
        cleartool mklabel –replace L1B1 \"%CLEARCASE_PN%\""

(在一行中:cleartool find . -ver "lbtype(LBL1)" -exec "cleartool co -c \"LBL1 import\" \"%CLEARCASE_PN%\" ; cp \"%CLEARCASE_XPN%\" \"%CLEARCASE_PN%\" ; cleartool ci -nc \"%CLEARCASE_PN%\" ; cleartool mklabel –replace L1B1 \"%CLEARCASE_PN%\""

Unix语法:

 cleartool find . -ver "lbtype(LBL1)" \
 -exec "cleartool co -c \"LBL1 import\" \"$CLEARCASE_PN\" ; \
        cp \"$CLEARCASE_XPN\" \"$CLEARCASE_PN\" ; \
        cleartool ci -nc \"$CLEARCASE_PN\"; \ 
        cleartool mklabel –replace L1B1 \"$CLEARCASE_PN\""

(一行:cleartool find . -ver "lbtype(LBL1)" -exec "cleartool co -c \"LBL1 import\" \"$CLEARCASE_PN\" ; cp \"$CLEARCASE_XPN\" \"$CLEARCASE_PN\" ; cleartool ci -nc \"$CLEARCASE_PN\"; cleartool mklabel –replace L1B1 \"$CLEARCASE_PN\""

CLEARCASE_XPN引用可从动态视图访问的完整扩展路径名,CLEARCASE_PN引用没有扩展路径的路径,即@@之后没有部分。 cleartool find命令设置了环境变量,因此使用了%...%$

L2L3重复此操作,对于给定的文件,您将获得:

x - y (L1B1) - y (L2B1) - y (L3B1)  [Branch-1: Stable Branch (only one node)]
 \ 
  x - x - x (L1) - x - x(L2) - x (L3) - x - x 
相关问题