问题
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:
- 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.
来源:https://stackoverflow.com/questions/2651808/clearcase-file-system-path-to-element-path