如何提交任意目录树 [英] how to commit an arbitrary directory tree
问题描述
我正在寻找一个允许我向ClearCase提交任意目录树的过程。该树可能包含常规文件,目录和符号链接(到文件或目录的链接)。
I am looking for a process that would allow me to commit an arbitrary directory tree to ClearCase. The tree might contain regular files, directories and symlinks (to either files or directories).
我们专门使用动态视图,并且我的工作人员是年龄较大的团队成员在这种情况下,应遵循以下过程(假设我需要向ClearCase提交目录 foo
的整个结构):
We are working with dynamic views exclusively, and I have been given by older team members the following process to follow in such cases (assume that I need to commit to ClearCase the entire structure of directory foo
):
-
更改到显示
foo
的目录并签出:
ct checkout。
ct checkout .
将 foo
中的所有文件注册为ClearCase对象:
register all files in foo
as ClearCase objects:
ct mkelem -mkpath $(find foo -type f)
ct mkelem -mkpath $(find foo -type f)
检入新创建的ClearCase对象:
check-in the newly minted ClearCase objects:
ct ci $(ct lscheckcout -me -cvi -recu -sho foo)
ct ci $(ct lscheckcout -me -cvi -recu -sho foo)
commit
ct ci
以上似乎有效
例如,用于常规文件,但不存在符号链接时。如果我执行以下操作:
E.g. if I do the following:
mkdir foo && cd foo
touch a && ln -s a a2 && cd ..
…然后遵循上述过程(在步骤2中将 find
的咒语更改为使用 find -type f -o -type l
),步骤#1和#2成功执行:
… and then follow the above process (changing the find
incantation in step 2 to use find -type f -o -type l
), steps #1 and #2 execute successfully:
$ 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时,我得到:
… but when I try to execute step #3, I get:
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中?我正在寻找可以脚本化的东西,这样就不必手动,逐个文件,逐个目录等进行操作。脚本还可以使我在整个过程中应用相同的提交消息。
What's the process I should use to commit an arbitrary directory tree (with regular files, directories and symlinks) in ClearCase? I am looking for something that I can script away so that I don't have to do this manually, file by file, directory by directory, etc. A script would also allow me to apply the same commit message throughout.
在git中很简单:
git add foo
git commit -m 'foo added'
推荐答案
在ClearCase中提交任意目录树(包含常规文件,目录和符号链接)应该使用什么过程?
What's the process I should use to commit an arbitrary directory tree (with regular files, directories and symlinks) in ClearCase?
先尝试 clearfsimport
如何快速清除大写文件中的大量文件。
用于从任何文件夹(该文件夹可以在另一个视图或简单的OS常规文件夹中)添加大量文件到ClearCase视图(快照或动态,UCM与否)的官方命令。
Try first clearfsimport
that I detail in "How can I quickly checkin a large number of files in clearcase".
That is the official command for adding a large number of files from any folder (that folder can be in another view or a simple OS regular folder) into a ClearCase view (snapshot or dynamic, UCM or not)
不再有目标文件夹的结帐
,也没有 mkelem
: clearfsimport
会解决这个问题。
No more checkout
of the destination folder, no more mkelem
: clearfsimport
takes care of that.
您可以选择使用-跟随
选项:
处理UNIX或Linux符号链接指向的对象,而不是将链接本身导入VOB。
Processes the object to which a UNIX or Linux symbolic link points, instead of importing the link itself into the VOB.
这篇关于如何提交任意目录树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!