如何提交任意目录树

how to commit an arbitrary directory tree

我正在寻找一个允许我将任意目录树提交到 ClearCase 的过程。该树可能包含常规文件、目录和符号链接(指向文件或目录)。

我们只使用动态视图,老团队成员告诉我在这种情况下要遵循以下过程(假设我需要将目录的整个结构提交给 ClearCase foo) :

  1. 切换到出现foo的目录查看:

    ct 结帐。

  2. foo 中的所有文件注册为 ClearCase 对象:

    ct mkelem -mkpath $(find foo -type f)

  3. 签入新生成的 ClearCase 对象:

    ct ci $(ct lscheckcout -me -cvi -recu -sho foo)

  4. 提交

    ct ci .

以上似乎适用于常规文件,但在存在符号链接时无效。

例如如果我执行以下操作:

mkdir foo && cd foo
touch a && ln -s a a2 && cd ..

… 然后按照上面的流程(将步骤2中的find咒语改成find -type f -o -type l),步骤#1和#2执行成功:

$ ct co .
Checkout comments for ".":
.
Checked out "." from version "/main/dbdev_br/2".
$ ct mkelem -mkpath $(find foo -type f  -o -type l)
Creating parent directory element "foo".
Created directory element "foo".
Checking out parent directory "foo".
Created branch "dbdev_br" from "foo" version "/main/0".
Creation comments for "foo/a":
.
Created element "foo/a" (type "text_file").
Created branch "dbdev_br" from "foo/a" version "/main/0".
Checked out "foo/a" from version "/main/dbdev_br/0".
Creation comments for "foo/a2":
.
Created element "foo/a2" (type "text_file").
Created branch "dbdev_br" from "foo/a2" version "/main/0".
Checked out "foo/a2" from version "/main/dbdev_br/0".

… 但是当我尝试执行第 3 步时,我得到:

Checked in "foo/a" version "/main/dbdev_br/1".
Private version of "foo/a2" saved in "foo/a2.keep".
cleartool: Warning: Operation "view_change_oid" failed ("foo/a2"): Read-only file system.
cleartool: Warning: VOB updated, but view update of uncheckout of "foo/a2" failed: error detected by ClearCase subsystem.
Checked in "foo/a2" version "/main/dbdev_br/1".

在 ClearCase 中提交任意目录树(包含常规文件、目录和符号链接)应该使用什么过程?我正在寻找可以编写脚本的东西,这样我就不必逐个文件、逐个目录等手动执行此操作。脚本还允许我在整个过程中应用相同的提交消息。

在 git 中它会很简单:

git add foo
git commit -m 'foo added'

What's the process I should use to commit an arbitrary directory tree (with regular files, directories and symlinks) in ClearCase?

先试试clearfsimport that I detail in "".
这是从任何文件夹(该文件夹可以在另一个视图或简单 OS 常规文件夹中)添加大量文件到 ClearCase 视图(快照或动态,UCM 或非 UCM)的官方命令

不再有目标文件夹 checkout,不再有 mkelemclearfsimport 负责。

您可以选择使用 -follow 选项:

Processes the object to which a UNIX or Linux symbolic link points, instead of importing the link itself into the VOB.