问题
Let's say user raise a request:
I'm unable to deliver form stream "
spider_dev
"
And that user didn't mention view name as well.
How do I get the PVOB name?
Our ClearCase environment is too big (around 300 vobs). It's very difficult to go each and every vob and check.
回答1:
Assume you have been provided only the stream name "spider_dev"
and nothing else. After shaming the developer for not helping me help him, consider the following commands to cycle thru the vobs and locate the stream (I have not worked in multi-site, so YMMV, also tagged as Windows, so conversion to PowerShell/DOSShell req'd):
MY_STREAM=spider_dev # the stream you're looking for
Get a list of all the vobs:
VOB_LIST=$(cleartool lsvob| grep ucmvob| cut -c3-| awk '{print $1}')
# list all vobs, match ucmvob, chop the active indicator (*), print the value
Cycle through the vobs to find matching dev streams:
MY_STREAM=spider_dev # the stream you're looking for
for vob in ${VOB_LIST}; do
for stream in $(cleartool lsproject -obs -fmt "%[dstreams]p\n" -inv ${vob}); do
if [[ ${stream} == ${MY_STREAM} ]]; then
echo "!!! ${stream}@${vob}"
break
fi
done
done
Now that you know where the stream is, find the deliver status:
cleartool deliver -status -stream ${stream}@${vob}
The result will be of the form:
Deliver operation in progress on stream "stream:spider_dev@/vobs/my_pvob"
Started by "username" on "2016-03-15T12:34:56Z"
Using integration activity "deliver.activity".
Using view "user_view".
Activities will be delivered to the default target stream stream:spider_int@/vobs/my_pvob"
in project "project:spider@/vobs/my_pvob".
Baselines to be delivered:
You can of course wrap this up into a shell command, functions, batch script, etc. as appropriate. We have some 250 vobs w/4000 branches and had scripted many little utilities to help us manage many similar problems, so feel your pain.
Finally, remind the user next time help will be more forthcoming with more details and take inordinately longer when fewer details provided.
回答2:
One possibility is to look for any view named after the stream
cleartool lsview|grep -i spider_dev
(grep is available for Windows, or part of gow: Gnu On Windows)
If those views are also named after the user login, you can refine the search further.
Once you have the view, you have its stream with cleartool lsstream:
cleartool lsstream -l -view view_tag -anc
That should include the extended name of its UCM project (with its pvob).
回答3:
This is not quite possible if you have only the information provided in your example. Ideally, the user should provide the name of the stream in the following format
stream:<stream-name>@<pvob>
This is mandatory as there could be another stream named 'spider_dev' in another PVOB.
If the user does not know his PVOB (that can happen), you should try to get the name of the source VOB, i.e. the VOB containing the source code. If you manage to get the name of the source VOB, you can simply use the "cleartool desc" command. Typically, the command
cleartool desc -l vob:<source-vob-tag>
will list a lot of information, including the hyperlink of the VOB with its PVOB. That's how you would then obtain the name of the PVOB.
来源:https://stackoverflow.com/questions/35937296/how-to-get-pvob-name-by-a-given-clearcase-stream-windows