ClearCase基础培训课件
- 格式:ppt
- 大小:1.29 MB
- 文档页数:28
ClearCase的使用方法这是本人在查看ClearCase使用帮助,根据自己的理解,整理,翻译出来的部分ClearCase帮助。
主要内容是一些基础的与ClearCase相关的概念,对理解ClearCase的工作方式有一定的作用。
希望这篇文档对大家有所帮助,随手翻译的文档可能存在不少错误之处,还请大家多多指教。
ClearCase的基本概念一、一、VOB(Versioned Object Base):是文件,文件夹和元数据(ClearCase控制下的文件和文件夹叫做元素(Element),每个元素Check In形成的修改叫做一个版本(Version))的永久存储仓库。
以下是关VOB的基本概念:1.1.一般来说一个VOB中包含了每个元素的所有版本(Version)以及诸如用来描述每个版本的标签和CheckOut注释等元数据2.2.对一个既定的项目,依赖于管理员对项目数据的安排,可能需要访问位于不同VOB中的元素。
二、二、View:一个View为项目中所有文件的某一个版本提供一个目录树。
在View中你可以修改源文件,将他们编译成模块进行测试,将他们插入到文档中等活动。
三、三、流(Stream):流是一个具有长生命周期的ClearCase对象。
它是单个UCM项目的成员,还是生成和记录配置的一种机制。
一个流标识了当前你可以查看,修改和编译的一系列版本。
UCM使用基线(Baseline)和活动(Activities)来描述一个流的配置。
当你创建一个流时,它的初始配置和基线一样(它包括某个组件的所有元素的单个版本)。
当你修改流的配置时,你将这些修改指定为一个或多个活动。
因此一个流就是一个给定的基线加上一个或多个活动。
以下活动将改变一个流的配置:1. 1.从相关联的View中CheckIn版本。
(一个流可以和多个View相关联)2. 2.基线更新(Rebase),用更近的基线取代流配置中的基线。
3. 3.交付(Deliver),通过向整合流(Integration Stream)中添加在此之前只有正在开发队伍可以进行的活动改变综合流。
ClearCase Basic IntroductionCl C B i I t d tiLeo Liyli01449@CIeNET Technologies-Proprietary1A dAgenda Overview of ClearCase •Overview of ClearCase•Basic Concept •Environment •Use Case •Q&ACIeNET Technologies-Proprietary 2Overview of ClearCaseO i f Cl CCl C F iz ClearCase Functionz ClearCase Usage ModelCIeNET Technologies-Proprietary3Cl C F iClearCase Function FOOBARVersion ControlBuild ManagementRelease4.0Software DevelopmentREPORT ALERTWorkspace ManagementProcessProcess CIeNET Technologies-Proprietary4ControlV i C t l Version ControlVersions all file types andz Versions all file types and directoriesStores objects in reliable,scalable /mainbar.cL b l z Stores objects in reliable, scalable Versioned Object Bases (VOBs)z Files are read-only until checked 0REL11Labels VersionB h outz Easy checkout-edit-checkin model U li it d b hi d i/bug10120Branch z Unlimited branching and merging zIntelligent merge utility automatically merges non-/motif31automatically merges nonconflicting changeszGraphical compare and merge 401REL2CIeNET Technologies-Proprietary5toolsREL35Version Control-baselineVersion Control baselinemanagementA label is a name that you b foo cz A label is a name that you assign to a version of an element /main/main bar.c foo.c 00z Baseline/Labels are usually applied to set of elements to mark important project/bug101202REL1REL2 REL111mark important project milestones or the proposed starting point of a branch./motif/bug134 31030z A official baseline must be audited and approved.M ki h ti it t441 0REL3REL355 1REL2z Making changes activity mustbe approved through changemanagement processCIeNET Technologies-Proprietary6g pVersion Control-parallel pdevelopmentzMultiple Developmentbranching for differentmain 0g release, feature and bug fix.zThe branching may be 12Rel1FeatureF t 20BugFix based on release, feature, team or location.E t i t th 43100Feature221zEasy to merge into other branch for integration.2213365CIeNET Technologies-Proprietary 7W k M tWorkspace Management T t t llz Transparent access to allversioned objects fromstandard development toolsstandard development toolsz A way of seeing the objectsin a VOBz Version selection is basedon user-defined rulesz Easy way to managemultiple tasksz Controls the public/privatenature of workCIeNET Technologies-Proprietary8Build ManagementB ild M tz ClearCase supports makefile-based building of software systems and provides a software build environmentclosely resembling that of the make program.z make was developed for UNIX®systems and has been ported to other operating systems.t d t th ti tz You can use files controlled by ClearCase to build software, and use native make programs, third-partysoftware and use native make programs third partybuild utilities, your company’s own build programs, or theC ea Case bu d oo s c ea a e a d c ea aud tClearCase build tools clearmake and clearaudit.CIeNET Technologies-Proprietary9P C t lProcess Control E f i li i d•Enforces appropriate policies and processes across diverse development environmentsIntegrates a set of flexible customizable tools zIntegrates a set of flexible, customizable toolsfoo c bar c foo.cbar.cobsoleteCIeNET Technologies-Proprietary 10Cl C ClearCase U Usage M Model d lzBase ClearCase¾Version Control ClearCase+ClearQuest Integrated Functionality zU ifi d Ch Unified Change M Management t (UCM)¾ ¾Version Control Change Management Configuration Management Project ManagementzBase ClearCase+Other tools¾Integrate version control and change management.CIeNET Technologies-Proprietary11A Agenda d•O er ie of ClearCase Overview•• • •Basic ConceptEnvironment Use Case Q&ACIeNET Technologies-Proprietary12B i Concept Basic C tz z z z z z z z z zVOB View Config Spec Element Version Branch L b l Label Checkout model Meta Data Derived ObjectCIeNET Technologies-Proprietary 13VOBz z zA versioned i d object bj t b base A storage repository VOB is the permanent repository that stores¾ ¾ ¾ ¾) VOBVersions of File elements Directory elements D i d objects Derived bj t MetadatazA network-wide t k id fil file system that resides on serversCIeNET Technologies-Proprietary 14VOB t and VOB-tag d storage tzVOB Tag T¾ ¾ ¾zVOB O storage¾a UNIX "mount point". a unique symbol in a ClearCase region i t to id identify tif a VOB VOB. A VOB is accessible only if it has been mounted. VOB-tag gdirectoryVOB storage directory db s cStorage pools VOB database di t directory¾the UNIX directory where the VOB data structure is created. It i th is the physical h i l storage t of f a VOB VOB. Do not access a VOB storage directly. Data under this directory are read read-only only and unorganized. Access a VOB via the VOB tag (mount point).cleartool mountdCIeNET Technologies-Proprietary15Viewz z z zzWorkspace for an individual developer or closely coordinated group Selects versions of VOB directories and files Allows developers to work without interfering. ) View Views also access files not stored in a VOB ¾ - private files and derived objects ¾ - not visible to other views Each user can have multiple views ¾ - view for new development ¾ - view for bug fixingCIeNET Technologies-Proprietary16Vi View-tag t and d storage tzView tag¾The unique identifier of a view in a ClearCase region. A storage space, space containing view private files and a database, which stores some information of the view. a set of version selection ruleszView storage¾zConfig Spec¾CIeNET Technologies-Proprietary17Vi View-dynamic d i views izz z zTransparent access to elements – a virtual file system Always up-to-date Minimal copying Provides build auditingDynamic ViewSelect by y Config. g Spec. pCIeNET Technologies-Proprietary18Vi View-snapshot h t views izzzDownloads files based on Rules - physical files system Allow work while disconnected from the network Optimal build performance for test buildsLoad by Config. Config Spec Spec.Snapshot S h t View ViCIeNET Technologies-Proprietary 19View private files View-privatez z zView-private View private files are visible in a view but are not versioned Can only be seen when accessing the view where they were created Include temporary files, checked-out files, and files created during the build process VOBhello.c src util.chello.c test.txt util.cV I E WView Storagetest.txt util.cCIeNET Technologies-Proprietary20Config SpecConfig Specz Each view has a config spec that defines a set of rules for selecting version of file and directory elementsz A default config spec is automatically set whenever you create a new viewThe Default Config Spec:z The Default Config Spec:element * CHECKEDOUTelement * /main/LATESTz The default config spec selects files or directories that are :checked out-checked out-the latest version on the main branch of the version treeCIeNET Technologies-Proprietary21Config SpecConfig Spec -Syntax<scope> <pattern> <version selector>element * CHECKEDOUTelement*/main/LATESTelement /main/LATESTz<scope>---element, element -file, element –directory---element -eltype text_filel l filz<pattern>p,,p j---wildcard expression: *, .c, or /vobs/project/.../.c---absolute or relative pathname: /vobs/project/src/hello.cz<version selector>---dynamic selector: /main/LATEST, /main/br1/LATEST,d i l t/i/LATEST/i/b1/LATESTor CHECKEDOUT---static selector: /main/4CIeNET Technologies-Proprietary22El tElement zAn element is a file ordirectory for which ClearCase maintains Storing Elements in a Versioned Object BaseClearCase maintains multiple versions . The versions of an zThe versions of an element are logically organized into a ghierarchical version tree , which can include l i l b h d multiple branches and sub-branchesCIeNET Technologies-Proprietary 23El t i t d b hElement-version tree and branch zEach element is created with asingle branch, named main , which has an empty version numbered 0.has an empty version numbered 0.zClearCase automatically assigns integer version numbers to versions Each version can also versions. Each version can also have one or more user-defined version labels .zOne or more user-definedbranches can be created at any version, multiple branch levels are ,p supported.zVersion 0on a branch is identical to the version at the branch point CIeNET Technologies-Proprietary24the version at the branch point.VersionV iA i i ifi i i f l tz A version is a specific revision of an element.z By versioning, we make copies of the data at some meaningful point in order to be able to return to thatmeaningful point in order to be able to return to thatpoint at a later stage if necessaryCIeNET Technologies-Proprietary25V i i tVersion-version tree z A version tree is a hierarchical representation of anelement in which all versions are logically organizedzA version-ID represents a unique position on the version tree:/main/Feature2/F2.3/2tree: /main/Feature2/F2.3/210mainFeature1230R1.0R2.0Feature2401F2.35621201R3.0Using the Check Out/Check In ModelCIeNET Technologies-Proprietary26732V i t d d thVersion--extended pathnamesVersionz Allow you to specify a version that may not be visible in your viewBranchB hA branch is an object thatz A branch is an object thatspecifies a sequence ofversions of an element.E l t h iz Every element has one mainbranch, which represents theprincipal line of development,and may have multiple subbranches, each of whichrepresents a separate line ofp pdevelopmentz Usually, you work on abranch because you want tobranch because you want towork in parallel with othermembers of a developmentteamteam.CIeNET Technologies-Proprietary28L b l LabelzA label is a name that you assign to a version of anA label is a name that you assign to a version of an elementzA version label can be attached to any version of an yelement to identify that version in an easy way.CIeNET Technologies-Proprietary 29M t D t d D i d Obj tMeta-Data and Derived Objects Each ClearCase VOB stores a variety of informationz Each ClearCase VOB stores a variety of information related to, but distinct from, the contents of file systemobjects. This information is termed meta-data. including: --branches/branche typesb h/b h--elements/element types--labels/label types--attributes/attributes types--hyperlinks/hyperlink typesgg gg yp--triggers/trigger types--event records--configuration recordsDerived objects are created during builds withz Derived objects are created during builds with ClearCase build tools. They are used for build avoidance and derived object sharing.CIeNET Technologies-Proprietary30Ch k t M d lCheckout Modelz A checkout modelenables you to get aenables you to get aprivate and editablecopy of a specificcopy of a specificelement and managechanges to yourchanges to yourprojects.CIeNET Technologies-Proprietary31Checkout ModelCh k t M d lReserved checkoutz Reserved checkout¾ A reserved checkout grantsthe exclusive privilege tocreate the next version oncreate the next version onthe branch. In each branch,there can be only onereserved checkoutz Unreserved checkout¾ A branch can have severalunreserved checkout. If nounreserved checkout.If noreserved checkouts exist, thefirst user to checkin wins;the others must merge thenewly-created version intone l created ersion intotheir own work beforechecki n.CIeNET Technologies-Proprietary32A dAgenda•Overview of ClearCaseOverview of ClearCase•Basic Concept •Environment•Use Case•Q&ACIeNET Technologies-Proprietary33EnvironmentE i tz Platform and Protocolz ClearCase HostsClearCase Regionz ClearCase Regionz ClearCase Multisitez User InterfaceCIeNET Technologies-Proprietary34Platform and Protocol Platform and ProtocolCIeNET Technologies-Proprietary35Cl C H t d R iClearCase Hosts and Regionz Various system tasks are assigned to server hosts:¾VOB ServerView Server¾View Server¾Registry Server¾License Server¾Clientz A ClearCase region:A subset of views and VOBs introduced in the ClearCase¾ A subset of views and VOBs introduced in the ClearCase registry of the registry server.¾The registry server contain VOBs and Views information for the region¾Each ClearCase host belongs to only one ClearCase region.¾ClearCase VOB and View may be registered in multiple regions.CIeNET Technologies-Proprietary36Cl C M lti itClearCase MultisiteCl C lti it bl d l t diff tz ClearCase multi-site enables developers at different locations to use the same VOB. Each location (sit e) hasa copy (replic a) of the VOB. A site can propagate thea copy a)of the VOB A site can propagate thechanges made in its particular replica to other sitesregularly.z Some of ClearCase objects are not replicated, including: ViewsTriggers and trigger typesTemporary locksChecked out versionsChecked out versionsDerived objectCIeNET Technologies-Proprietary37U I t fUser Interfacez Graphic User Interface (GUI)¾XClearCase on UnixTh Cl C H B t l Wi d¾The ClearCase Home Base tool on Windowsz Command Line Interface (CLI)${p g}$ cleartool sub-command {options-and-args}$ ct sub-command {options-and-args}¾You may issue cleartool command in to ways$ cleartool sub-command$l t l b dor$ cleartool$ cleartool> sub-commandz Web InterfaceCIeNET Technologies-Proprietary38U I t f lUser Interface-xclearcaseCIeNET Technologies-Proprietary39U I t f h b t l User Interface-home base toolCIeNET Technologies-Proprietary40A dAgenda•Overview of ClearCase•Basic Concept•Environment•Use Case•Q&ACIeNET Technologies-Proprietary41U C Use Casez Developer ’s workflowz Setup working space p g pz Manage files anddirectoriesz Work on a branchz Merge different versionsC t b liz Create a baseline zBuild productCIeNET Technologies-Proprietary 42D l k flDeveloper’s work flowCreate a branch type Create a branch on the file StartCreate a view Checkout the filesAdd new element or NSet a view Modify filesmodify elementYEdit config_specCheck in the files Check out the parent directoryMount a vobAdd new elementsCheck in the parent directoryEndCIeNET Technologies-Proprietary43 Check in the parent directorySetup Working Space-path andSetup Working Space path and variablez On Unix/Linux platform, ClearCase is installed under p ,following directories./usr/atria or /opt/rational/clearcasez So you need to add the “bin ”directory into your PATH variable$t PATH $PATH //t i /bi #h$ setenv PATH $PATH:/usr/atria/bin # csh or$ export PATH=$PATH:/usr/atria/bin # kshz If you want to use GUI, don ’t forget to setup the DISPLAY variable$ setenv DISPLAY <local host name or IP>:0.0# cshor$export DISPLAY=<local host name or IP>:0.0#kshCIeNET Technologies-Proprietary 44$ export DISPLAY local host name or IP :0.0# kshSetup Working Space-useSetup Working Space useVOBsz To list all VOBs$ cleartool lsvob* /vobs/project1 /net/saturn/sat1/proj1.vbs public/vobs/project2 /net/saturn/sat1/proj2.vbs public*/vobs/project2/net/saturn/sat1/proj2.vbs public* /vobs/project3 /net/saturn/sat1/proj3.vbs publicz To list a individual VOB$ cleartool lsvob <–l> /vobs/project$l t l l b l/b/j t* /vobs/project /net/saturn/sat1/proj.vbs publicNote The “*”before the line indicates that the VOB is mounted. Bydefault, public VOB will be mount upon system startup. And it may bed f lt bli VOB ill b t t t t A d it bmounted manually:•To mount a VOB or all VOBs$ cleartool mount /vobs/project$ cleartool mount –allNormally VOBs are created by administratorz Normally, VOBs are created by administratorCIeNET Technologies-Proprietary45Setup Working Space-useSetup Working Space useviewsz To list views$ cleartool lsview* joe_newdev /net/saturn/home/joe/joe_newdev.vwsNote:The “*”before the line indicates that the view is activated. TheN t Th b f th li i di t th t th i i ti t d Thview is activate automatically when you set into a view.z To set into a view:$ cleartool setview mainlinez After set into a view, you can enter a VOB directory to see the source code$ cd /vobs/projectY l th VOB i i t d d th z You may also access the VOB using view extended path name$ cd /views/mainiline/vobs/project$cd/views/mainiline/vobs/projectCIeNET Technologies-Proprietary46Setup Working Space-use Setup Working Space useviewszTo exit the view:$ exit If you have nested your views by setview multiple times zIf you have nested your views by setview multiple times, you will have to exit each shell. z You can display current view by:p y y$ cleartool pwvWorking directory view: ** NONE **Set view:mainline Set view: mainline¾Working directory view: displays the view-tag that is working (filtering) the current VOB directory. if the current working directory is not in a VOB, it displays *NONE*,p y¾Set view : displays the view-tag set in the current shell CIeNET Technologies-Proprietary 47Setup Working Space-before Setup Working Space beforecreate viewszYour UNIX umask setting at the time you create your view determines g y y how accessible it will be to others: z You can change your umask in the standard way: 022UmaskEffect on your view 1. Members of your UNIX group will be able to create and modify view private data;002modify view-private data;2. All other users will have read-only access.1. Members of your UNIX group will be able to create and 007modify view-private data;2. All other users will be completely excluded.1Only you can write view-private data;022 1. Only you can write view-private data;2. Everyone else will have read-only access.This is a private view;no other user will be able to CIeNET Technologies-Proprietary 48007This is a completely private view; no other user will be able to read or write view-private data.Setup Working Space-Setup Working Spacecreate/remove viewsT t iz To create a view:$ cleartool mkview –tag joe_newdev /home/joe_newdev.vwsCreated view.Host-local path:saturn:/home/joe/joe_newdev.vwsGlobal path:/net/saturn/home/joe/joe_newdev.vwsIt has the following rightIt has the following rightUser: joe:rwxGroup: user:r-xOther::r-xz To remove a view$l t l i t j d$ cleartool rmview -tag joe_newdevz Views may be created/removed by some other tools.CIeNET Technologies-Proprietary49S t W ki S fiSetup Working Space-config spec z You may display the config spec of current view by:$ cleartool catcselement *CHECKEDOUTelement * CHECKEDOUT element * /main/LATEST # default config specz You may also display the config spec of other view:y y g$ cleartool catcs -tag qa_viewelement * REL2_betaYou may edit the config spec:z You may edit the config spec:$ cleartool edcsz Normally, the config spec will be created by some other tool. So it may be not required to change it manually.CIeNET Technologies-Proprietary 50。
ClearCase客户端使用指南For windows base方式Author:孙振芳Email:szhfcn@OICQ:38285491/二黑注:任何人可引用本文,但请注明出处.二○○五年三月1编写目的 (3)2安装 (3)2.1安装前提 (3)2.2安装包 (3)2.3安装过程 (3)3配置 (7)3.1检查Registry及License Server等设置 (7)3.2设置域用户所属主组 (11)3.3ClearCase Doctor (12)4VOB和VIEW (13)4.1VOB的概念 (13)4.2VIEW的概念 (13)4.3视图的配置规则 (13)5基本操作 (14)5.1创建视图 (14)5.2Mount VOB (16)5.3元素受控 (17)5.4CheckOut和CheckIn (19)5.5版本树 (21)5.6版本比较 (22)5.7标签 (23)5.7.1标签 (23)5.7.2创建标签类型 (23)5.7.3给文件的版本贴标签 (24)5.7.4使用标签 (25)5.7.5利用Apply Label Wizard贴标签 (27)5.8分支与归并〔用于并行开发〕 (29)5.8.1创建分支类型 (29)5.8.2分支创建方法一 (30)5.8.3分支创建方法二 (31)5.8.4归并 (31)6与开发工具的集成 (34)6.1与VC6.0的集成 (34)6.1.1源代码受控 (34)6.1.2CheckOut与CheckIn (36)6.1.3其它功能 (37)6.2与Jbuilder的集成 (38)6.2.1设置版本控制工具 (38)6.2.2源代码受控 (39)6.2.3CheckOut与CheckIn (40)6.2.4其它功能 (41)1编写目的描述在Windows操作系统下Base ClearCase客户端的使用方法。
2安装2.1 安装前提z操作系统要求:建议使用WINDOWS2000操作系统(注意:所内当前使用的ClearCase版本为4.2,该版本在WINDOWS XP操作系统下无法使用。