【问题标题】:how to commit an arbitrary directory tree如何提交任意目录树
【发布时间】:2017-07-11 07:47:27
【问题描述】:

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

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

  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'

【问题讨论】:

    标签: clearcase


    【解决方案1】:

    在 ClearCase 中提交任意目录树(带有常规文件、目录和符号链接)的过程是什么?

    首先尝试我在“How can I quickly checkin a large number of files in clearcase”中详细说明的clearfsimport
    这是将大量文件从任何文件夹(该文件夹可以在另一个视图或简单的操作系统常规文件夹中)添加到 ClearCase 视图(快照或动态,UCM 与否)中的官方命令

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

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

    处理 UNIX 或 Linux 符号链接指向的对象,而不是将链接本身导入 VOB。

    【讨论】:

    • 当我尝试$ clearfsimport -recu foo . (提交目录foo 时)我得到:clearfsimport: Error: Permission denied: not VOB owner or privileged user. clearfsimport: Error: Unable to import into ".".。如果我尝试$ ct clearfsimport 我会得到cleartool: Error: Unrecognized command: "clearfsimport"
    • @MarcusJuniusBrutus 否:将 foo 文件夹移动到视图“外部”,然后将其 clearfsimport 回视图中。
    • 我把它移到了某个临时目录,然后做了:clearfsimport ~/tmp/foo/ . 同样的问题:clearfsimport: Error: Permission denied: not VOB owner or privileged user. clearfsimport: Error: Unable to import into ".".
    • @MarcusJuniusBrutus 你忘记了 -nset 选项:stackoverflow.com/a/144310/6309
    猜你喜欢
    • 1970-01-01
    • 2012-05-05
    • 2011-04-19
    • 1970-01-01
    • 2017-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多