Clearcase Commands
Clearcase Commands
ClearcaseCommands:
ClearcaseClientCommands:
ThistutorialcoverstheIBM/RationalClearcasecommandsusedfortheClearcasechangemanagementsystem.
ForinstallationoftheIBM/RationalClearcaseClientonLinuxseeYoLinuxClearcaseClientInstallationTutorial
ForInstallationoftheIBM/RationalClearcaseServeronLinuxseeYoLinuxClearcaseServerInstallationTutorial
search
Search
|HomePage|LinuxTutorials|Terms|PrivacyPolicy|Advertising|Contact|
ClearcaseUserCommands:
Configureuseraliases:
File:$HOME/.bashrc
File:$HOME/.cshrc
aliasct=/usr/atria/bin/cleartool
aliassv='/usr/atria/bin/cleartoolsetview'
umask022
aliasct/usr/atria/bin/cleartool
aliassv'/usr/atria/bin/cleartoolsetview'
umask022
Thisumaskwillsetthedefaultprivilegesonnewfilesanddirecotries.Defaultprotectionwillbesetsothattheusermaywritedatabut
otherscanread.
Commands:
ClearCaseCommand
ctver
Description
DisplayClearcase,cleartool,db_serverandVOBdatabaseschemaversion.
ctlsvob
Listvobmounttable:
*/vob/VOBNAME.vbt/hosts/hostname/r1vob/vobs/vobstore/VOBNAME.vbspublic
*/vob/practice_vob.vbt/hosts/hostname/viewname/Vobs/vobstore/practice_vob.vbspublic
ctdumpelementorDO
ctlsview
PrintinternalClearcaseinfo.
Listallviews:
millesc_view/hosts/hostname/viewname/Views/millesc_view.vws
*username/hosts/hostname/viewname/Views/reg_view.vws
ctlsviewviewtag
ctmktagviewtagdynamicviewname
nstart/hosts/node
name/home/cleardata/views/dynamic
viewname
Listviewpath.
CreateaviewtagorVOBtag.
or
ctmktagvobvobtag...
ctmkviewtaguser1_viewstgloc
viewstore
Createanewviewin"viewstore"Clearcaseserverviewmountpoint(seeYoLinuxclientor
serverinstallationtutorial).
Listviewstoragelocations:ctlsstgloc
ctmkviewtagtmpA_view/hosts/node
name/home/cleardata/views/tmpA_view
Createanewview.
ctsetviewusername_view
ctstartviewcommon_view
Setcurrentviewtousername_view.
Setcurrentviewtocommon_viewwithoutstartingaClearcaseshellenvironent.Itallowsoneto
view(only)thefiles.Path:/view/common_view/vob/vobname/...
ctendviewcommon_view
ctendviewserverusername_view
DeactivateaClearcaseview.(Firstexitview)
UsefulifyougetstaleNFShandles.
ctrmviewtagtemp_view
or
ctrmviewtemp_view
Removeviewtemp_view.
cleartoolsetviewusername_view
svusername_view
SetClearcaseview.Seealiasdefinedabove.
ctpwv
Printworkingview/currentview:
Workingdirectoryview:username_view
Setview:username_view
echo$CLEARCASE_ROOT
ctlsl
ctlsvob_only
Printcurrentviewpath.
Usingcurrentview,showfiles,privatefiles,fileversionandrule.
vob_only:Listelementsandnotderivedobjects
Format:
...
versionfile.ext@@/main/2Rule:element*/main/LATEST
directoryversionDirectoyname@@/main/2Rule:element*/main/LATEST
viewprivateobjectfile2.c
...
ctlstypekindlbtypelistlabels
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
1/11
07/12/2015
ctlsvtreeallfilename.ext
ClearcaseCommands:
Listlabels
Listfileversionlabelandbuildlabel:(versiontree)
filename.ext@@/main
filename.ext@@/main/0
filename.ext@@/main/1(BUILD_1_0)
filename.ext@@/main/2(BUILD_1_1)
Listfileversionlabelandbuildlabelforfilesbeginningwith"pref"
Listfileordirectoryversionhistory.
Listeventrocordsforagivenfile.
ctcheventc'newcommentgoeshere' Changethecommentonaversionofanelement.
replaceeventeventid
Lookupeventid:ctlsheventfileorelement
ctlsvtreeallpref*
ctlshistory[all]fileordirectory
ctlshistoryfilename
ctcheventc'newcommentgoeshere'
replacelbtypelabel
Changethecommentonalabel.
ctlsco
ctlscor
ctlscoavobsme
ctlscoavobscview
Listallcheckedoutfilesincurrentdirectory.
Flag"r"recusivlylooksinsubdirectories.
Listallfilescheckedouttoallviews.
Listcheckoutsinview.
Listcheckedoutfiles.
(same)
Listfilesincurrentdirectoryandsubdirectoriescheckedouttoyouincurrentview.Omitcview
tagtogetall.
Listconfigurationrecordforafile.
ctlscheckoutl
ctlscol
ctlscorecursivemecview
ctcatcrfilename
ctfind./branch'brtype(branch
name)'print
ctfind./version(main/LATEST)&&\!
version(LABEL_X)'print
Listfilesinbranchwithsearchnameorattribute.
Listfileswithlabel"LATEST"butnotLABEL_X.
ctlsprivate
ctlspco
Listallprivatefilesincurrentview.ViewprivatefilesarefilesresidingintheClearcase
filesystembutnotunderthecontrolofClearcase.i.e.objectfilesasaresultofacompile.May
notbeviewablebyothers.
Listfilescheckedouttocurrentview.
Createalabeltobeusedlater.
ctfindavobsnxnameelement
'brtype(view_name)'print
ctmklbtypencLABEL_NAME
ctmklbtypec"comment"LABEL_NAME
ctlstypekindlbtypeshort|sort
ctdescribelfile.ext
ctdescribefileordirectory
Listlabels.
DescribeobjectinVOB.Listsbranchandversionoffileandconfigspecusedinview.
Listfileordirectoryinformation.
ctdescribelongelement:fileor
directory
Listfileordirectoryinformation.
ctdescribelongvob:/vob
Listvobinformation.
Applylabeltoafile.
Labelelementsindirectorytree.
ctmklabelLABEL_NAMEfilename.ext
ctmklabelrLABEL_NAME
ctmklabelreplaceNEW_LABEL_NAME
filename.ext@@/main/4
Applylabeltoanewerversionofthefile.
ctrmtypermallforce
lbtype:LABEL_NAME
ctrmtypelbtypermallLABEL_NAME
Removealabelofthenamegiven.Theoption"rmall"causestheremovalofallinstancesof
thelabelonallfiles/directories.Removelabeltypeandalloccurrencesofthelabel.
ctrmtypelbtype:LABEL_NAME
ctrmtypermallbrtypebranchtype
ctfindavobsversion"lbtype
(BuildLabel)"print
ctfind.name'*.[hc]'element
'lbtype_sub(LABEL_NAME)'print
ctconcfilename
ctmkdirdirectoryname
RemovelabelfromClearcase.Itwillnotberemovediflabelhasbeenapplied.Useoption"
rmall"toremovelabelandallinstancesofitsapplication.
Removebranchandallfiles/directoriesinbranchfromClearcase.Datadisposedin"lost
found".
Printallfilesandfileversionsgoingintobuildspecified.
listall.hand.cfileswhiththegivenlabel.
CheckOutfile(RCScommand)NoComment
Createadirectory.Checkoutparentdirectoryfirst.
ctlnssourcedirectorynamelocal
directoryname
Createasymboliclinktoadirectory.Checkoutparentdirectoryfirst.
ctmkelemcincfilename
AddfiletoClearcasecontrol.
ctrmelemfilename
RemovefilefromClearcasecontrol.Allhistoryandknowledgeoftheelementiscompletely
removed.Bycontrast,the"ctrm"commandwillremovethefileandnotthehistoryandthe
directorymustbecheckedoutinordertomakethischange.
RemovefilefromClearcasecontrolandremoveprivateviewfile.
Removedirectory,revisionhistoryanditscontentsfromClearcasecontrol.
ctrmelemrmfilename
ctrmelemdirectoryname/*
ctrmverfilename@@/main/LATEST
or
ctrmverfilename
or
RemovelatestversioncheckedinofthefilefromClearcase.Secondexampleremovesversion
22fromtheClearcasechangemanagementsystem.Previousversionswillbeavailablefrom
thearchive.
ctrmverfilename@@/main/22
orremovespecifedversiononmain
branch:
ctrmverforcexlabelver/main/22
fileorelementname
ctrmfilename
RemovefilefromClearcaseview.Firstperformacheckout("ctco")ofthefileanddirectory.
Pastversionswillbeavailablefromthearchivealthoughnotvisibleincurrentview.Saferthan
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
2/11
07/12/2015
ctreservefilename
ctuncofilename
ctuncormfilename
ctuncheckoutfilename
ctcounrncfilename
ctcheckoutunreservedfilename
ctcifilename
ctdiffgraprefilename&
ctdiffpredfilename
ctxdiffpredfilename
ctmvfilename_Afilename_B
ctprotectrchmod775directoryor
filename
ClearcaseCommands:
"ctrmelem"whichremovesallknowledgeofthefileoldandnew.
Lockfile.Convertunreservedcheckouttoreserved.
UNCheckOutfile.Cancelacheckoutofafile.
Cancelacheckoutofafileandremovefilewhichwascheckedout.Notremovedfrom
Clearcase,justviewprivatethecheckedoutfileisdeleted/cleanedup.
Checkoutfileeventhoughfileischeckedoutbyanother.Checkout"unreserved",mustbe
mergedatalatertime.
Notlocked.Checkouttoread,print,etc.Sameasabovecommand.
CheckInfile.(alsoctcheckinfilename)Entercomment,enter"."assolecharacteronlineand
enter.
GraphicalDiff/Mergetool.
Clearcasediffbetweencurrentfileandpredecessor.
Xwindowsdiffwithpredecessor.
Renameafile.Besuretocheckouttheparentdirectoryfirst.Ifmovingfiletoanewdirectory,
checkoutthetargetdirectoryaswell.
Setdirectory/file/elementprotection.
Configspeccommands
ctcatcs
Printrulesofcurrentview(configspec):
ctcatcstagview_tag
element*CHECKEDOUT
element*/main/LATEST
ctedcs
Lookattheconfigspecassociatedwithanotherview.
Editcurrentrulesofview(configspec):
Changefrom:
element*CHECKEDOUT
element*/main/LATEST
To:
element*BuildLabel
elementdirectory*/main/Latest
Closevi:wq
Setconfigspecforview"username_view"?[yes]
ctsetcsdefault
ctsetcscur
ctupdateadd_loadrules
Resettodefaultviewrules.
Reevaluatecurrentconfigspec.
Updateselemetsinsnapshotview.GUItool.ReevaluatesconfigspecandreselectsVOB
elementstoshow.Theoption"add_loadrules"allowsyoutoloadrulestoyourconfigspecand
loadelementswhichsatisfytherules.
HelpandInformationcommands
ctmanclearcasecommand
ctmanenv_ccase
ctapropossearchword
cthelp
cthelpclearcasecommand
ManpageforClearcasecommand.
ListClearcaseenvironmentvariables.
ListcommandsandmanpagesummariesforrelatedClearcasecommand.
Helpfacility(simple).Listspossiblecommandarguments.
Tree/Branchcommands
ctlstypekindbrtype
ctlstypekindbrtypeinvob
/vob/vobname
Listallbranches.
Listallbranchesinthevobspecified.
ctfindavobsversion
'brtype(branchtype)'print
FindallfilesofthespecifiedbranchnameinallmountedVOB's.Findbranchnamewiththect
lstypecommand..
ctlsvtreeall*
ctlsvtreefilename
ctlsvtreegfilename
Listversiontrees(labelsandbranches)offiles(eventhosewithoutlabelsorbranches).
Listallbranchesofspecifiedfile.
LaunchGUIdisplayandshowversiontree(labelsandbranches)foragivenfile.
([PotentialPitfall]:YoumayhavetoissuethecommandexportLANG=CpriortolaunchingGUI.)
ctchtype
Changeelementtypeorrenamebranch.
Createanewbranchinversiontree.Usethecommandmkbrtypetocreatethebranchtype
(name)first.Thiscommandalsochecksoutthefile.Theconfigspecneedstoincludethis
branchsofilecanbeviewed.
ctmkbranch
ctmkbranchncbranchnamefileto
branch.cpp
ctrmbranch
ctmkbrtype
mkbrtypec"Commentgoeshere"
branch_name
Removeabranchinversiontree.
Createanewbranchtypeobject.
ctmerge
Mergechanges/differencesofafilefromanotherbranch.
ctfindmerge
ctfindmerge./ftagVIEWTAGprint
Determineswhetheramergeisrequiredforafileinyourview.
Findfilesincurrentdirectorytreewhichneedtobemerged.Usethedescribecommandtosee
ifbranchhasbeenmerged.Ifsoitwilbestatedassuch.
DerivedObjectscommands
ctrmdo
Listderivedobjects.
Removeaderivedobject.
ctwinkin*.o*.aexecutables
Winkinaderivedobject.
ctlsdol
Admincommands
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
3/11
07/12/2015
ClearcaseCommands:
clearexport_ffilerdirectoryname
Createfilecvt_datawhichistheresultofarecursiveexportoffilesfromgivendirectoryname..
clearlicense
Listnumberofallowableclientconnectionsandlistwhoisholdingalicense.
Releaselicensefromuserwhoisholdingalicense.
clearlicensereluser
getcache
ctgetcachemvfs
DisplayClearcasevieworMVFScacheparameters.
Troubleshootbylistingcachemisses(Cachemissesarebad).Performthiscommandonthe
serveritself.
getlog
ExamineClearcaselogfiles.
hostinfo
DisplayconfigurationdataforaClearcasehost.
lock
ctlockvob:/vob/project
ctlockbrtypeobsolete
branchtype
ctlocklbtype:LABEL_NAME
ctlockfilename.cpp
ctlocknusersuser1,user2
brtype:branchX
CommandtolockaVOB,element,branch,typeobjectorstoragepool.
Lockvobforreadonlyaccess.Disablewrite,create,delete,modify
Hidebranchpermanently.
Lockcodewithgivenlabel.
Lockafilefromuse.
Lockallusersexceptuser1anduser2onbranchX
unlock
ctunlockbrtypebranchtype
UnlockaVOBobject.
lslock
Listlocks.
lsclients
lsreplica
Listclientlistforlisenceorregistryhostserver.
ListreplicasofaVOB.
mkpool
CreateormodifyVOBstoragepool.
rmpool
RemoveastoragepoolfromaVOB.
Liststoragepools.
lspool
chpool
mkregion
rmregion
lsregion
mktrigger
rmtrigger
mktrtype
mkvob
ctmkvobtagVOBtagc"comment"
/vobpath
Changethestoragepooltowhichanelementisassigned.
RegisteranewClearcasenetworkregion.
UnregisteraClearcasenetworkregion.
ListClearcasenetworkregion.
Attachatriggertoanelement.
Removetriggerfromanelement.
Createatriggerobject.
Createandregisteraversionedobjectbase.
rmvob
ctrmvob/vobpath
RemoveaVOB.
lsvob
ListofmountedVOBs.
checkvob
FixinconsistanciesbetweenVOBdatabaseandstoragepools.
protectvob
ChangeownerorgroupofaVOB.
UpdatetheformatofaVOB.Usecommand"ctver"tofindthecurrentVOBdatabaseschema
version.
RemoveaVOBtagfromastorageregistry.
reformatvob
rmtag
complete_migration
mount
ctmountVOBtag
TakeVOBoutofmigrationmode.
ActivateaVOB.
unmount
ctumountVOBtag
DeactivateaVOB.
("ctdescribevob"toshowVOBinfo/owner)
register
CreateanentryintheVOB/viewstorageregistry.
unregister
RemoveaVOB/viewfromstorageregistry.
MoveelementsanddirectorytreesfromoneVOBtoanother.
relocate
rename
AsignanewnametoaClearcaseobject(i.e.pool,replica,label).Usemvtochangethename
ofafileordirectory.
setcache
ctsetcacheviewhostcachesize
1024k
ctsetcacheviewsitecachesize2m
ctsetcacheviewcachesize5m
view_tag
SetClearcasevieworMVFScacheparameters.
Setcachesizeforallviewsonserverto1024Kb.
Setcachesizeforallviewssitewideto2Mb.
setcachesizeforasinglespecifiedview.
Viewwithctlssiteinquire
mvfscache
ControlsandmonitorsMVFScaches(dynamicviewsonly).
Listsitewidepropertiesinthesiteconfigregistry.
ctlssiteinquire
setsite
Setsorunsetssitewidepropertiesinthesiteconfigregistry.
Viewcachesize
defaultsforWindowsclients
defaultsforchechinandcheckoutpreserve
space
ReportVOBdiskspaceusage.
GUItools:
/usr/atria/bin/xclearcase&
/usr/atria/bin/xcleardiff&
/usr/atria/bin/xlsvtree&(Sameasxclearcasevtree)
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
4/11
07/12/2015
ClearcaseCommands:
[PotentialPitfall]:YoumayhavetoissuethecommandexportLANG=CpriortolaunchingGUI.
EnvironmentConfiguration:
FreeInformation
Technology
Magazinesand
Document
Downloads
Advertisements
Getshellconfigfilesamplefromnodename:/home/vobadm/config/.bashrc,.cshrc,.kshrc.
Sample$HOME/.bashrc
exportCLEARCASE=/usr/atria
...
exportPATH=$CLEARCASE/bin:$PATH
...
aliasct='cleartool'
aliassv='cleartoolsetview'
aliassvg='cleartoolsetviewusername_view'
...
MACH=`unamen`
ID=`/usr/bin/id|/usr/bin/sede's/^uid=[09]*(//'e's/).*$//'`
PS1='$MACH:($ID)$PWD>'
if[$PS1]
then
if[$CLEARCASE_ROOT]
then
exportPS1='[`basename$CLEARCASE_ROOT`]\h:(\u)\W>'
fi
fi
SampleUnixClearcasesessions:
Makechangestoafile:
nodename:(username)/home/username>cleartoolsetviewusername_view
nodename:(username)/home/username>cd/vob/vobname/src/subdirectory
[username_view]nodename:(username)subdirectory>ctconcfilename.cpp
editfile
[username_view]nodename:(username)Directorynamectcifilename.cpp
Addcommentshere.
.
exit
Commentsterminatedwithadot(.).UseexittogetoutofClearcaseviewandreturntoUnixshell.
AddnewfiletoClearcasecontrol:
[username_view]nodename:(username)subdirectory>ctconc.
[username_view]nodename:(username)subdirectory>cp/..../newfile./
[username_view]nodename:(username)subdirectory>ctmkelemcincnewfile
[username_view]nodename:(username)subdirectory>ctcinc.
Checkoutdirectory(.),copyfileandaddittoclearcasecontrol.Thencheckindirectory.Directoryneededupdatingto
reflectchangetoitscontents.Notethatnewfilesaddedtothedirectorycannotbeviewedbyothersuntilthe
directoryischeckedin.ExampleofaddingallfilestoClearcasecontrol:ctmkelemcinc*
AddnewDirectorytoClearcasecontrol:
[username_view]nodename:(username)subdirectory>ctconc.
[username_view]nodename:(username)subdirectory>ctmkdirDIRECTORYNAME
[username_view]nodename:(username)subdirectory>ctcinc.
...
Addfilestodirectory.
...
[username_view]nodename:(username)subdirectory>ctcincDIRECTORYNAME
ClearcaseLabels:
[username_view]nodename:(username)subdirectory>ctmklbtypencRELEASE_NAME_#.#.#
(or:ctmklbtypeordinaryRELEASE_NAME_#.#.#)
[username_view]nodename:(username)subdirectory>ctmklabelrecurseRELEASE_NAME_#.#.#.
Firstcommandcreatesthelabel.Thesecondappliesthelabeltothecurrentdirectory"."recursivelyondownthe
directorystructure.Anotherexample:ctmklabelrecursefollowncRELEASE_NAME_#.#.#directoryname
Wheretheoption"follow"allowsmklabeltofollowsymboliclinks.
Note:MustperformthecommandfromadirectorywithintheVOB.
Updateafileandapplytheexistinglabeltothenewfile:
[username_view]nodename:(username)subdirectory>ctmklabelreplacencRELEASE_NAME_#.#.#filename@@/main/4
Movelabelfromversion3andnowapplyittoversion4.
Removeoldlabel:
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
5/11
07/12/2015
ClearcaseCommands:
[username_view]nodename:(username)subdirectory>ctrmtypermalllbtype:OLD_RELEASE_NAME_#.#.#
Listalllabels:
[username_view]nodename:(username)subdirectory>ctlstypekindlbtype
OR
[username_view]nodename:(username)subdirectory>ctlstypekindlbtypeshort|sort
OR
[username_view]nodename:(username)subdirectory>ctlstypekindlbtypeshort|grepiapi|sort
Secondversionlistsall"API"labels.
Listalllabelsonafile:
[username_view]nodename:(username)subdirectory>ctlsvtreeallfilename
Secondcommanddoesnotquitework(??)
Labelformats:RELEASE_NAME_#.#.#
DefaultlabelscreatedbyClearcase:
BACKSTOP:Nochangesallowed.Nonewversionsallowedwhenlabelapplied.Alsosee"lock"command.
CHECKEDOUT:Currentlycheckedoutversions.
LATEST:Latestversionofabranch.
Createaview:
Tofindthedirectoryusedforstoringviewsissuethefollowingcommand:
[prompt]>ctlsview
greg_view/net/hostname/views/viewstore/greg_view.vws
steve_view/net/hostname/views/viewstore/steve_view.vws
...
Createviewfromviewsdirectory.Filesthereareviewname.vws
[prompt]>cd/net/hostname/views/viewstore/
[prompt]>ctmkviewtagdave_view./dave_view.vws
[prompt]>ctlsview|grepdave_view
dave_view/net/hostname/views/viewstore/dave_view.vws
[prompt]>ctdescribel/net/hostname/views/viewstore/dave_view.vws
...
Moveaview:
Assumingthemoveisonasingleserverandtherearenocheckedoutfiles.Stopviewserver.
cd/net/hostname/views/viewstore/
findviewtag.vws|cpiopmd/destinationviewstore
ctrmtagviewallviewtag
ctunregisterview/net/hostname/views/viewstore/viewtag.vws
mvviewtag.vwsviewtag.vwsbackup
ctregisterview/destinationviewstore/viewtag.vws
ctmktagviewtagviewtag/destinationviewstore/viewtag.vws
ctstartviewviewtag
rmviewtag.vwsbackup
ClearcaseClearmake:
[username_view]nodename:(username)subdirectory>ctlsco
[username_view]nodename:(username)subdirectory>clearmakeCgnufMakefile
[username_view]nodename:(username)subdirectory>ctcatcrfile.o
Onemayalsosettheenvironmentvariable:exportCCASE_MAKE_COMPAT=gnu
Checkfirstifthereareanyfilescheckedout.Runmakefile.Listconfigurationrecord.Theadvantageofclearmakeis
thatderivedobjects(objectfilesgeneratedbycompilingsource,hencederivedfromthesource)arestoredwith
extendednames.i.e.filename.o@@26Feb.14:28:9621
ViewdefaultgrouponWindowsPC:
OpenaDOScommandpromptwindow.
cdProgramFiles\Rational\Clearcase\etc\utils
Executethe"creds"command
Readthe"PrimaryGroup"domain.
PCConfigspec:rightclickonXX:drive+clearcase+properties.
Clearcaseexplorer:C:\ProgramFiles\Rational\ClearCase\bin\clearexplorer.exe
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
6/11
07/12/2015
ClearcaseCommands:
Clearcasefindcommand:
Tag"all"referstoallfilesinVOB.
FindallfileswithgivenlabelintheVOB:
ctfindalltypefileversion'lbtype(LABELNAME)'print
Findallneworchangedfilessincethatwithaspecifiedlabel:
ctfindallversion'\!lbtype(LABELNAME)&&version(/main/LATEST)'print
Findallfilesattheendofabranchincurrentdirectory:
ctfind./version'version(.../branchname/LATEST)'print
ExplanationofClearcaseviewsandfilestructurewithinaview:
ViewsarerequiredinordertouseClearcase.Auniqueviewassignedtoauserwill:
allowadeveloperaccesstotheVOBdata(sourcecodestorage)
provideaworkspacearewhereuserscanprivatelymodifyVOBdatawithoutdisturbingtheviewoftheVOBdata
heldbyotherdevelopers.ChangesareonlyaccessiblebyotherswhenafileischeckedintotheVOBfromtheusers
privatespace.
Therearethreetypesofviews:
Snapshotview:Changesandupdatesbyothersarenotavailabletoasnapshotviewuntilanew"snapshot"istaken.
Webview:accessiblefromClearcaseWebinterface.Similartoasnapshotview.
Dynamicview:accesstoallversionsofVOBelementsandviewprivateobjectsastheyarecheckedintotheVOB.
DirectoryStructurewithinview:
TheClearcaseviewandversioningsystemisbasedonadirectorystructurebeneathwhatatfirstappearstobeastandard
setoffilesinadirectorystructure.
Example:(setviewfirst:ctsetviewxxxxxx)
Clearcasepresentation
Unixpresentation
ctls
ls
filename1.ext@@/main/3Rule:/main/LATEST
filename2.ext@@/main/6Rule:/main/LATEST
filename1.ext
filename2.ext
Notethattherearethreeversionsofthefileinthemainbranch.
ActualDirectorypathrepresentation:
filename1.ext@@/Actuallyadirectorynamenotafilename
LABEL1Actualyafilewiththefullcontents.
LABEL2
main/Directoryofmainbranch.
LABEL1Actualfilewithfullcontentsoffile.
LABEL2Actualfilewithfullcontentsoffile.
0Actualfilecontainingversionzero.
1Actualfilecontainingversion1
2Actualfilecontainingversion2
3Actualfilecontainingversion3
LATESTActualfilewithfullcontentsoffile.
Note:
ClearcasestoresthefullcontentsofthefilesavedandnotadiffbetweenversionslikeRCSorSCCSwhich
buildsversionsofthefilewhenneccessary.
Thefile"3"and"LATEST"areidentical.
cdfilename.ext@@/main
diff3LATEST
Thiswillshownochangebetweenthefiles.
Searchallarchivedfilesforastring:
findfilename.ext@@printgrep'wordToFind'{}\;
Thisknowledgecanfacilitatesearchesinpreviousversionsofsourcecode.
Relationshipbetweenviewsanddirectorystructure:
Eachviewwillhavethedirectorystructuredescribedabovewithinitsview.
/view/...Viewrootdirectory
/view/viewname1/
bin/...EntireOSfilesystemviewedfromhereforviewname1
etc/..
.../...
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
7/11
07/12/2015
ClearcaseCommands:
vob/vobname/src/filename1.extUnixpresentationorfilename1.ext@@for"ctls"
.../...ContentsofClearcaseVOB
/view/viewname2/
bin/...EntireOSfilesystemviewedfromhereforviewname1
etc/..
.../...
vob/vobname/src/filename1.ext
.../...ContentsofClearcaseVOB
Thispath/view/...isviewablebytheregularUNIXuser,withorwithoutsettingtheview.
Whenyousetyourview("ctsetviewviewname1"),itallowsonetoviewtheClearcasearchivefrom/vob/vob
name/....
Theabovepathisfor/view/viewname1/
Thepath/view/viewname1@@/willshowalltherevisionbranches.i.e.
/view/viewname1@@/vob/vobname/main/LATEST/directoryname/main/LATEST/...
0/...
0/...
1/...
2/...
1/...
Configspec:
Configspecspecifiesrulesofviewingspecifiedelementswhichwillbeshowninagivenview.Thesystemdefault
configspeccanbefoundin$ATRIAHOME/default_config_spec(Typically:/usr/atria/default_config_spec)
Basicconfigspec:
(/destinationviewstore/viewtag.vws/config_spec)
element*CHECKEDOUT
element*/main/LATEST
Patternmatching:
Pattern
*
*.h
src/Makefile
Description
Matchesallelementsinthepathbutnotrecursively.
Matchesallelementsinthepathwhichmatchthesuffix".h",butnotrecursively.
Matchesallelementsinthepathinadirectorynamed"src"whichmatchthisfilename.
src/.../Makefile Matchesallelementsinthedirectory/subdirectorytreenamed"src"whichmatchthisfilename.
src/.../*.[ch]
Matchesallelementswiththesuffic".h"and".c"inthedirectory/subdirectorytreenamed"src".
src/...
Matchesallelements(filesanddirectories)inthedirectory/subdirectorytreenamed"src".
ConfigRule
element*CHECKEDOUT
elementdirectory*/main/LATEST
Description
Thisruleismandatory.Withoutthisrule,anyfilethatischeckedoutwillnotbeseen
inaview.
Lookatlatestversionofthedirectoryonthemainbranch.
elementdirectory*/branch
name/LATEST
Lookatlatestversionofthedirectoryonthedefinedbranch.
elementfile*/main/version
number
Showthisparticularversionnumberofallfilesinview.
element*LABEL
element*rulenametimetime
Showelementswiththislabel.(i.e.element*/main/LABEL3)
Showelementswhichcomplywiththisruleandlastmodifiedpriortotime
element*rulenametimetime
Showelementswhichcomplywiththisruleandlastmodifiedpriortotime
element*/vob/vobname/AppName/*
LABEL
Showelementsinthespecifieddirectorywiththegivenlabel.
element/vob/projectA/...
/main/LATEST
Ruleappliesonlytospecifieddirectoryhierarchy.
element*rulenametime26
Oct.14:32
Branching:
Branchingcanbeperformedto:
Allowparalleldevelopmentbetweentwodevelopersandlatermergethecode.
Createanewversionofthesoftwarewithdifferentfeaturesforaspecificpurpose.
Addfeaturesinaseparatebranchtobemergedinlaterafteritisproven.Thebenefitistoallowthemainbranchto
continuewithoutbeingdisturbed.
Configspectoviewbranch:
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
8/11
07/12/2015
ClearcaseCommands:
element*CHECKEDOUT
element*.../branchx/LATEST
element*/main/LATESTmkbranchbranchx
Thisconfigspecwillcreateanewbranchfornewfilesaddedorforfilescheckedout.Iffileischeckedoutfrom
/main/LATEST,thentrigger(mkbranchbranchx)executestocreateanewbranchforthefilecheckedout.
Thebranchtypemustfirstbecreatedwiththecommand:mkbrtypec"Commentgoeshere"branchx
Createthebranchtypebeforecreatingtheactualbranch.Onlyonebranchtypeofagivennamewillexist.Manyfilesmay
existwiththebranchesofthesamebranchtype.
Exampleofcreatingabranch:
ctmkbrtypec"Commentgoeshere"BugFix_branch_Y
ctsetviewviewname
ctmkbranchncBugFix_branch_Yfiletobranch.cpp
Thiswillcreateversion"0"offiletobranch.cppinthebranchnamedBugFix_branch_Y.
Createabranchoffofversion5offiletobranch.cppinbranchmain.
ctmkbranchncBugFix_branch_Yfiletobranch.cpp@@/main/5
Createbranchusingallsource:ctmkbranchncoc"BugfixpatchB"patch_B*.cpp*.h
GUI:ctlsvtreegfilename
Merging:Ifonewishestoincludethechangesmadeinabranchintothe"latest"versioninthe"main"branch,onewould
performa"merge".
Mergeversion5onthebranchintothe"latest"versioninthe"main"branch:
ctmergetofiletomerge.cppinsertversion/main/BugFix_branch_Y/5
Specifyconsecutiveversions2through5:
ctmergetfiletomerge.cppinsertversion/main/BugFix_branch_Y/2/main/BugFix_branch_Y/5
Mergeallchangesinabranchintothe"main"branch:
ctfindmergefiletomerge.cppfversions.../BugFix_branch_Y/LATESTmerge
Listallbranches:ctlstypekindbrtype
GUITools:
Tools:
xclearcase:
Command:/usr/atria/bin/xclearcase
xcleardiff:
Command:/usr/atria/bin/xcleardiff
Motifresourcefile:(Addto$HOME/.Xdefaults)
xcleardiff*promptBrightColor:yellow
xcleardiff*changeColor:blue
xcleardiff*deleteColor:red
xcleardiff*insertColor:green
xlsvtree:
Command:/usr/atria/bin/xlsvtree
[PotentialPitfall]:YoumayhavetoissuethecommandexportLANG=CpriortolaunchingGUI.
Commonresources:
Motifresourcefile:(Addto$HOME/.Xdefaults)
*scheme:Monet
*XmText*marginHeight:4
*foreground:blackTextcolor
*background:white
VersionStringGeneration:
Makefile:
...
target:version.h$(OTHER_OBJS)
ccotargetDDATE="\"@(#)`date`\""$(OTHER_OBJS)
...
SourceCode:(.hfile)
...
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
9/11
07/12/2015
ClearcaseCommands:
char*version="@(#)targetR3.0";
char*version_time=DATAE;
...
ThisisusedinconjunctionwiththeUNIXwhatcommand.(NotavailableonLinux)
Notes:
UsersofUNIXsysVsystemsmayfindthattheycan'tprintusingthe"lp"commandasthespoolercan'tlocatethefile
ifitdoesnotoperatewiththeusersview.Usethecommand"lpcfilename"whichcreatesacopywhichthe
spoolercanread.
ApplicationsspawnedfromscriptsarenotabletoprocessClearcasecontrolledfiles.Rawexecutablescan.When
workingwithHTMLfilesIcanusethekonquerorbrowserbutIhavenothadanyluckrunningMozillawhichis
spawnedfromashellscript.
Links:
SGI:ClearcaseConceptsGuide
VCClearcase:Emacs/ClearcaseIntegrationEmacsextensionandkeybindings
ApacheANTandClearcase(Javabuildtool)
PERL/CPAN:
CtCmd:CtCmd1.11
Argv:Argv
ClearCaseArgv:ClearCaseArgv
ClearCaseClearPrompt:ClearCaseClearPrompt
ClearCaseCRDB:ClearCaseCRDB
ClearCaseSyncTree:ClearCaseSyncTree
ClearCaseWrapper:ClearCaseWrapper
ClearCaseWrapperDSB:ClearCaseWrapperDSB
EnvPath:EnvPath
IBMClearcaseManuals
GettingStartedwithRationalClearQuestIBMWebtraining
Books:
SoftwareConfigurationManagementStrategiesandIBM(R)Rational(R)
ClearCase(R):APracticalIntroduction
byDavidE.Bellagio,TomJ.Milligan
ISBN#0321200195,IBMPressMay232005
TheArtofClearCase(R)Deployment:TheSecretstoSuccessful
Implementation
byChristianD.Buckley,DarrenW.Pulsipher
ISBN#0321262204,AddisonWesleyProfessional(July13,2004)
SoftwareConfigurationManagementStrategiesandRationalClearCase:A
PracticalIntroduction
byBrianWhite
ISBN#0201604787,AddisonWesleyProfessional1stedition(August25,
2000)
YoLinux.comHomePage
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
totopofpage
10/11
07/12/2015
YoLinuxTutorialIndex|Terms
PrivacyPolicy|Advertisewithus|FeedbackForm|
Unauthorizedcopyingorredistributionprohibited.
ClearcaseCommands:
9
StumbleUpon
281
Copyright2004,2005,2006YoLinux.com
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html
11/11