In this example, the user5628 (which is actually sick) has a checked out file in its dynamic view. How can I cancel this checkout?
$ ct lsco -all | ag foo
2013-08-29 user52001 checkout version "L:\a\path\foo.c" from \main\branch_a\0 (reserved)
2014-04-10 user5030 checkout version "L:\a\path\foo.c" from \main\branch_b\0 (reserved)
--11-18T08:29 user52212 checkout version "L:\a\path\foo.c" from \main\branch_c\1 (reserved)
--04-15T14:24 user5628 checkout version "L:\a\path\foo.c" from \main\branch_d\11 (reserved)
--04-30T08:05 user5072 checkout version "L:\a\path\foo.c" from \main\branch_d\11 (unreserved)
As I mentioned in "ClearCase: Is it possible to cancel checkouts not made from your own view?", the easiest way is to remove the "checkout" status for user5628 view.
cleartool descr -l vob:\avob
# get user5628 view uuid in the output
cleartool rmview -force -uuid (uuid_of_the_view) -vob \aVob
That will not modify any of user5628's checked out files (the modification are not lost), but user5628 will have to check them out again.
That same technique is useful when you have old checked out files in a view which has since then been deleted.
Related
$ cleartool rmstream stream:tiger#/vobs/forest
Remove stream
"stream:tiger#/vobs/forest"? [no] yes
cleartool: Error: No tag in region for view "d6ca911d.229a41bb.942b.fd:ed:f2:bb:5c:f8".
cleartool: Error: Unable to remove stream "stream:tiger#/vobs/forest".
how to find out which site has clearcase view uuid d6ca911d.229a41bb.942b.fd:ed:f2:bb:5c:f8?
The IBM technote swg21127922 does list a MultiSite environment and the view existing at a different replica site as a possible cause for this error message.
It might not be mandatory to switch to the site referencing that view to move forward though.
The steps described to resolve the issue involve removing the view by its uuid in the pvob of the stream.
I used that technique (rmview --uuid) before in "Removal of clearcase views involves any housekeeping?".
For instance:
cleartool lsstream -l stream_name#\pvob.
The output will include:
views:
98573bec.d7e34570.a71c.e8:ab:7c:50:d4:02
Then:
ct desc -l vob:\ford_pvob
The output include:
VOB holds objects from the following views:
f15eagle:d:\ClearCase_Storage\views\RATIONAL\evchan\evchan_proj1_2.vws [uuid 98573bec.d7e34570.a71c.e8:ab:7c:50:d4:02]
You will need change directory (cd) into the PVOB
Example:
W:\>cd ford_pvob
W:\ford_pvob>
Remove the view reference from the PVOB using, cleartool rmview -uuid uuid_number
Note: By adding the -all switch, you will ensure to remove the view reference from the PVOB and any UCM Component VOBs that may also have a reference from this view; cleartool rmview -all -uuid uuid_number.
In this particular example, the -all was not required since we are only removing the view reference from the PVOB.
Example:
W:\ford_pvob>ct rmview -uuid 98573bec.d7e34570.a71c.e8:ab:7c:50:d4:02
Removed references to view "f15eagle:d:\ClearCase_Storage\views\RATIONAL\evchan\evchan_proj1_2.vws" from VOB "\ford_pvob".
Now the stream can be removed, using cleartool rmstream stream_name#\pvob
Example:
W:\ford_pvob>ct rmstream evchan_proj1_2#\ford_pvob
Remove stream "evchan_proj1_2#\ford_pvob"? [no] y
Removed stream "evchan_proj1_2#\ford_pvob" .
I'm trying to write a script to get the vob with the help of cleartool.
I have the activity id, the stream name and the stream location as input. From this I need to get the vob.
cleartool lsvob -short is pretty much what I need, but I only need the vob of the activity and stream.
cleartool describe -cview view-location did also not help.
Does anyone have an idea how to achieve this?
EDIT:
cleartool descr -cact leads to the following:
activity "ActivityID"
created 2014-12-15T13:53:49+01:00 by User
master replica: HES#\vob
owner: dom\owner
group: group
stream: stream#\vob
current view: view name
title: Title
change set versions:
...changes
Attributes:
activity_ok = "yes"
Delivered = "no"
Finished = "no"
Type_Activity = "User"
If you execute a cleartool describe from within the view, it should pick up on the "vob of the activity" (meaning the PVob which is an admin vob of the current UCM root-based component vob that the view is accessing)
cd /path/to/my/view/vobs/MyVob
cleartool descr -cact
cleartool descr -fmt "%Xn" -cact
That should return the name of the currently set activity followed by #/vobs/ThePVob.
ThePVob is the tag you are looking for: it will be the same for all activities in that stream.
Using fmt_ccase, you can limit the output to the fully qualified name of the current activity: activty#\.
I have tried to get the full history of a clearcase vob to parse it and use it with gource to get a visual representation of the changes, but I do not find the right commands to get an easy log history to parse with clearcase2gource python script. I do not use UCM, there are no streams, just plain cleacase.
With this command I get elements with ## in the middle of a path:
cleartool lshistory -fmt "Element: %n| Date: %d| User:%u| Operation: %e| Object:%[type]p| SimpleType: %m| OperationKind: %o\n" -all /vobs/vob_name
With this command I get elements like this (deleted at some point):
Element: /vobs/vob_name/dir1##/main/branch_dev/2/dir2/main/branch_pilot/1/file##/main/branch_pilot/1| Date: 2008-04-15T16:58:28+02:00| User:reeasjp| Operation: create version| Object:compressed_file| SimpleType: version| OperationKind: checkin
That makes more difficult to parse for gource because of several branch names in the middle.
Is there any way to get a full history of all the elements with just plain directories and file names?
Thanks in advance.
NOTE: In the config Spec I have just "/main/LATEST".
The issues are:
clearcase2gource.py processed the extended paths (see "About the version-extended path") found by cleartool lshistory with some hard-coded assumptions.
e = d['Element']
splitElement = e.split("##")
d['FileName'] = splitElement[0]
d['StreamName'] = splitElement[1]
# StreamName starts with /main/ which we aren't interested in.
# Remove the /main/ (slice on 5 because there are 5 chars in /main/)
d['StreamName'] = d['StreamName'][5:]
the cleartool lshistory --all will list history of deleted elements (non-visible anymore in the current ClearCase view), hence the multiple branch names.
The easiest solution would be to:
redirect the cleartool lshistory output to a file, and
then filter out all the extended paths which don't conform to clearcase2gource.py expectation: for instance, just for testing, keep only the ones in a specific branch or in /main only, just to see if that works better.
finally feed that file as input to clearcase2gource.py
I want to receive an e-mail notification on completion of every CPM. I am using IBM rational Clearcase(UCM).Please let me know if there is any script to do this?
Thanks
Sooraj
What is CPM? The Core Protection Module of Tivoli?
Anyway, you can setup post-operation trigger for email notification, as commented in the Ten Best Script page.
A complete example can be seen in ClearCase Help pages "E-mail notification postoperation trigger script".
It setup includes, for an UCM deliver operation:
creates a postoperation trigger type that fires when a developer finishes a deliver operation, as represented by the deliver_complete opkind.
The mktrtype command uses the -stream option to indicate that the trigger type applies only to deliver operations that target the specified integration stream.
# This is a Perl script to set up the triggertype
# for e-mail notification on deliver.
use Config;
# define platform-dependent arguments.
my $PVOBTAG;
if ($Config{'osname'} eq 'MSWin32') {
$PVOBTAG = '\cyclone_pvob';
$WCMD = '-execwin "ccperl \\\\pluto\disk1\ucmtrig_examples\ex2\ex2_postop.pl"';
}
else {
$PVOBTAG = '/pvobs/cyclone_pvob';
$WCMD = '-execwin "ccperl \\\\\\pluto\disk1\ucmtrig_examples\ex2\ex2_postop.pl"';
}
my $STREAM = "stream:P1_int\#$PVOBTAG";
my $TRTYPE = "trtype:ex2_postop\#$PVOBTAG";
my $UCMD = '-execunix "Perl /net/pluto/disk1/ucmtrig_examples/ex2/ex2_postop.pl"';
print 'cleartool mktrtype -ucmobject -all -postop deliver_complete $WCMD $UCMD -stream $STREAM -nc $TRTYPE';
The key part is:
cleartool mktrtype -ucmobject -all -postop deliver_complete
I am trying to create a new snapshot view on my machine and i am using the following procedure:
creating the view using
ct mkview -snapshot -tag testview -vws /home/store/testview.vws /home/view/testview
here the view gets created but fails to register
which i register using the ct update on this /home/view/testview location
tried to change the configspec using
ct edcs &
but got error "cleartool: Error: Cannot get view info for current view: not a ClearCase object."
explicitly modifying the config_spec using vi editor, and the updating the view ends up creating a log...but no files are copied :(
Can someone please direct me as to where i am going wrong?
What is your error message on the snapshot view creation?
Something like:
cleartool: Warning: Unable to register new snapshot view: not a ClearCase object
snapshot view may not be recognized by some commands.
Created snapshot view directory "yourServer".
Server view_server (pid=2842) on "/home/store/testview.vws" died on startup; marking it as "down".
?
Any "Unable to register new snapshot view" message will mean that you are ot able to edit your config spec (so ct edcs will fail)
Try to specificy all the argument for your storage path:
ct mkview -snapshot -tag testview \
-vws /home/store/testview.vws \
-host yourServerName \
-hpath /home/store/testview.vws \
-gpath /home/store/testview.vws \
/home/view/testview
(is your view server on the same server than your view?)