2011-08-26 60 views
2

因此,我正在編寫一個腳本,我必須通過ClearCase vob中的所有項目,查找文件並從該文件解析某些信息。
當然,我不想加載每一個項目,所以我使用cleartool來檢索卸載的文件。
首先,我正在使用find命令來查找這些文件。這是我第一次嘗試:用cleartool獲取卸載文件的特定版本

root>cleartool find C:/viewpath -name file.txt -version "lbtype(Version-label)" -print -nr 

Viewpath是我正在查找文件的項目的路徑。我正在尋找的文件是版本標籤指定的版本上的file.txt
儘管我知道該版本中存在file.txt,但這並沒有給我帶來任何結果。
我想通過老版本的目錄來查看最新的主分支,這是在file.txt被添加到目錄之前。我嘗試這樣做,而不是:

root>cleartool find C:/[email protected]@/Version-label -name file.txt -version "lbtype(Version-label)" -print -nr 

,得到了這樣的結果,這是我一直在尋找

C:/viewpath\[email protected]@\main\branch\41 

所以,現在,我知道我能找到我試圖得到它的文件。

root>cleartool get -to savepath C:/viewpath\[email protected]@\main\branch\41 

這給了我這樣的結果

cleartool: Error: "C:/viewpath\[email protected]@\main\branch\41" does not exist, or is not a ClearCase version, or is a checked out version which was removed. 

也試過

root>cleartool get -to savepath C:/viewpath\[email protected]@/Version-label 

具有相同的結果,我可以被添加到目錄

文件時,它仍然在主分支,所以它仍然在通過主分支上的目錄進行搜索,其中file.txt現在是可以找到。
如何告訴它在從main分支後查看目錄的版本?

回答

2

我真的會推薦你在動態視圖中嘗試這些相同的命令。
illustrated here一樣,通過動態視圖,您可以訪問擴展路徑[email protected]@/branch/version語法),這意味着像get這樣的命令將起作用。
您在this question中使用擴展路徑的搜索示例(cleartool find)。

如「In ClearCase, how can I view old version of a file in a static view, from the command line?」中所述,您可以在動態視圖中瀏覽(如'change directory to')文件的各種擴展路徑。

+0

有關動態視圖,請參閱http://stackoverflow.com/questions/2923328/what-are-the-differences-between-a-snapshot-view-and-a-dynamic-view/2925378#2925378。 – VonC

+0

我在這裏只是一名夏季工作者,不幸的是,在動態或靜態視圖應該被使用時,他們沒有發言權。有沒有辦法用靜態視圖來實現這一點? – Nait

+0

@Nait:是的,通過比較差異,因爲我的最後一個鏈接說明(http://stackoverflow.com/questions/176858/in-clearcase-how-can-i-- view-old-version-of-a-file-在-A-靜態 - 視圖 - 從最COM/177350#177350)。但動態視圖正好可以訪問和explorer * all *版本(並且你完全可以使用相同配置的快照和動態視圖)。 – VonC