ClearCase - file system path to element path

穿精又带淫゛_ 提交于 2020-01-24 20:44:07

问题


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.

(I haven't found anything usable in CCElement.get_PathInView() or the various cleartool ls commands I've tried)


回答1:


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/ 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/ Build your load rule accordingly:

load \VOB\Folder

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

The OP comments:

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:

  1. start in 'D:\whatever\path\VOB\Folder',
  2. try a cleartool lsview -cview:
  3. if it respond correctly, cd .., and repeat 2.
  4. When it exit with an error, remove the substring of that directory from the initial path. What remains will be your load rule.


来源:https://stackoverflow.com/questions/2651808/clearcase-file-system-path-to-element-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!