ClearCase-文件系统路径到元素路径 [英] ClearCase - file system path to element path
问题描述
给出文件系统路径,例如 D:\pkirkham_view\VOB\文件夹
或 U:\VOB\ \Folder\
,是否有一种机制可以获取在config-spec中可以加载该文件夹 / VOB / Folder /的路径?
CAL或cleartool命令就可以了。这将在安装了ClearCase LT的客户端计算机上运行。
Given a file system path such as "D:\pkirkham_view\VOB\Folder
" or "U:\VOB\Folder\
", is there a mechanism to get the path which would work in the config-spec to to load that folder "/VOB/Folder/" ?
Either CAL or cleartool commands would be fine. This is to run on client machines with ClearCase LT installed.
(我在 CCElement.get_PathInView()中找不到可用的任何东西
或我尝试过的各种cleartool ls命令)
(I haven't found anything usable in CCElement.get_PathInView()
or the various cleartool ls commands I've tried)
推荐答案
没有本机命令,只有负载
There is no native command, but the only load rule you need is based on a vob name.
因此,您需要一个能够执行以下操作的脚本:
So you need a script able to:
1 /删除所有内容,包括视图
的名称(您可以通过'< aPathTo> \VOB\Folder\
获得该名称; cleartool cleartool lsview- s -cview)
1/ remove everything including the name of the view
(which you can obtain with a '<aPathTo>\VOB\Folder\
;cleartool cleartool lsview -s -cview)
D:\pkirkham_view\VOB\Folder => \VOB\Folder
U:\VOB\Folder\ => \VOB\Folder
2 /相应地建立加载规则:
2/ Build your load rule accordingly:
load \VOB\Folder
3 /将加载规则追加到您的配置规范中(如果您已经在视图中):
3/ Append that load rule to your config spec (if you are already within the view):
cleartool catcs > aConfisgpec.txt
echo "load \VOB\Folder" >> aConfisgpec.txt
cleartool setcs aConfisgpec.txt
OP注释:
The OP comments:
因此,如果我创建一个快照视图,其标签名称为
pkirkham_testing_view
'放在路径'D:\thursday
'上,子字符串提取方式如何?
So, if I create a snapshot view whose tag name is '
pkirkham_testing_view
' on path 'D:\thursday
', how is that a substring extract?
这很不错,因为可以用任何名称命名根目录。
我建议使用视图的标签命名该目录。
That is a good point, since one can name the root directory with any name.
I would recommend naming that directory with the tag of the view.
但这不是事实,您需要确定快照视图的根目录:
But that is not the case, you need to determine the root directory of a snapshot view:
- 以'
D:\whatever\path\VOB\Folder
'开始, - try
cleartool lsview -cview
: - 如果响应正确,请执行cd ..并重复2。
- 如果错误退出,请从初始路径中删除该目录的子字符串。剩下的就是您的负载规则。
- start in '
D:\whatever\path\VOB\Folder
', - try a
cleartool lsview -cview
: - if it respond correctly, cd .., and repeat 2.
- When it exit with an error, remove the substring of that directory from the initial path. What remains will be your load rule.
这篇关于ClearCase-文件系统路径到元素路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!