2013-03-20 52 views
1

我們有兩個「voba」和「vobb」的vobs。並且在vob中有一個目錄「abc」,並且包含相同的.h/.cpp文件。如何在clearcase vob中實現「cp -u」功能?

通常,「voba」中「abc」目錄中的文件更新頻率較高。而從時間的時候,我想從「voba的ABC」,這意味着更新「VOBB的ABC」的所有文件:

  1. 結帳更新的文件在vobb.abc,覆蓋它們,然後檢查
  2. 將新創建的文件複製到vobb.abc,創建元素。
  3. 通過corrspoding將vobb.abc中的已刪除文件刪除至voba.abc。

如果是一個普通的linux目錄,我認爲cp -u並實現了。但是談到清晰的案例,我只能手工完成上述1-3項。

有沒有簡單的方法來自動完成更新?

回答

0

這就是所謂的ClearCase中一個clearfsimport

由於在目錄中的元素(可能與-mirror option使用)兩個VOB的abc完全不同(不同的OID,具有不同的歷史),是什麼你可以做的是將abc的內容從一個vob導入到另一個vob:clearfsimport將自動檢出,更新和檢入源中已經演變的文件,並且需要在目的地中更新。


注意,這recent thread (March 2013)也指出了perl腳本ClearCase::SyncTree

It is superior to clearfsimport in many respects, especially in its evil twin avoidance (it will try with the proper options to link suitable entries from non visible versions).

說明:

This module provides an infrastructure for programs which want to synchronize a set of files, typically a subtree, with a similar destination subtree in VOB space. The enclosed synctree script is an example of such a program.

The source area may be in a VOB or may be a regular filesystem; the destination area must be in a VOB.
Methods are supplied for adding, subtracting, and modifying destination files so as to make that area look identical to the source.

Symbolic links are supported, even on Windows (of course in this case the source filesystem must support them, which is only likely in the event of an MVFS->MVFS transfer). Note that the text of the link is transported verbatim from source area to dest area; thus relative symlinks may no longer resolve in the destination.

+0

因爲我不是VOB的主人,我有我自己的分支vob,當我使用命令:clearfsimport -preview -master -follow〜/ t1/*/vobs/..../...我得到 錯誤:權限被拒絕:不是VOB所有者或特權用戶,我這樣做? – user2191818 2013-03-22 08:25:14

+0

@ user2191818你可以做任何結果的該vob中的任何文件? – VonC 2013-03-22 08:27:07

+0

@ user2191818另請參閱http://stackoverflow.com/questions/138321/how-can-i-use-clearcase-to-add-to-source-control-recursively#144310:您需要'-nset'選項爲你的'clearfsimport'命令。 – VonC 2013-03-22 08:28:24