Showing posts with label ClearCase. Show all posts
Showing posts with label ClearCase. Show all posts

Thursday, December 11, 2008

The procedure of the deliver operation

The procedure of the deliver operation

 

The deliver operation proceeds in the following order:

 

  1. When you start the deliver operation, your development stream is placed in the deliver-in-progress state.  
  2. Dependencies between versions in the change sets of the activities that are as yet undelivered in the target stream are checked.  
  3. Each directory in your development stream is evaluated sequentially. Versions are checked out and changes are merged to the target stream when needed. If a reserved directory checkout is encountered in the target stream, the deliver operation stops. Any successful directory merges are retained.  
  4. An attempt is made to check out each element that requires a merge. If an element that cannot be checked out is encountered (for example because another team member’s deliver operation has already checked out the element), the element is skipped and more attempts are made to check out the remaining elements.  
  5. If an element cannot be checked out, the deliver operation does not proceed to the following step. In this case, you have two options:  
    • Wait until the other developer completes or cancels the deliver operation, and then restart your deliver operation. However, with a deliver operation in progress, any new versions you create in your development stream are not delivered until the next deliver operation.
    • Undo your deliver operation and continue working on your activities. 
  6. After all elements that can be checked out are successfully checked out, each element is merged. Diff Merge starts and requests your input when merge conflicts are encountered.  
  7. When all merges are finished, you are prompted to build and test the work in your integration view.  
  8. The deliver operation stays in the deliver-in-progress state until you formally complete the operation (issue the complete command). To complete the deliver, the following is done:  
    • The merge results in the target stream are checked in.
    • The state of the stream is changed to Complete.

 

Delete activities when ClearQuest Record is linked with a UCM activity

Delete activities when ClearQuest Record is linked with a UCM activity
 
You can enable ClearQuest and ClearCase integration to manage the developement process. ClearQuest is used as a defect tracking tool and ClearCase is used as source control repository. If a Rational ClearQuest record is linked with a UCM activity and you want to delete the activity, you should do:
  • Remove the link between UCM activity and ClearQuest records (In ClearCase side)
  • Delete ClearQuest records(in ClearQuest side)
Before you remove the link between UCM activity and ClearQuest records, below requisiton must be fulfilled:
  • no changeset in that activity. If yes, move the change sets to other activity
  • the operator to do this must be the owner of the ClearQuest record. Not the submitter but the owner
Then you can use below command to remove the link
cleartool rmactivity clearquest_record_id
 
executing above command does not delete the ClearQuest record. So you must login the ClearQuest and do the Delete action then. The access control of the Deletion is defined in the ClearQuest schema. You should ask the ClearQuest admin to confirm if you have the right to delete the record.
 
 

How file/directory checkouts are canceled

 
How file/directory checkouts are canceled
How file checkouts are canceled
  • When you cancel the checkout of a file element, the request is handled as follows:
  • You have prompted to rename the fie in your view to filename.keep
  • The VOB is notified that you no longer have the version checked out in your view
  • In a snapshot view, the version that was in your view when you performed the checkout operation is copied from the VOB
  • In a dynamic view, the version-selection rules in the config spec are used to select a version.
 
How directory checkouts are canceled
  • When you cancel a directory checkout, the VOB is notified that you no longer have the version of the directory checked out to your view. But you are not prompted to rename a canceled directory checkout to directory-name.keep.
  • If you cancel a directory checkout after any changes you made to rename,move, create link will lost. Any new elements you created (with mkelem or mkdir) become orphaned. But pls note that if you just only modify the content (add/remove/update lines) in the file and check in the file, the file version and its content is still there although you undo check out against that folder.
 
Orphaned elements are moved to the VOB lost+found directory under names of this form:
element-anme.UUID
 
In a snapshot view, view-private objects are not removed nor is the update operation for the directory in the view started. To return the directory in your view to its state before you checked it out, you must start the Update Tool.
Action Result after undo checkout its parent directory Input into lost+found
rename element stay in the view but the Kind is view-private No
create dir and add to source control stay in the view but the Kind is view-private Yes
create element and add to source control stay in the view but the Kind is view-private Yes
create link and add to source control stay in the view but the Kind is view-private No
delete element can not show again until you update the view No
 
 
In a dynamic view, view-private objects are not removed, but the view does revert to its previous state.
Action Result after undo checkout its parent directory Input into lost+found
rename element recover the name to its previous one No
create dir and add to source control dispear Yes
create element and add to source control dispear Yes
create link and add to source control dispare No
delete element show again No
 
To move the elements from the lost+found directory
  • To move an element from the lost+found directory to another dirctory within the VOB, use the cleartool mv command.
  • To move an element from the lost+found directory to another VOB, use the relocate command.
 
To delete an element in the lost+found directory
  • To delete an element in the lost+found directory permanently, use rmelem command.
 

Checking out directory

Checking out directory
Directories and files under Rational ClearCase source control. Having versions of directories can be helpful if, for example,you rename a source file used in a particular release and then modify your makefile to reflect this change. If you need to rebuild a previous release, you can set up your view to sleect the version of the directory that contains the file under its previous name.
 
On Unix system
To add a file or subdirectory to Rational ClearCase control, you must first check out the parent directory. It is common mistake that, after checking out a parent directry and adding elements to it, users forget to check in the directory. If you check out a directory, you can see its modified contents form your view, but other users can not see the modifications until you check in it.
 
On Windows system
You rarely need to check out a directory explicitly. The parent directory of a file is checked out and checked in when you add the file to source control. in a directory under version control, a new version of the directory is created when you add or rename a file element under source control. Before you modify the contend in the view, if you check out the parent directory explicitly, you can see its modified contents from your view, but other users can not see the modifications until you check in it.
 
Modifications here means the operations of mkdir,mkelement,rename,ln and exclude the operations that only update the contents in the source files
 

Tuesday, December 9, 2008

Reserved and Unreserved Checkouts

Reserved and Unreserved Checkouts
In some version control systems, only one user at a time can reserve the right to create a new version on a branch or in a stream. In other systems, many users can compete to create the same new version.Both models are supported by allowing tow kinds of checkouts: reserved and unreserved.
 
The view with a reserved checkout has the exclusive right to check in a new version for a branch or stream. Many views can have unreserved checkouts. A unreserved checkout does not guarantee the right to create the successor version. If several views have unreserved checkouts, the first view to check in the element on a branch or stream creates the successor; developers who arew working in other views must merge the check-in changes into their own work before they can check in.
 
For example, one file in view A is checked out with Reserved option. The file is checked out in view B with Unreserved option too ( only can be checked out with Unreserved option since it has been Reserved by view A). That means the file in view B can not be checked in unless the files in View A has been checked-in.
 
In above example, if the file is checked out in View A and B with Unreserved option, it can be checked in at any time without considering the check-in sequence. The first check-in makes the successor version and later one will create antoher version after merge operation.
 
The status of a checkout can be changed from reserved to unreserved or from unreserved to reserved. Users can not change an unresearved checkout to a reserved checkout if the version is checked out as reserved in another view. Here are the 2 ways to do this
    • Using cleartool command

    Cleartool reserve element-name

    Cleartool unreserved element-name

    • Using the GUI

    In Rational ClearCase Explorer, select the checked-out version and click either Tools->Reserve or Tools->Unreserve

    In Windows Explorer, right-click a checked-out version. Then click ClearCase->Properties of Version.

Friday, October 17, 2008

Moving activity from one view/stream/project to another different view/stream/project


Moving activity from one view/stream/project to another different view/stream/project

Here are the steps to move the activity from one view/stream/project to another different view/stream/project if its change set is empty. It is useful when users assign the activity to incorrect views.  Pls have a try and let me know if you have any concerns.

S1: To change an activity from view VA to VB in the same stream if it is already set in view VA

    1. in ClearCase, unset the activity from VA
    2. in ClearQuest, do Workon the activity again and choose VB in the Select View dialog box.

Mostly, one activity may be used by more than one developer. You can also use above steps to change the activity between different views although there are change set before it is used by another view.

S2: To change an activity from view VA in stream SA to VB in stream SB if it has already set in view VA

    1. In ClearCase, unset the activity from VA
    2. In ClearCase, delete the activity using below command. Activity-selector is the record id of DefectV2,CR,AdhocActivity entities.

             cleartool rmact activity-selector
             the command should be run by the record owner(not submitter) and it will not delete the record in ClearQuest but only unlink the ClearQuest record from ClearCase

    c.      In ClearQuest, do Workon action and choose view VB in stream SB in the Select View dialog box.    

    
S3: To change an activity from project PA to project PB if it has already set in view VA of project PA

    1. do the steps a, b mentioned in S2
    2. In ClearQuest, do Modify action to change the field value UCM Project from PA to PB
    3. In ClearQuest, do Workon action and choose correct view/stream in the Select View dialog box.

In S2 and S3, it only works when the activity has no change set. Else, you can

    a. move the change set to other activities first and then follow above steps to move the activity to another view/stream/project.

    b. Submit new records to follow up.

 

Monday, November 26, 2007

Steps to Create UCM Project from Scratch

Steps to Create UCM Project from Scratch

Here are the standard steps to create UCM project

1. Create PVOB

  1. Open Create VOB.
  2. In Name and Major Parameters page, enter the PVOB name and set the option "Create as a UCM project VOB" and clear the option "This VOB will contain UCM components and click Next button
  3. In Storage page, select one location to input the PVOB and click Next
  4. In Options page, select none in the administrative VOB list and set the option "Reconnect to this VOB at login time" and click Finish.

2. Create one VOB without any component

  1. Open Create VOB.
  2. In Name and Major Parameters page, enter the VOB name and clear the option "Create as a UCM project VOB" and set the option "This VOB will contain UCM components and click Next button.
  3. In the Components page, set the option "Allow this VOB to contain multiple components" and click Next. Pls note that if the option "This VOB will contain UCM components" in step b, the Components page does not display. In the Components page, there is one option "Create VOB as a single VOB-lever component. If select the option, one component with the same name of the VOB will be created after the VOB creation. In this scenario, we do not want to system to create one component but we manual create them later.
  4. In Storge page, select one location to input the VOB and click Next.
  5. In Options page, select the PVOB name created in above step from the administrative VOB list and set the option "Reconnect to this VOB at login time" and click Finish.

3. Create UCM Project

  1. Open ClearCase Project Explorer.
  2. Right click the PVOB we created in step 1 and select New->Project
  3. In the New project -Step 1 window, input the project and integration stream name and click  Next.
  4. In the Step 2 window, select option "No" and click Next.
  5. In the Step 3 window, click Next and ignore the warning message since we have no component for the PVOB.
  6. in the Step 4 window, click Next without any changes.
  7. In the Step 5 window, click Finish since we will not integrate with CQ so far.

4. Create Integration View

  1. Open ClearCase Project Explorer
  2. Right click the integration stream we created in step 3 and select Create view.
  3. In the View Creation Wizard -Review Types of Views page, select "Dynamic" and click Next.
  4. In the View Creation Wizard-Choose Name and Drive for a Dynamic View, input the integration view name and its location and click Finish.

5. Create components

    1. Open ClearCase Project Explorer
    2. Right click the components under the PVOB created in step 1 and select New->Component in a VOB.  There are 2 types of components. One is Component in a VOB and another is component without a VOB. If the component without a VOB means the component can not have any elements. This kind of component is used to store the composite baseline.
    3. In the Create a Component in a VOB window, select the VOB created in step 2, input the component name and root directory and click Ok. Pls note that the Root Directory name should begin with "\" (a must)
    4. In the Choose a view window, select the integration view created in step 4 and click Ok.

6. Add component to the project

  1. Open ClearCase Project Explorer
  2. Right click the integration stream created in step 3, b and choose Prosperities
  3. In the Properties window, click Configuration tab and add the component to the project and click OK.
  4. After step c, Rebase Stream Preview window pops up. Select the init baseline and click OK button.
  5. In the end of rebase action, click Complete and close button.
  6. In the ClearCase Project Explorer, right click the project created in step 3 and select Policies. In the Policies window, check the component we added in above step to let us can modify the component.


After the project setup, cc admin/project managers can create development stream and add the source code the the CC VOB and other daily development tasks.





Wednesday, November 21, 2007

The difference between ClearCase and ClearCase LT

    The difference between ClearCase and ClearCase LT

    1. Dynamic views

    Rational ClearCase and Rational ClearCase LT offer snapshot views. Snapshot views work by copying versions of elements from VOBs to your computer. Your snapshot view will need to be updated periodically to see the latest versions of elements. An update operation copies the latest versions of elements from the VOB to your view. Rational ClearCase also offers dynamic views. A dynamic view uses the Multiversion File System (MVFS) to provide immediate, transparent access to data stored in VOBs. When you work in a dynamic view, you do not need to copy data from VOBs to your view; you see the latest versions of elements in real time.

    2.      Multiple servers
    Rational ClearCase and Rational ClearCase LT use a client-server architecture. A Rational ClearCase client process issues a request for a Rational ClearCase operation, such as checkout or checkin. Server processes that run on the host where the VOB resides handle the request. Rational ClearCase supports a multiple server configuration, so VOBs can be located on multiple, distributed hosts. Rational ClearCase LT supports a single server configuration, so VOBs can be located on only one server host.

    3.      Advanced build tool
    You can use the Rational ClearCase commands clearmake, omake, and clearaudit to perform makefile based builds of software systems. These commands provide the following powerful features: v Build auditing, with automatic detection of source dependencies, including header file dependencies v Automatic creation of permanent bill-of-materials documentation of the build process and its results v Sophisticated build-avoidance algorithms to guarantee correct results when building in a parallel development environment v Sharing of binaries among views, saving both time and disk storage v Parallel building, which applies the resources of multiple processors and multiple hosts to builds of large software systemsThese features are available only if you use dynamic views; therefore, they are available in Rational ClearCase but not in Rational ClearCase LT.

    4.      Rational ClearCase MultiSite
    Rational ClearCase MultiSite is an optional add-on to Rational ClearCase. Rational ClearCase MultiSite can be used for parallel software development and software reuse across geographically distributed project teams. Rational ClearCase MultiSite is not supported with Rational ClearCase LT.

Tuesday, November 20, 2007

The Base ClearCase Process

Here is the process of the Base ClearCase,

1. Project managers setup the project environment. The project environment setup including

  • Create and populate the VOBs.
  • Define the branching strategy. A typical branching strategy is to create an integration branch and multiple development branches. Developers do their work on development branches and then merge their changes to the integration branch so other team members can see them
  • Create shared views and standard config specs. Based on the branch strategy, project managers will create shared view attached the branch to let the developers to work.
  • Make recommendations for view names.

2. Project managers implement development policies

  • Define Labels. A label is a user-defined name that can be attached to a version.
  • Define Attributes. Attributes are name/value pairs that let you capture information about the state of a version from various perspectives.
  • User Hyperlinks. Hyperlinks let you identify and preserve relationships between elements in one or more VOBs.
  • Use Triggers. Triggers let you control the behavior of cleartool commands and ClearCase operations by running a specific program or executable script before or after the command runs.
  • Use Locks. A lock on an object prevents all developers from modifying it.

3. Define global types. This facility makes it easy to ensure that the branch, label,attribute,hyperlink, and elements types the global types need are present in all the VOBs your project uses.

4. Establish a merging policy.

5. Development is ongoing.

6. Developers merge work to the integration branch

7. Integrators build the product.

8. Project managers labels the source files.

9. Developers merge the labeled sources to their development branches.

 

    

ClearCase UCM Process

In a UCM project, work typically progresses as follows,

1. ClearCase administrators create the VOBs
    VOB means Versioned Object Base. VOB contains all the files and directories.

2. Project Managers create the UCM projects
    UCM includes VOBs and Components. Components is a group of related direcotry and file elements with same baseline.

3. Developers join the UCM project

4. Development is ongoing.
    Developers are assigned to activities to check-out and check-in the source code

5. Developers delivery work to shared work area
    Before delivery to integration stream, developers should test and build their work in the private area.

6. Integrators build the product in shared work area

7. Project managers craete new baselines

8. Project managers promote the specific baselines(Build,Test,Released) to reflect a particular project milestone.
   After the new baseline passes a sufficient testing, project managers designate them as the recommended set of baselines

9. Developers adjust their private work areas to the latest avaiable baselines