Presentation is loading. Please wait.

Presentation is loading. Please wait.

ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager.

Similar presentations


Presentation on theme: "ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager."— Presentation transcript:

1 ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

2 Cairo IT Team, ClearCase training, July 2004 2 Clearcase support at Mentor Graphics n Europe/middle east n North America Amr Elhusseiny Asser Sherif Ahmed Fayek Richard England Roger Moore Cairo-Egypt WV-USA

3 Cairo IT Team, ClearCase training, July 2004 3

4 4 n General Concepts n Using ClearCase On UNIX n Using ClearCase On Windows n How To work From Home (snapshot) n Build Control n UCM On Unix n UCM On Windows ClearCase Training

5 Cairo IT Team, ClearCase training, July 2004 5 n Configuration Management (Concepts and Goals) n Data Storage – VOBs n Meta-Data for Process Control General Concepts

6 Cairo IT Team, ClearCase training, July 2004 6 “General Concepts” Configuration Management Concepts Tracking objects and changes to the objects Tracking the relationships and changes to the relationships between objects, Ex: o Unit tests and source o Source and requirements o Documentation and source Tracking environment information, i.e. the versions of tools used to build, etc. Tracking defects forcing changes to requirements, source, documentation, and tests Parallel development Being able to reproduce previous releases exactly

7 Cairo IT Team, ClearCase training, July 2004 7 Improve the Return on Investment by: n Increasing team productivity n Increasing product quality n Managing process quality n Reducing the time to market n Reusing code when applicable “General Concepts” Configuration Management Goals

8 Cairo IT Team, ClearCase training, July 2004 8 “General Concepts” Data Storage – VOB (Versioned Object Base) n This is the repository where all objects (and information about those objects) is stored. n A VOB is made up of a database and storage pools. n The database contains information about elements, derived objects, cleartext, and meta-data). The storage pools contain the file system objects for the elements in the VOB. n An element is a file or directory.

9 Cairo IT Team, ClearCase training, July 2004 9 “General Concepts” Data Storage – VOB (Versioned Object Base), Cont. Cleartext is a cached version of a previously selected version of an element. A derived object is an object that was created by either a clearmake, omake, build or audit. Meta-data are bits of information that you can associate with elements. n The storage pools are subdirectories that contain the file system data for the VOB. n The element source is stored in the s pool, cleartext in the c pool, and derived objects in the d pool.

10 Cairo IT Team, ClearCase training, July 2004 10 “General Concepts” Data Storage - Registries Registries contain information about VOBs and the way the VOBs data is accessed (a view). The registries contain typically: n A unique identification number n The object's name n Its storage path Where the object is accessible (its region)

11 Cairo IT Team, ClearCase training, July 2004 11 “General Concepts” VOB Elements (files and directories) n n Each element is made up of versions, which make up the revision history of the element.   myfile.c was created resulting in version 0. It was then modified and checked in, resulting in version 1. To create version 2, it was checked out and back in.   All the work was done on the main branch of the element.

12 Cairo IT Team, ClearCase training, July 2004 12 “General Concepts” Accessing VOB Data Using a View n A view is a collection of rules or filters applied in a specific order to produce the specific versions of the elements that you see. n In different views, the versions of the elements and the elements that one user will see may not be the same as what another user will see, even though they are looking at the same directory structure. n The rules that the view uses are set in the configuration specification. (most commonly referred to as a config spec).

13 Cairo IT Team, ClearCase training, July 2004 13 “General Concepts” Accessing VOB Data Using a View, Cont.

14 Cairo IT Team, ClearCase training, July 2004 14 “General Concepts” Metadata For Process Control n Labels n Attributes n Branching n Hyperlinks n Element Types n Triggers n Locks

15 Cairo IT Team, ClearCase training, July 2004 15 “General Concepts” Labels n Identify specific versions of files. n Use labels to mark milestones in project development. n Lock them to prevent elements being added or removed inappropriately. n Apply labels to “directory elements” if any element in the directory will have the label applied to it. n Avoid labeling versions on branches that are only version 0. n Follow the corporate naming convention for labels: — Label names are all uppercase — Labels use periods and numbers to denote versions

16 Cairo IT Team, ClearCase training, July 2004 16 “General Concepts” Attributes n Use attributes to mark states in project development. n Attributes consist of a name and value pair n Example: attribute State has values of " None ", " Working ", " Fixed ", " Tested ", " Verified " n Users can query the VOB database to find elements with specific attribute and specific value.

17 Cairo IT Team, ClearCase training, July 2004 17 “General Concepts” Branching n Use branches to monitor how changes affect the source tree. Using branches properly allows changes to be checked into the source tree without affecting nightly builds. n Better not allow development to be done on the /main branch, instead use task branches off the /main branch, and then developer branches off the task branch. n Only allow the VOB owner, build person, or specifically designated person to merge to the /main/LATEST once the code on the branches have been tested by the individual developer. Using branches this way complements the check in policy. n Lock release or task branches at appropriate times in the development cycle. n Follow the corporate naming convention for branches. — Branch names are all lowercase. — Branch names use periods and numbers to denote versions

18 Cairo IT Team, ClearCase training, July 2004 18 “Using VOBs and Views” Branches and Parallel Development /main 0 1 2C4 myfile.c 0 /bugs 2 0 1 0 1 /enhancements /bug104 1 Label Branch Merge

19 Cairo IT Team, ClearCase training, July 2004 19 “Using VOBs and Views” Branches and Parallel Development, Cont. n All elements have at least one branch, /main. Changes are normally done to the last version of the element on a specific branch n Changes can be done to other versions than just the last version on a branch, but the config spec must be set up properly. n You need to know exactly which version you are selecting, and therefore which version you will be branching from.

20 Cairo IT Team, ClearCase training, July 2004 20 “Using VOBs and Views” Branches and Parallel Development, Cont. n Using other than the /main branch only affects those views with config specs that use the alternative branch allowing changes to be isolated. n Users can define branches to correspond to the work that they do. For example, the dr123456 branch would contain all the work done to fix DR123456. n Branches are used to allow multiple developers to check out the files, modify them, and check the files back in without affecting other developers

21 Cairo IT Team, ClearCase training, July 2004 21 “General Concepts” Hyperlinks Use hyperlinks to show the relationships between objects. n Use hyperlinks liberally n Show the relationships between: — Requirements documents and source files — Source files and tests — Source files and documentation — Tests and data files

22 Cairo IT Team, ClearCase training, July 2004 22 “General Concepts” Hyperlinks, Cont. 2 11 2 3 /main 0 1 0 /bugfix /main 0 1 0 /bugfix myfile.cmyfile.doc QA_LINK QA_LINK -> /vob/project/myfile.doc @@/main/bugfix/2 QA_LINK <- /vob/project/myfile.c @@/main/bugfix/1 A hyperlink is an annotation that depicts a relationship between two objects

23 Cairo IT Team, ClearCase training, July 2004 23 Mentor Hyperlink Usage n Hyperlinks are usually coupled with triggers on specific operations to send email to affected team members when changes occur. n Examples of hyperlink usage are: — Requirements documents and source files — Requirements documents and tests — Requirements documents and documentation — Source files and tests — Source files and documentation — Documentation and tests

24 Cairo IT Team, ClearCase training, July 2004 24 “General Concepts” Element Types Use element types to distinguish between types of elements. n Predefined types are: — file - stores any data — compressed file - store any data, using the gzip compression program — text_file - store text using incremental deltas — compressed_text_file - store text, using incremental deltas and gzip — binary_delta_file - store any data using both gzip and incremental deltas — directory - compare and merge directory versions n Users can create their own types to differentiate between source file types, i.e. C_src, C_Inc, Perl_src.

25 Cairo IT Team, ClearCase training, July 2004 25 “General Concepts” Triggers Help to monitor processes. Examples: prevent certain users from performing certain operations. n Use triggers to control the development process n Triggers can execute before or after the specified command — Verify conditions are met prior to execution — Prevent unauthorized individuals from executing commands n Triggers can execute after the specified command — Send notifications to concerned project members — Apply meta-data to elements if specified criteria is met

26 Cairo IT Team, ClearCase training, July 2004 26 Mentor Trigger Usage n Triggers to control the development process, by firing before and/or after a command. They can govern the use of the following commands by using some or all of the examples: — rmelem, rmname, rmver n Only allow the VOB owner to remove elements, file elements from directory elements, or element versions. — rmtype, rmhlink, rmmerge n Only allow the VOB owner to remove type definitions n Under no circumstances allow the removal of merge arrows (hyperlinks of type MERGE).

27 Cairo IT Team, ClearCase training, July 2004 27 Mentor Trigger Usage, Cont. — mkelem, mkbrtype, mklbtype n At creation time change the ownership and permissions for all new elements, branch types, element types, and label types to the VOB owner. n For elements, force that a hyperlink be created to a requirements document. — mklabel n Only apply labels to the proper files by using the query language or "mklabel -config". n Lock labels to prevent modification

28 Cairo IT Team, ClearCase training, July 2004 28 “General Concepts” Locks n Use locks to mark milestones in project development and to prevent changes to objects. n Locks can be applied to: — Labels — Elements — Attributes — Branches — Types n Apply locks to directory elements to prevent new elements from being added. n Avoid locking versions on branches that only contain version 0.

29 Cairo IT Team, ClearCase training, July 2004 29 “General Concepts” Using VOBs and Views n View types and their differences n Using Config specs

30 Cairo IT Team, ClearCase training, July 2004 30 “Using VOBs and Views” View Types and Their Differences Config Specs Rules VOB Versioned Object Base DYNAMIC VIEW SNAPSHOT VIEW Config Specs Rules VIEW Files

31 Cairo IT Team, ClearCase training, July 2004 31 “Using VOBs and Views” View Types and Their Differences, Cont. n Views should be treated as disposable items. It is best to create a view for each task. Only use ClearCase commands to remove views. n There are two types of views, snapshot and dynamic. n Each view type has different capabilities and requirements. However, there are similarities as well. For example, both view types make use of the configuration specification as a means of controlling which files that are visible. And, both have view storage areas and databases to keep track of the files.

32 Cairo IT Team, ClearCase training, July 2004 32 “Using VOBs and Views” View Types and Their Differences, Cont. Snapshot n Local files (no network dependencies) n Increased performance when accessing Unix VOBs from Windows n Files are downloaded from the VOB server to the client as specified in the config spec. n Are not updated automatically, but can be updated via command line or graphical user interface. n Can be shared the same way any Windows directory can be shared.

33 Cairo IT Team, ClearCase training, July 2004 33 “Using VOBs and Views” View Types and Their Differences, Cont. Dynamic n Update immediately to potentially see any changes to elements as soon as the changes are checked in from another view, assuming the view is configured to see the changes. n Use build avoidance to get matching objects from other views n Both have view storage directory structures that contain a database to keep track of view private files (elements that are in the view but not in the VOB and elements that have been checked out or hijacked), and derived objects produced in the view. The database also contains the group access list for the view. n View permissions are governed by the umask of the view owner on Unix, and the ACLs of the view owner on NT.

34 Cairo IT Team, ClearCase training, July 2004 34 MultiVersion File System MVFS n Dynamic Views are based on MVFS n MVFS provides read-only files from CC VOB to Dynamic View without copying files to View n MVFS Supports the Operating System’s file system interface, same is done by NFS, NTFS, FAT,.. (Native OS File Systems) n Difference: MVFS Understands Versions, it opens the file version selected by user’s view n Any Application (VI, WORD,..) can retrieve this file version transparently n MVFS enables Build Auditing (Track what files are opened during build process)

35 Cairo IT Team, ClearCase training, July 2004 35 “Using VOBs and Views” Using Config Specs n Config Spec rules are what views use to determine which elements will be visible to the user. These rules are applied in the order specified to every element in the applicable VOBs. n If the first rule does not match, the next is applied and then the next and so on until a match is found or there are no more rules. n Usage tip: — Keep the number of config spec rules to an absolute minimum. Four rules should be adequate for most tasks. — Avoid the unnecessary complexity of adding specific elements or versions of elements, Instead, use different views for different tasks.

36 Cairo IT Team, ClearCase training, July 2004 36 “Using VOBs and Views” Using Config Specs, Cont. The syntax for a config spec rule is: scope pattern version selector [optional clause] n scope, specifies what elements or types of elements the rule is for, elements, elements that are files, elements that are directories, or elements that are a user defined type. n pattern, specifies the pathname to use. Generally, wildcards like ' * ', ' *.c ', and ' /vobs/myvob/utils* ' are used. n version selector, specifies which version of the elements to use. This can be a specific version like /main/2 or /main/mybranch/3. It can also be one chosen by a label like CHECKEDOUT or LATEST or even an attribute like {created_since(yesterday)}. n Config spec can contain comments also. Any line beginning with a ' # ' is treated as a comment

37 Cairo IT Team, ClearCase training, July 2004 37 “Using VOBs and Views” Using Config Specs, Cont. Config specs, examples: element * CHECKEDOUT element *.../mybranch/latest element *.c RELEASE_2.0 element * /main/latest -mkbranch mybranch

38 Cairo IT Team, ClearCase training, July 2004 38 “Using VOBs and Views” Using Config Specs, Cont. Config Specs, Special Rules Example: n mkbranch/end mkbranch: Tells the view that when a check out affects an element that is selected by the corresponding rule to make a branch for the element. By coupling this command with end mkbranch this rule can affect a subset of the rules in the config spec. n Load: Applies only to snapshot views, and specifies what paths in a VOB should be included in the view.

39 Cairo IT Team, ClearCase training, July 2004 39 “Using VOBs and Views” Using Config Specs, Cont. n Build and test engineers should use something like: element * LABELNAME n Working on snapshot view: load /vobs/ element * CHECKEDOUT element * /main/LATEST n Developers should use something like: element * CHECKEDOUT element *.../mybranch/LATEST element * LABELNAME -mkbranch mybranch

40 Cairo IT Team, ClearCase training, July 2004 40 Checkout / Checkin Model Checkout myfile.c VOB Versioned Object Base DYNAMIC VIEW Config Specs Rules VIEW Files Checkin File elements are read-only until they are checked-out

41 Cairo IT Team, ClearCase training, July 2004 41 Checkout / Checkin Model, Cont. Types of Checkouts n Reserved Checkout (Default) — Ensures that no checkins may be made until the reserved checkout is checked back in or cancelled — May only be made if no other reserved checkouts exist for the same branch n Unreserved — Can be made regardless of the status of other checkouts on the branch — Can be checked in if no reserved checkouts have been made in the interim, and no other unreserved checkouts have been checked in — Must be merged or discarded if a checkin from another view has already taken place

42 Cairo IT Team, ClearCase training, July 2004 42 Checkout / Checkin Model, Cont. 3 RU 3 RU 4 3 R 3 4 RESERVED CheckoutUNRESERVED Checkout Checkout Checkin Checkout Checkin This UNRESERVED checkout must merge before check in new version 5

43 Cairo IT Team, ClearCase training, July 2004 43 Mentor Check In/Out Policies  Check ins: since the view servers and individual workstations are not backed up, check ins should be performed daily on the developer or task branch. Doing this ensures the changes are in the VOB.  Check outs: since ClearCase allows you to see the entire file system without checking out the elements, it is unnecessary to check elements out to see them. And, it will be easier to keep track of the changes mentally if elements are checked out only as needed.

44 Cairo IT Team, ClearCase training, July 2004 44 Mentor Naming Conventions  Label names: are all uppercase and use periods to denote versions i.e. RELEASE_BUILD.4  Branch names: are all lowercase and use periods to denote versions  View-tags:  are all lowercase and do not use periods  All private branches should follow the convention: a userid followed by "_pvt" and then a period followed by the branch version number, i.e., jsmith_pvt.4.  Some project specific conventions can be added for clarity and convenience for project members.

45 Cairo IT Team, ClearCase training, July 2004 45 Mentor View Usage n Create one view for each developer to avoid view registry problems. n Keep the number of config spec rules to an absolute minimum. — At most, four rules should be adequate for most tasks, generally fewer will suffice. — Avoid the unnecessary complexity of adding specific elements or versions of elements.

46 Cairo IT Team, ClearCase training, July 2004 46 Using ClearCase On UNIX

47 Cairo IT Team, ClearCase training, July 2004 47 Base Clearcase under Unix

48 Cairo IT Team, ClearCase training, July 2004 48 Requirements and settings n To start working with Clearcase under Unix you need to do the following: — Log on a machine on which ClearCase client is installed — Add /opt/rational/clearcase/bin to your PATH and /opt/rational/clearcase/doc/man to your MANPATH — Adjust your umask to a suitable permissions for you and your group ( e.g. umask 2 )

49 Cairo IT Team, ClearCase training, July 2004 49 Umask n umask command is used to get or set the file mode creation mask n An example of the output produced by 'ls -l' is shown below: drwx------ 2 richard staff 2048 Jan 2 1997 private drwxrws--- 2 richard staff 2048 Jan 2 1997 admin -rw-rw---- 2 richard staff 12040 Aug 20 1996 userinfo drwxr-xr-x 3 richard user 2048 May 13 09:27 public n In most cases the default Umask settings is ‘022' and can be checked by typing “umask” at the command prompt n This default setting produces permissions of “755” for files and directories creation: -rwxr-xr-x for regular files drwxr-xr-x for directories

50 Cairo IT Team, ClearCase training, July 2004 50 Umask cont….. n To change the umask use the command “umask #” at the command prompt, where # represents the new umask you want to use For example, use the command “umask 2” to create files and directories with permissions “775”: -rwxrwxr-x for regular files drwxrwxr-x for directories

51 Cairo IT Team, ClearCase training, July 2004 51 Find Your Way n List all VOBs > cleartool lsvob * /vobs/TNT_pfgen /net/egccc1/export/vobs/vobstore/TNT_pfgen.vbs public * /vobs/IT_VOB /net/egccc1/export/vobs/vobstore/IT_VOB.vbs public /vobs/icx_software /net/egccc1/export/vobs/vobstore/icx_software.vbs public * Denotes VOBs mounted on current ClearCase client. n List all VIEWs > cleartool lsview * amre_TNT_vu /net/egccc1/export/vobs/views/username_TNT_sco_vu.vws assers_develop_vu /net/egccc1/export/vobs/views/mselim_develop_vu.vws * Denotes VIEWs currently in use.

52 Cairo IT Team, ClearCase training, July 2004 52 Create your Dynamic UNIX VIEW n Storage location plkviews already created on the filer CHOPIN for hosting the dynamic views for UNIX > umask 2 ( to set permissions to 775 if required) > cleartool mkview -tag your_view_tag –stgloc plkviews Created view. Host-local path: chopin:/vol/vol2/plkviews/your_view_tag.vws Global path: /net/chopin/vol/vol2/plkviews/ your_view_tag.vws It has the following rights: User : username : rwx Group: plk : rwx Other: : r-x

53 Cairo IT Team, ClearCase training, July 2004 53 Create your Snapshot Unix View n For each user’s machine, a storage location needs to be created by the CC support team, the standard naming is: machine-name_team-name_viewstore n A scratch area on the machine where the storage location is created needs to be shared so that it can be accessed from the path /net/machine-name/scratch-area

54 Cairo IT Team, ClearCase training, July 2004 54 Create your Snapshot Unix View n To create the snapshot view in the storage location created in the scratch area on your local machine use: >cleartool mkview –tag your_view_tag -snap –stg storage_location_name \ /net/your_machine_name/path_to_your_scratch_area/your_View_Tag n Example: > cleartool mkview –tag amre_test_vu –snap –stg md8_IT_viewstore /net/md8/export/home/users/amre/views/amre_test_vu

55 Cairo IT Team, ClearCase training, July 2004 55 Working with Dynamic Views n Set a dynamic view to be your current VIEW >cleartool setview your_view_tag n Print your current dynamic VIEW >cleartool pwv Working directory view: ** NONE ** Set view: your_view_tag NEVER remove the view using UNIX command rm –rf

56 Cairo IT Team, ClearCase training, July 2004 56 Config Spec – Dynamic View n View your configuration specs >cleartool catcs element * CHECKEDOUT element * /main/LATEST n Edit your configuration Specs >cleartool edcs element * CHECKEDOUT element * /main/LATEST Set config spec for view “view-tag” ? [Yes] n Set configuration Specs file >cleartool setcs file_name

57 Cairo IT Team, ClearCase training, July 2004 57 Working with Snapshot Views n To set a Snapshot view to be your current view all you need to do is to CD to the path of the snapshot view you created, example: > cd /net/md8/export/home/users/amre/views/amre_test_vu n Next thing you need to do is to load the needed directories and files from the VOB

58 Cairo IT Team, ClearCase training, July 2004 58 Adding or Modifying Load Rules You can add or modify load rules in any of the following ways: n Any time you edit and modify a snapshot view’s config spec, ClearCase updates the entire view. This is appropriate when you first create a view, or when you modify a view’s version-selection rules, but it may be cumbersome if you only want to add a few elements to the view n By using update –add_loadrules. The –add_loadrules option of cleartool update adds load rules to your view’s config spec but updates only the portion of the view that is affected by the new load rules

59 Cairo IT Team, ClearCase training, July 2004 59 Add Load Rules When Editing the Config Spec n Open the view’s config spec for editing by doing the following: — Open a shell and change to a directory in the view (Where the elements will be loaded from VOB). — Use the following command to edit the config spec file: > cleartool edcs ClearCase opens the view’s config spec in your default text editor n In your text editor, use the following syntax to create load rules: load vob-tag/element-pathname For example, the rule load /vobs/testvob loads all files and directories in the VOB named /vobs/testvob. The rule load /vobs/testvob/batch loads only the batch directory recursively. n Save the config spec and exit the text editor. n In your shell, answer Yes at the ClearCase prompt for setting the config spec.

60 Cairo IT Team, ClearCase training, July 2004 60 Add Load Rules with update –add_loadrules n Use the following command: > cleartool update –add_loadrules element-pathname Where, element-pname: names an element in the VOB namespace at a pathname that is relative to a snapshot view. n For example, the following command loads all elements in a VOB named /guivob into the view pat_v1.4_cropcircle_sv: > cleartool update –add_loadrules ~/pat_v1.4_cropcircle_sv/guivob n You can also use a relative pathname for the element-pathname argument. For example, these commands load all elements in the vob guivob: > cd ~/pat_v1.4_cropcircle_sv > cleartool update –add_loadrules guivob n These commands load only the batch directory recursively: > cd ~/pat_v1.4_cropcircle_sv > cleartool update –add_loadrules guivob/batch

61 Cairo IT Team, ClearCase training, July 2004 61 Excluding Elements from Loading n ClearCase loads all directory elements recursively. To exclude some elements from loading, you can use an element rule in the config spec that selects an element’s initial version. For all ClearCase elements, the initial version contains no data.. n To Exclude Elements you have to o pen the view’s config spec for editing — Open a shell and change to a directory in the view — Use the command > cleartool edcs — In the text editor, create an element rule that specifies the initial version of the element you want to exclude by using the following syntax: element vob-tag/element-pathname /main/0 n For example, the element rule element /guivob/interface /main/0 loads the empty version of the interface directory in /guivob, preventing any of its child elements from loading. n Save the config spec and exit the text editor. In your shell, answer Yes at the ClearCase prompt for setting the config spec.

62 Cairo IT Team, ClearCase training, July 2004 62 Updating a Snapshot View n The rules in your view’s config spec are usually designed to select a discrete set of versions from the VOB. For example, your view is usually intended to contain a set of versions that build successfully. However, when other developers check in new versions from their views, a snapshot view may become out of date or inconsistent with the versions in the VOB n To make sure that your view contains the set of versions the config spec selects, you must update it n An update operation copies versions of elements from a VOB to your view. Only the checkin operation copies changes from your view back to a VOB

63 Cairo IT Team, ClearCase training, July 2004 63 Updating the View n You can start an update operation for: — The entire view — At least one file or at least one directory tree n To update the view, use cleartool update with any of the following options: > cleartool update command-options snapshot-view-pathname n The snapshot-view-pathname argument is optional if you enter the update command from the root directory of the view n For a description of all available command options, see the update reference page in the Command Reference

64 Cairo IT Team, ClearCase training, July 2004 64 Updating the View n For example: > cleartool update ~/pat_1.4_cropcircle_sv n NOTE: You can use the Update Tool to update the view instead of the command line. To start the update GUI, use the following command: > cleartool update –graphical snapshot-view-pathname

65 Cairo IT Team, ClearCase training, July 2004 65 Updating Files and Directory Trees n To save time, you can update individual files or directories. (Rational ClearCase updates directories recursively.) Updating only specific parts of your view may eventually cause the view to contain an inconsistent set of versions Use the following command: > cleartool update command_options pathnames-of-loaded-elements n NOTE: You cannot update a checked-out file. To undo changes to a checked-out file and start over with the version in the VOB, cancel the checkout

66 Cairo IT Team, ClearCase training, July 2004 66 Unloading Elements n If a view’s config spec no longer selects an element, ClearCase removes, or unloads, it from the view. Unloading does not affect view-private files or view-private directories n Updating can cause an element to be unloaded from a view in the following situations: — You remove the load rule that specifies the element (or that specifies a directory element somewhere above it) — The version-selection rules no longer select any version of the element. This can happen when your config spec selects a version of the parent directory that no longer contains a version of the file element

67 Cairo IT Team, ClearCase training, July 2004 67 Unloading Files n The action that ClearCase takes to unload a file depends on the file’s current state: — For a file that is not checked out, ClearCase deletes the file from the view — For a hijacked file, ClearCase appends.unloaded to the file name, unless you use update –overwrite to delete hijacked files — For a checked-out file, ClearCase appends.unloaded to the file name. The version remains checked out to your view

68 Cairo IT Team, ClearCase training, July 2004 68 Unloading Directories n ClearCase unloads directories recursively. To unload a directory element, ClearCase unloads the files in the directory. If any view-private objects, hijacked files, or checked-out files are in the directory, or if the directory is currently in use (for example, if your current working directory is in or below the directory) ClearCase appends.unloaded to the name of the directory n For example, if the directory src contains view-private files, ClearCase renames the directory to src.unloaded

69 Cairo IT Team, ClearCase training, July 2004 69 Working in a Snapshot View Without the Network (Laptop) n If you need to work with your source files from a computer that is disconnected from the network of Rational ClearCase hosts and servers, you can set up a snapshot view for disconnected use n This includes the following tasks: — Setting up a view — Preparing the view — Disconnecting the view — Working in the view — Reconnecting to the network — Using the Update Tool

70 Cairo IT Team, ClearCase training, July 2004 70 Working in a Snapshot View Without the Network (Laptop) n While on network: — Update the view from the VOB — Check out the files you intend to work on offline — Deactivate clearcase integrations n Disconnect from Network: — Use windows explorer to modify the checked out files in the snapshot view location — If you want to modify non-checkedout files, there is a way to do so and they are considered hijacked n Connect to network: — Reactivate clearcase integrations — Find the files modified while disconnected and also hijacked files — Check in all files to the VOB — Update your view from the VOB with any changes done on VOB while you were offline

71 Cairo IT Team, ClearCase training, July 2004 71 Working with Vobs n List files in a VOB >ls file_name archive db test_data test_log version >cleartool ls file_name@@/main/1 Rule: /main/LATEST archive@@/main/1 Rule: /main/LATEST db@@/main/1 Rule: /main/LATEST test_data@@/main/1 Rule: /main/LATEST test_log@@/main/1 Rule: /main/LATEST version@@/main/4 Rule: /main/LATEST >cleartool ls -long version file_name@@/main/1 Rule: element * /main/LATEST directory version archive@@/main/1 Rule: element * /main/LATEST directory version db@@/main/1 Rule: element * /main/LATEST directory version test_data@@/main/1 Rule: element * /main/LATEST directory version test_log@@/main/1 Rule: element * /main/LATEST version version@@/main/4 Rule: element * /main/LATEST

72 Cairo IT Team, ClearCase training, July 2004 72 Working with Vobs..Cont n List version of a file in a VOB >cleartool lsvtree file_name file_name@@/main file_name@@/main/4 >cleartool lsvtree –all file_name file_name@@/main file_name@@/main/0 file_name@@/main/1 file_name@@/main/2 file_name@@/main/3 file_name@@/main/4

73 Cairo IT Team, ClearCase training, July 2004 73 Working with Vobs..Cont n View different versions of a file in a VOB >cat file_name@@/main/3 >cat file_name@@/REL2 >cat file_name@@/main/LATEST

74 Cairo IT Team, ClearCase training, July 2004 74 Checkout / Checkin Files n Checkout a file >cleartool checkout myfile.c Checkout comments for “myfile.c” Fix Bug 102.. Checked out “myfile.c” from version “/main/3”. n List Checked out files >cleartool lscheckout –me (By current login) >cleartool lscheckout –cview (In current VIEW) >cleartool lscheckout –all (All files in VOB)

75 Cairo IT Team, ClearCase training, July 2004 75 Checkout / Checkin Files n Checkin a file >cleartool checkin –c “Fix Bug 103” myfile.c Checked in “myfile.c” version “/main/4”. n Cancel Checkout of a file >cleartool uncheckout myfile.c Save private copy of “myfile.c"? [yes] no Checkout cancelled for “myfile.c”.

76 Cairo IT Team, ClearCase training, July 2004 76 Creating new elements n Add new directory to a VOB > cleartool mkdir doc Creation comments for “doc”: New directory for documentation. Created directory element “doc”. Checked out “doc” from version “/main/0”. n Add new element to a VOB > cleartool mkelem document1.txt Creation comments for “document1.txt”: New document. Created element “document1.txt” (type “text_file”) Checked out “document1.txt” from version “/main/0”.

77 Cairo IT Team, ClearCase training, July 2004 77 Metadata for Process Control n n Labels n n Attributes n n Branching n n Merging n n Hyperlinks n n Element Types n n Triggers

78 Cairo IT Team, ClearCase training, July 2004 78 Labels n Declare new label type >cleartool mklbtype –c “Release2” REL2 Created label type “REL2”. n List Label types declared >cleartool lstype -kind lbtype 05-Sep.15:49 plkvobadm label type "CHECKEDOUT" "Predefined label type used to represent checked out versions." 30-Jun.16:46 plkvobadm label type "REL2" “Release2" n Label a file >cleartool mklabel REL2 myfile.c Created label “REL2” on “myfile.c” version “/main/4”

79 Cairo IT Team, ClearCase training, July 2004 79 Attributes n Declare attribute type >cleartool mkattype –c “Sample Attribute” Project >cleartool mkattype –c “Sample Metric Attribute” \ –vtype integer –gt 0 –le 10 -default 1 Metric_Attribute >cleartool mkattype –c “Development stages” \ -enum /”development/”,/”integration/”, /”released/” Stage Attributes can be attached to an element, a branch, a specific version or even hyperlinks and symbolic links and their usage can be restricted to specific branch, version by –vpbranch, -vpversion switches

80 Cairo IT Team, ClearCase training, July 2004 80 Attributes n Attach attribute/value pair to a file/version/branch >cleartool mkattr –ver /main/3 Metric_Attribute 6 myfile.c Created attribute “Metric_Attribute” on “myfile.c@@/main/3” n Replace existing attributes >cleartool mkattr –config hello.exe –replace qa_tested /”waiting/” Created attribute “qa_tested” on “/project/@@/main/3” Created attribute “qa_tested” on “/project/src/@@/main/2” Created attribute “qa_tested” on “/project/src/myfile.c@@/main/2” Created attribute “qa_tested” on “/project/src/myfile.h@@/main/2” n Remove attribute instance >cleartool rmattr Stage myfile.c

81 Cairo IT Team, ClearCase training, July 2004 81 Branching n Declare new branch type >cleartool mkbrtype –c “Bug Fixes” rel2_bugs Created branch type “rel2_bugs”. n List branch types >cleartool lstype -kind brtype 05-Sep.15:49 plkvobadm branch type "main" "Predefined branch type used to represent the main branch of elements." 30-Jun.16:20 plkvobadm branch type “rel2_bugs“ "Bug Fixes"

82 Cairo IT Team, ClearCase training, July 2004 82 Branching n Branch a file >cleartool mkbranch rel2_bugs myfile.c Creation comments for “myfile.c@@/main/rel2_bugs": Bug Fix Branch. Created branch "rel2_bugs" from “myfile.c" version "/main/4". cleartool: Warning: Version checked out ("/main/rel2_bugs/0") is different from version selected by view before checkout ("/main/4"). * Checked out “myfile.c" from version "/main/rel2_bugs/0". * You need to set your configuration specs to the new branch rel2_bugs

83 Cairo IT Team, ClearCase training, July 2004 83 Branching n Configuration specs could be set to view a specific branch of an element, or create this branch if it doesn’t exist when checked out. element * CHECKEDOUT element * …/rel2_bugfix/LATEST element * /main/LATEST –mkbranch rel2_bugfix

84 Cairo IT Team, ClearCase training, July 2004 84 Merging n Merge Algebra base contrib 1 contrib 2 merge result F AAAA B D E C D Q B Z ? deleted inserted changed deleted C inserted changed Z conflict

85 Cairo IT Team, ClearCase training, July 2004 85 Merging 2 0 /main 0 1 1 /bugs Branch 3 Merge A common merge practice Merge from bugs branch to the main branch of the file

86 Cairo IT Team, ClearCase training, July 2004 86 Merging >cleartool co myfile.c@@/main/LATEST Checkout comments for "myfile.c":. cleartool: Warning: Version checked out ("/main/3") is different from version selected by view before checkout ("/main/bugs/1"). Checked out "myfile.c" from version "/main/3". >cleartool catcs element * CHECKEDOUT element * /main/bugs/LATEST element * /main/LATEST

87 Cairo IT Team, ClearCase training, July 2004 87 Merging cleartool merge -to myfile.c -ver /main/bugs/LATEST <<< file 1: /vobs/TNT_pfgen/pfgen/myfile.c@@/main/1 >>> file 2: /vobs/TNT_pfgen/pfgen/myfile.c@@/main/bugs/1 >>> file 3: myfile.c --------[after 11 file 1]----------|------[inserted 12-13 file 2]----- -| | Added in Branch bugs |- --------[after 11 file 1]----------|-------[inserted 12-15 file 3]----- -| | added version 3 |- Do you want the INSERTION made in file 2? [yes] y Applying INSERT from file 2 [lines 12-13] Do you want the INSERTION made in file 3? [no] y Applying INSERT from file 3 [lines 12-15] Moved contributor "myfile.c" to "myfile.c.contrib.1". Output of merge is in "myfile.c". Recorded merge of "myfile.c".

88 Cairo IT Team, ClearCase training, July 2004 88 Merging >cleartool describe myfile.c version "myfile.c@@/main/CHECKEDOUT" from /main/3 (reserved) checked out 12-Jul-02.11:50:28 by username (username.plk@plkvob) by view: username_vu (“plkview:/dsk3/views/username_vu.vws") Element Protection: User : username : rwx Group: plk : rwx Other: : r-x element type: text_file predecessor version: /main/3 Hyperlinks: Merge <- /vobs/plk_IT_basetrain/myfile.c@@/main/bugs/1

89 Cairo IT Team, ClearCase training, July 2004 89 Merging >cleartool checkin -nc myfile.c cleartool: Warning: Version checked in is not selected by view. Checked in "myfile.c" version "/main/4".

90 Cairo IT Team, ClearCase training, July 2004 90 Hyperlinks 2 11 2 3 /main 0 1 0 /bugfix /main 0 1 0 /bugfix myfile.cmyfile.doc QA_LINK QA_LINK -> /vob/project/myfile.doc @@/main/bugfix/2 QA_LINK <- /vob/project/myfile.c @@/main/bugfix/1 A hyperlink is an annotation that depicts a relationship between two objects

91 Cairo IT Team, ClearCase training, July 2004 91 Hyperlinks n Create hyperlink type > cleartool mkhltype –c “Sample hyperlink” TESTED Created hyperlink type “TESTED”. n Attach hyperlink instance. It can be attached to element, version or branch. > cleartool mkhlink TESTED myfile.c myfile.doc Created hyperlink “TESTED@102@/vob/plk_IT_basetrain”.

92 Cairo IT Team, ClearCase training, July 2004 92 Hyperlinks n Search for a hyperlink > cleartool find. –version ’hltype(TESTED)’ -print./myfile.c@@/main/3./myfile.doc@@/main/1 > cleartool find. –version ’hltype(TESTED,->)’ -print./myfile.c@@/main/3 >cleartool find. –version ’hltype(TESTED,<-)’ -print./myfile.doc@@/main/1

93 Cairo IT Team, ClearCase training, July 2004 93 Element Types n Create new subtype of ‘text_file’ type >cleartool mkeltype –supertype text_file –c “VHDL source file” vhdl_source Created element type “vhdl_source”. n Create new element of predefined type >cleartool mkelem –nc and2.vhd Created element “and2.vhd” (type “vhdl_source”). Checked out “and2.vhd” from version “/main/0” n Create new element of undefined type >cleartool mkelem –eltype text_file and2.abc Created element “and2.abc” (type “text_file”). Checked out “and2.abc” from version “/main/0”

94 Cairo IT Team, ClearCase training, July 2004 94 Element Types n Change existing element types > cleartool chtype vhdl_source and2.vhd nand2.vhd Changed type of element “and2.vhd” to vhdl_source. Changed type of element “nand2.vhd” to vhdl_source. Element types and file-typing rules are stored in magic files (default magic file is at /usr/atria/config/magic/default.magic) n A user can create his/her own magic file (.magic) and point the environmental variable MAGIC_PATH to it.

95 Cairo IT Team, ClearCase training, July 2004 95 Element Types n Sample of Magic file contents : doc_file compressed_file : -name "*.[dD][oO][cC]" ; ms_excel ms_office compressed_file : -name "*.[xX][lL][sS]" ; csh_script script text_file : -printable & -magic 0, "#!" & - token "csh" ; ksh_script script text_file : -printable & -magic 0, "#!" & - token "ksh" ; pdf compressed_file : -name "*.[pP][dD][fF]" ;

96 Cairo IT Team, ClearCase training, July 2004 96 Triggers n Use triggers to control the development process n Triggers can execute before or after the specified command — Verify conditions are met prior to execution — Prevent unauthorized individuals from executing commands n Triggers can execute after the specified command — Send notifications to concerned project members — Apply meta-data to elements if specified criteria is met

97 Cairo IT Team, ClearCase training, July 2004 97 Build Control n Build tools n Additional features in clearmake n Derived Objects n Configuration Records n Manipulating Derived Objects n Parallel and Distributed Builds

98 Cairo IT Team, ClearCase training, July 2004 98 Build Tools n Clearmake: — the main tool used with Unix n Omake: — another tool used on Windows that can be integrated with Developer's Studio as a replacement to its default compiler. clearmake exists on Windows also

99 Cairo IT Team, ClearCase training, July 2004 99 Additional Features in clearmake n Build auditing -- a complete “bill of material” n Automatic detection of source dependencies including header file dependencies n Build avoidance algorithm -- guarantees correct results in a parallel development environment n Binary sharing among developers n Compatibility modes -- use clearmake with makefiles constructed for other make variants n Parallel and distributed building in a heterogeneous environment

100 Cairo IT Team, ClearCase training, July 2004 100 Derived Objects n A derived object (DO) is any file created within a VOB by a build script n Each DO consists of a : — File name and VOB directory — Derived object identifier (DO-ID) n Hello@@24-Feb.16:40.134 — Data container — Configuration record (CR) — VOB database catalog for shareable DOs

101 Cairo IT Team, ClearCase training, July 2004 101 Derived Objects n List derived objects : >cleartool lsdo –long 23-Aug-02.12:14:23 username (username.sysadmin@plkvob) create derived object "reg_model.exe@@23-Aug.12:14.651" size of derived object is: 488287 last access: 23-Aug-02.12:14:23 references: 1 => plkview:/net/plkview/views/username_regmodel_vu.vws

102 Cairo IT Team, ClearCase training, July 2004 102 Configuration Records n View configuration records (CR) : >cleartool catcr reg_model.exe Target exec built by username.sysadmin Host “plkview" running SunOS 5.8 (sun4u) Reference Time 23-Aug-02.12:11:12, this audit started 23-Aug-02.12:13:38 View was plkview:/net/plkview/views/username_regmodel_vu.vws Initial working directory was /vobs/plk_IT_basetrain/regmodel/ss6 ---------------------------- MVFS objects: ---------------------------- /vobs/plk_IT_basetrain/regmodel/src/glue/Makefile@@/main/1 /vobs/plk_IT_basetrain/regmodel/src/glue/overrides.mk@@/main/1 /vobs/plk_IT_basetrain/regmodel/src/glue/overrides.ss6.mk@@/main/1 …

103 Cairo IT Team, ClearCase training, July 2004 103 Configuration Records ---------------------------- Variables and Options: ---------------------------- GMAKE_PARALLEL= MAKE=/opt/rational/clearcase/bin/clearmake MAKEFLAGS= PATH_MGC=/usr/devmgc ---------------------------- Build Script: ---------------------------- … /opt/rational/clearcase/bin/clearmake -w exec ; /usr/devmgc/lib/mgcms/do_exports glue/exports.exec exports ----------------------------

104 Cairo IT Team, ClearCase training, July 2004 104 Configuration Records n Comparing config records > cleartool diffcr regmodel.exe regmodel.exe@@31- Oct.07:25.304 Differences detected: — Versions of MVFS objects used as sources — Objects produced during the build — Versions of non-MVFS objects that appeared as makefile dependencies — The number of times an object was referenced during the build, and the first target in which that object was referenced — Build options — The build script executed

105 Cairo IT Team, ClearCase training, July 2004 105 Manipulating Derived Objects n Unshared derived objects (produced in express build) can be promoted to the VOB database to be used by other views via Winkin process, e.g. > cleartool winkin DO-pname n To preserve configuration records (CR) of the derived object (DO) during checking in the DO, you have to checkin to its place in the VOB. You can use –from switch if the DO is created in another directory, e.g. > cleartool checkin –c “Beta 2 Build” –from./hello../bin/hello

106 Cairo IT Team, ClearCase training, July 2004 106 Manipulating Derived Objects view_scrubber is used to remove derived objects data containers as long as they are checked in the VOB. It can be used also to convert DOs to shareable or promote these DOs. It can be found at /opt/rational/clearcase/etc/view_scrubber

107 Cairo IT Team, ClearCase training, July 2004 107 Using ClearCase On Windows

108 Cairo IT Team, ClearCase training, July 2004 108 Requirements and Settings User Environment variables (not SYSTEM variables): CCASE_BLD_UMASK  002 CLEARCASE_PRIMARY_GROUP  plk (User’s Primary Group in Active Directory) - - Control Panel  ClearCase  Options, choose the Domain  MGC - - You may need to restart your PC after ClearCase installation to confirm Clearcase services are up using MGC\clearcase_albd Account: - - Control Panel  Administrative Tools  Services  Atria Location Broker: This service should be Automatically Up with “Log On As” MGC\clearcase_albd

109 Cairo IT Team, ClearCase training, July 2004 109 How To share The View Location The View Location on the PC should be shared (Full Control) for both: 1- User’s MGC Account 2- MGC\clearcase_albd Account n From “My Computer”, On the Partition where you have the largest free space (Ex: E ), Create a new folder: cc_views n Right Click on the folder, Choose “Sharing And Security..”, Choose “Share This Folder”, Share Name: cc_views, Click on “Permissions” button, Click on “Add” button, Type your login name, check it and add it, then type “clearcase_albd”, check it and add it. n For both accounts choose “Full Control” in the lower part of the share permissions tab, then click OK to accept the settings.

110 Cairo IT Team, ClearCase training, July 2004 110 ClearCase Program menu

111 Cairo IT Team, ClearCase training, July 2004 111 ClearCase Home Base User Interface

112 Cairo IT Team, ClearCase training, July 2004 112 ClearCase Properties

113 Cairo IT Team, ClearCase training, July 2004 113 Make Sure CC Is Running

114 Cairo IT Team, ClearCase training, July 2004 114 Stopping CC If ClearCase Cannot be stopped/restarted, you have to restart your PC.

115 Cairo IT Team, ClearCase training, July 2004 115 ClearCase Properties

116 Cairo IT Team, ClearCase training, July 2004 116 Create View

117 Cairo IT Team, ClearCase training, July 2004 117 Create View, Cont.

118 Cairo IT Team, ClearCase training, July 2004 118 Create Dynamic View

119 Cairo IT Team, ClearCase training, July 2004 119 Create Dynamic View, Cont. The Mapped Drive Letter could be any free mapping Letter. Ex: Z, Y, X, …. Check Network Drives in “My Computer” Or “Windows Explorer” loginname_vu

120 Cairo IT Team, ClearCase training, July 2004 120 Create Dynamic View, Cont. Advanced Options \\machine\cc_views\MGC\loginname\loginname_vu.vws plk_nt

121 Cairo IT Team, ClearCase training, July 2004 121 Create Dynamic View, Cont. loginname_vu

122 Cairo IT Team, ClearCase training, July 2004 122 Create Dynamic View, Cont. loginname_vu

123 Cairo IT Team, ClearCase training, July 2004 123 Create Snapshot View

124 Cairo IT Team, ClearCase training, July 2004 124 Create Snapshot View, Cont. E:\cc_views\MGC\loginname\loginname_snap_vu

125 Cairo IT Team, ClearCase training, July 2004 125 Create Snapshot View, Cont. Advanced Options E:\cc_views\MGC\loginname\loginname_snap_vu.vws loginname_snap_vu

126 Cairo IT Team, ClearCase training, July 2004 126 Create Snapshot View, Cont. E:\cc_views\MGC\loginname\loginname_snap_vu

127 Cairo IT Team, ClearCase training, July 2004 127 Create Snapshot View, Cont. Select VOBs/Elements To Load

128 Cairo IT Team, ClearCase training, July 2004 128 Create Snapshot View, Cont.

129 Cairo IT Team, ClearCase training, July 2004 129 Create Snapshot View, Cont. loginname_snap_vu

130 Cairo IT Team, ClearCase training, July 2004 130 Updating Snapshot View

131 Cairo IT Team, ClearCase training, July 2004 131 Remove View

132 Cairo IT Team, ClearCase training, July 2004 132 Remove View, Cont.

133 Cairo IT Team, ClearCase training, July 2004 133 Remove View, Cont.

134 Cairo IT Team, ClearCase training, July 2004 134 Remove View, Cont. test_tmp_vu

135 Cairo IT Team, ClearCase training, July 2004 135 ClearCase Doctor

136 Cairo IT Team, ClearCase training, July 2004 136 Context Sensitive Menus

137 Cairo IT Team, ClearCase training, July 2004 137 Mounting VOBs

138 Cairo IT Team, ClearCase training, July 2004 138 Compare Versions Comparing with Previous Version is not always successful. It depends on the file type. Ex: It Can’t be done with MS Project.mpp files and certain MS Word versions.

139 Cairo IT Team, ClearCase training, July 2004 139 Element Properties

140 Cairo IT Team, ClearCase training, July 2004 140 Version Tree Browser

141 Cairo IT Team, ClearCase training, July 2004 141 Version Tree Browser, Cont.

142 Cairo IT Team, ClearCase training, July 2004 142 UCM On UNIX

143 Using Unified Change Management ClearCase General concept & UNIX

144 Cairo IT Team, ClearCase training, July 2004 144 Unified Change Management n Pros and Cons n UCM Workflow n Roles and Responsibilities n UCM Terminology n Setting Up Working Areas n Finding and Setting Activities n Working on Activities n Delivering Activities n Rebasing your Work Area n Sample GUI scenario

145 Cairo IT Team, ClearCase training, July 2004 145 Pros and Cons n Pros — Provides an out of box solution enabling groups to work on product development, not customizations. — Automatically manages artifacts and work in progress. n Config specs are managed by the software, not the developer. n Artifacts are tracked by "activities", allowing the user to more readily identify the work done for specific tasks. n Activities can be more easily prioritized because of the way they are identified. n Work loads and critical paths can be identified more easily too. n Generic reporting capabilities are included in the system. — Work is done in isolation to not impact others. Users choose when to make changes available to others. — Work on specified tasks can be tracked easily during the entire software lifecycle. — Should be good for teams without well defined software development processes.

146 Cairo IT Team, ClearCase training, July 2004 146 Pros and Cons n Cons — Can be customized, but provides a fairly rigid methodology that must be followed. — Though it is based on many years of development and many customers' usage models, the UCM features are recent enhancements to ClearCase (1999). — Sharing data between projects is constrained, administrative guidelines must be followed. Components can be controlled by only ONE PVOB.

147 Cairo IT Team, ClearCase training, July 2004 147 UCM Workflow

148 Cairo IT Team, ClearCase training, July 2004 148 UCM Workflow - Join UCM Project. - Create 2 work areas : - Private area for working in isolation in activities - Shared area for testing activities delivered

149 Cairo IT Team, ClearCase training, July 2004 149 UCM Workflow - Use cleartool lsactivity to list activities in your work area. - Setting your view to an activity instructs ClearCase to assign any versions of source files you create to the activity’s change set. You must set your view to an activity before you can work on an activity.

150 Cairo IT Team, ClearCase training, July 2004 150 UCM Workflow - Checkout files to be writable for developer. - View / Modify Metadata to describe changes. - Checkin changes. - Indicate progress either by ClearQuest or by specific schema.

151 Cairo IT Team, ClearCase training, July 2004 151 UCM Workflow - Prepare work areas if they are older than current integration. - Start deliver operation - Merge changes between private work area and shared integration area. - Build and Test integration. - Finish delivery and ClearCase will check in modifications.

152 Cairo IT Team, ClearCase training, July 2004 152 UCM Workflow - Integrator organizes delivered activities into baselines. When a baseline reaches stable level after testing, your integrator designates it as a recommended baseline. - To work with the set of versions in the recommended baseline, you rebase your development work area. You will need to merge this new baseline with your private area, test and complete rebase operation.

153 Cairo IT Team, ClearCase training, July 2004 153 Roles and Responsibilities n Project manager — Allocates components and activities for the project — Determines initial milestones (baselines) — Specifies the project's policies and tasks n Architect — Translates project architecture into directory structure n Administrator — Creates and maintains the infrastructure

154 Cairo IT Team, ClearCase training, July 2004 154 Roles and Responsibilities n Developer — Creates and modifies project activities — Builds and tests changes — Delivers changes to the integration area — Manages personal work areas n Integrator — Integrates changes from developers into the project's integration work space — Builds and tests changes — Creates new baselines

155 Cairo IT Team, ClearCase training, July 2004 155 UCM Terminology n Elements — Files and directories put under version control of Clearcase. n Components — Elements are organized as components. Usually, components can be built into functional units of software. n Baselines — To keep track of different configurations of versions, your project manager or integrator creates a base- line, which records one version of each element in a component. In effect, a base- line is a version of a component.

156 Cairo IT Team, ClearCase training, July 2004 156 UCM Terminology n Activities — To create a version in a ClearCase UCM project, you must first assign it to an activity. An activity is a ClearCase object that identifies the versions created to complete a task. n Streams — A stream is a long-lived ClearCase object. It is a member of a single UCM project and is a mechanism for creating and recording config- urations. A stream identifies the exact set of versions currently available for you to view, modify, or build.

157 Cairo IT Team, ClearCase training, July 2004 157 UCM Terminology n n Integration Stream n n Development Streams

158 Cairo IT Team, ClearCase training, July 2004 158 Setting Up Working Areas n Adjust your UMASK — Set your umask to appropriate permission scheme. — Another build umask for derived objects is set by setting environmental variable CCASE_BLD_UMASK n Join UCM project — Run Join Project Wizard using the command > clearprojexp n Verify stream names — Development stream: By default the name given to it is your-user-name_project-name — Integration stream: Project Manager creates the integration stream during project creation. This stream is the default target to which you deliver your work and from which you update your work area.

159 Cairo IT Team, ClearCase training, July 2004 159 Setting Up Working Areas n Set up views — The wizards sets the following naming defaults : n Development view : the view name is the same as the stream name. n Integration view : the view name is your-user-name_integration-stream-name n Access your development view — After creating your development view, the Join Project Wizard offers to open your development view in a shell or File Browser (xclearcase), a GUI from which you can browse files and directories. — To access your development view using command line, you will need to set your dynamic view and mount the VOB which contains your project : > cleartool setview your_view-tag > cleartool mount vob-tag

160 Cairo IT Team, ClearCase training, July 2004 160 Finding and Setting Activities n Finding Activities — Find activities by Project Explorer GUI (using the command clearprojexp) — Find activities with ClearCase Dialogs. When using xclearcase GUI, during checkout/checkin commands you get a dialog box from which you can find activities available to select among them the activity you currently work at. — Find activities by command line > cleartool lsactivity For example: > cleartool setview your_view_tag > cd vob_tag > cleartool lsactivity –cview 05-Aug.09:14:17 set_up_Java project pat “set up Java project” 06-Aug.14:17:19 change_copyright_notice chris “change copyright notice”

161 Cairo IT Team, ClearCase training, July 2004 161 Finding and Setting Activities n Creating Activities — Using xclearcase GUI when performing checkin/checkout, if the activity still not created you can use new button in Activity dialog to create a new activity. — Using command line : > cleartool mkactivity For example: > cleartool mkactivity –nset –headline “Your chosen headline” Created activity with automatically generated name? [yes] Created activity “Your chosen headline” Where, -nset : prevents ClearCase from setting your view to the newly created activity.

162 Cairo IT Team, ClearCase training, July 2004 162 Finding and Setting Activities n Setting your view to an activity — Using xclearcase GUI when performing checkin/checkout, select from Activity box the activity you want to work on. — Using command line: > cleartool setactivity For Example : > cleartool setactivity Your_activity n Unsetting your view from an activity — Using command line: >cleartool setactivity –none

163 Cairo IT Team, ClearCase training, July 2004 163 Working on Activities n Checking Out Elements — To modify files and directories under source control, you must check them out. Checking out does not add versions to the activity that is currently set in the view. (Checking in creates new versions, which Rational ClearCase adds to the activity’s change set.) — Use command line to checkout >cleartool checkout –query list-of-elements Checkout important switches : -query : Detects potential problems in the checkout process caused by inappropriate config specs and prompts for action. -nc : Prevents ClearCase from prompting for a comment. -cq : Applies prompted comment to all elements in the list.

164 Cairo IT Team, ClearCase training, July 2004 164 Working on Activities n Working with Checkouts — To view an element history > cleartool lshistory –graphical element_pathname — To view an element version tree > cleartool lsvtree –graphical element_pathname — To compare with predecessor version > cleartool diff –graphical –predecessor element_pathname — To compare with different versions > cleartool diff –graphical element_pathname element_pathname@@version — To track checked out versions by myself in current view in all vobs > cleartool lscheckout –cview –me –avobs

165 Cairo IT Team, ClearCase training, July 2004 165 Working on Activities n Working with Checkouts — To view all activities’ change sets of current view. > cleartool lsactivity –long –cview — To view current activity’s change set > cleartool lsactivity –long –cact activity SAMPL051111 05-Aug-01.09:14:17 by Pat (pat.user@bread) "Created for the cropcircle_1.4 project on 09/17/00 13:25:24." owner: pat group: user stream: pat_1.4_CropCircle title: changing_copyright_strings change set versions: /guivob/prog.c@@/main/stream990805.090736/5 /guivob/spices.c@@/main/stream990805.090736/2 /guivob/onions.c@@/main/stream990805.090736/9 /guivob/tomatoes.c@@/main/stream990805.090736/1 /guivob/flour.c@@/main/stream990805.090736/3

166 Cairo IT Team, ClearCase training, July 2004 166 Working on Activities n Canceling Checkouts — If you check out a file but don’t want to check in your changes or want to start with a fresh copy, you can cancel the checkout > cleartool uncheckout element_pathname Checkout important switches : -keep : Saves modifications in view private file. -rm : Doesn’t save modifications. n Checking In Elements > cleartool checkin -cact element_pathname Checkout important switches : -cact : Checkin versions checked out for the activity currently set in your view. -nc : Prevents ClearCase from prompting for a comment. -cq : Applies prompted comment to all elements in the list.

167 Cairo IT Team, ClearCase training, July 2004 167 Delivering Activities n Deliver Operation — From your development view type > cleartool deliver –graphical — Select the activity you want to deliver — Select the stream to deliver the activity to (if not default target) n Deliver dependencies (Example)  — You can deliver Activity B without delivering Activity C — To deliver Activity C, which contains version 6, you must also deliver Activity B, which contains the versions between 6 and the most recent delivery of prog.c

168 Cairo IT Team, ClearCase training, July 2004 168 Delivering Activities n Merge Versions — If your project uses Rational ClearCase MultiSite to share source data with developers in other geographical locations, and if the project’s streams are mastered at a different site, you do not merge versions. — After selecting activities, click OK in the Deliver Preview dialog box to start merging versions in your development view with versions in the integration view. — As it merges files and directories, ClearCase displays its progress in a ClearCase UCM Deliver window. For each new version delivered to the integration view, ClearCase merges all non- conflicting differences. To see progress of the merge, click Details and an expansion box lists the versions in the merge

169 Cairo IT Team, ClearCase training, July 2004 169 Delivering Activities n Handling a Binary File in a Deliver Operation — If you have a binary file in any of your activities when you perform the deliver operation, and your organization does not have a type manager for that file type, ClearCase generates an error when it encounters the binary file during the delivery. The error occurs because there is no type manager that can merge the version of the file in your development stream with the version of the file in the integration stream — Your project manager can overcome this problem by creating a special element type for the binary file type and associating that element type with the binary file in the VOB. This special element type can tell the ClearCase system not to attempt merging the file

170 Cairo IT Team, ClearCase training, July 2004 170 Delivering Activities n Undoing a Deliver Operation — Using the command line: >cleartool deliver –cancel — Or by clicking cancel in merge manager dialog box. n Completing a Deliver Operation — Open the Deliver Progress dialog box from your development view, use command line: > cleartool deliver –complete — Completing a delivery of an activity means checking in merge results to the target stream and changing the state of the operation to Complete.

171 Cairo IT Team, ClearCase training, July 2004 171 Delivering Activities n Deliver to non-mastered stream in MultiSite projects — The deliver operation determines whether your development and target streams are mastered at different replicas. If they are mastered at different replicas, a remote deliver operation is put into effect. ClearCase changes mastership of the development stream object to match that of the target stream object, and it notifies you that it has assigned the development stream the posted status. — When your development stream has the posted status, notify the project integrator at the site that masters the target stream’s replica. The project integrator can then find posted deliver operations and either continue the operation or cancel it to return the development stream to its previous state. Note that, after you post your work, only someone at the master site can cancel or complete the operation.

172 Cairo IT Team, ClearCase training, July 2004 172 Delivering Activities n Deliver to non-mastered stream in MultiSite projects — You can create activities and perform checkins and checkouts for your development stream while the remote deliver is in process. However, you cannot add, remove, or create baselines; add or remove components; or rebase the development stream. The delivery completes when the posted deliver operation is merged with the target stream.

173 Cairo IT Team, ClearCase training, July 2004 173 Rebasing Your Work Area n Rebase Operation — From your development view type: > cleartool rebase –graphical — Select the Baseline from the Rebase Dialog Box — Select the view you want to Rebase. n Stop a Rebase Operation — By clicking cancel in Rebase Dialog Box n Resume a Rebase Operation — Use the command line: > cleartool rebase –resume –graphical

174 Cairo IT Team, ClearCase training, July 2004 174 Rebasing Your Work Area n Merge Versions in a Rebase Operation — As it does during the deliver operation, ClearCase merges all nonconflicting differences. If versions in the baseline contain changes that conflict with the corresponding versions in your development work area, ClearCase prompts you to start Diff Merge so that you can resolve the conflicts. n Cancelling a Rebase Operation — Using the command line: > cleartool rebase –cancel — Or by clicking cancel in merge manager dialog box. n Completing a Rebase Operation — Open the Rebase Progress dialog box from your development view, use command line: > cleartool rebase –complete — Completing a rebase of an activity means checking in merge results to the target stream and changing the state of the operation to Complete.

175 Cairo IT Team, ClearCase training, July 2004 175 GUI Sample Scenario n Invoke clearprojexp n Display project streams n Display development stream activities n Display integration stream n PVOB properties n Project properties n Project policies n Join project wizard n Set streams n Set development view n Set integration view n Join completion summary

176 Cairo IT Team, ClearCase training, July 2004 176 GUI Sample Scenario n Invoke xclearcase and select view n Checkout an element to modify n Attach checkout to an activity n Deliver activity from development stream n Select activity and target stream n Complete delivery process when done n Create/Modify Baseline n Baseline details n Select Baseline n Select merging view

177 Cairo IT Team, ClearCase training, July 2004 177 Invoke clearprojexp

178 Cairo IT Team, ClearCase training, July 2004 178 Display project streams

179 Cairo IT Team, ClearCase training, July 2004 179 Display development stream activities

180 Cairo IT Team, ClearCase training, July 2004 180 Display integration stream

181 Cairo IT Team, ClearCase training, July 2004 181 PVOB properties

182 Cairo IT Team, ClearCase training, July 2004 182 Project properties

183 Cairo IT Team, ClearCase training, July 2004 183 Project Policies

184 Cairo IT Team, ClearCase training, July 2004 184 Join project wizard

185 Cairo IT Team, ClearCase training, July 2004 185 Set streams

186 Cairo IT Team, ClearCase training, July 2004 186 Set development view

187 Cairo IT Team, ClearCase training, July 2004 187 Set integration view

188 Cairo IT Team, ClearCase training, July 2004 188 Join completion summary

189 Cairo IT Team, ClearCase training, July 2004 189 Invoke xclearcase and select view

190 Cairo IT Team, ClearCase training, July 2004 190 Checkout an element to modify

191 Cairo IT Team, ClearCase training, July 2004 191 Attach checkout to an activity

192 Cairo IT Team, ClearCase training, July 2004 192 Deliver activity from development stream

193 Cairo IT Team, ClearCase training, July 2004 193 Select activity and target stream

194 Cairo IT Team, ClearCase training, July 2004 194 Complete delivery process when done

195 Cairo IT Team, ClearCase training, July 2004 195 Create/Modify Baseline

196 Cairo IT Team, ClearCase training, July 2004 196 Baseline details

197 Cairo IT Team, ClearCase training, July 2004 197 Rebase development stream

198 Cairo IT Team, ClearCase training, July 2004 198 Select Baseline

199 Cairo IT Team, ClearCase training, July 2004 199 Select merging view

200 Cairo IT Team, ClearCase training, July 2004 200 Reference n This training material is based on the web training available at the URL:http://devnet.wv.mentorg.com/env/confman/ClearCase/training/cc_user/fbody.html

201 Cairo IT Team, ClearCase training, July 2004 201 Using ClearCase UCM On Windows

202 Cairo IT Team, ClearCase training, July 2004 202 UCM GUI Sample On Windows n Invoke clearprojexp n Display project streams n Display development stream activities n Display integration stream n Project Actions n Project Policies n Join project wizard n Set streams n Set Views n Choose Components n Join completion summary n Snapshot View Update n Checkout an element to modify n Attach checkout to an activity n Check In Element & Record In Activity n Deliver activity from development stream n Select activity and target stream n Complete delivery process when done n Create/Modify Baseline n Baseline details n Rebase Development Stream n Select Baseline & Merging View n Complete the Rebase Operation

203 Cairo IT Team, ClearCase training, July 2004 203 Invoke clearprojexp Start  Programs  Rational Software  Rational ClearCase  Project Explorer

204 Cairo IT Team, ClearCase training, July 2004 204 Display project streams

205 Cairo IT Team, ClearCase training, July 2004 205 Display development stream activities

206 Cairo IT Team, ClearCase training, July 2004 206 Display integration stream

207 Cairo IT Team, ClearCase training, July 2004 207 Project Actions

208 Cairo IT Team, ClearCase training, July 2004 208 Project Policies

209 Cairo IT Team, ClearCase training, July 2004 209 Join project wizard

210 Cairo IT Team, ClearCase training, July 2004 210 Set streams

211 Cairo IT Team, ClearCase training, July 2004 211 Set Types Of Views

212 Cairo IT Team, ClearCase training, July 2004 212 Set Development view

213 Cairo IT Team, ClearCase training, July 2004 213 Set integration view

214 Cairo IT Team, ClearCase training, July 2004 214 Choose Components

215 Cairo IT Team, ClearCase training, July 2004 215 Join completion summary

216 Cairo IT Team, ClearCase training, July 2004 216 Snapshot Views Update

217 Cairo IT Team, ClearCase training, July 2004 217 Checkout an element to modify

218 Cairo IT Team, ClearCase training, July 2004 218 Attach checkout to an activity Then Modify Element

219 Cairo IT Team, ClearCase training, July 2004 219 Check In Element & Record in Activity

220 Cairo IT Team, ClearCase training, July 2004 220 Deliver activity from development stream To Default Integration Stream

221 Cairo IT Team, ClearCase training, July 2004 221 Select activity and target stream

222 Cairo IT Team, ClearCase training, July 2004 222 Complete delivery process when done

223 Cairo IT Team, ClearCase training, July 2004 223 Create/Modify Baseline

224 Cairo IT Team, ClearCase training, July 2004 224 Baseline details

225 Cairo IT Team, ClearCase training, July 2004 225 Rebase development stream

226 Cairo IT Team, ClearCase training, July 2004 226 Select Baseline & Merging View

227 Cairo IT Team, ClearCase training, July 2004 227 Complete The Rebase Operation

228 Cairo IT Team, ClearCase training, July 2004 228 Reference n This training material is based on the web training available at the URL:http://devnet.wv.mentorg.com/env/confman/ClearCase/training/cc_user/fbody.html


Download ppt "ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager."

Similar presentations


Ads by Google