2011-12-29 64 views
1

我有兩個分支:分支-1:穩定分支,分支-2:開發分支。將同一個VOB中的Labeled Nodes從一個分支複製到另一個分支清除

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] 

能否請您提供一個ClearCase命令來做到這一點?

謝謝。

最好的問候,

桑迪普·辛格

回答

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 
+0

非常感謝您的答覆。但是,如果我有一個龐大的代碼庫,是否有任何方法可以在僅使用標籤的幫助下做同樣的事情,而不是單獨處理單個文件? – 2011-12-29 13:44:46

+0

@SandeepSingh:請閱讀http://stackoverflow.com/questions/645008/what-are-the-basic-clearcase-concepts-every-developer-should-know/645771#645771:ClearCase總是以文件爲單位進行工作。但'cleartool find'可以幫助您爲每個使用特定標籤的版本應用一系列命令。所以你需要重複'cleartool find'命令,我只提到每個標籤名稱,而不是每個文件。它將檢出,複製,簽入併爲每個已標記爲「L1」的版本找到的文件應用一個新標籤('L1B1')。所以在這方面,你會在標籤的幫助下工作。 – VonC 2011-12-29 15:13:00

+0

非常感謝您的熱心幫助。 – 2011-12-30 06:54:51

相關問題