2013-03-20 68 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