IBM Support

How to flatten historical artifacts into a new UCM component

Question & Answer


Question

How can you get the versions of files from a known good IBM® Rational® ClearCase® UCM baseline into a new UCM component using clearfsimport?

Answer

This procedure can be used to move source code from one project to another if the projects do not share an AdminVOB.

This procedure can also be used to create a new component within the same PVOB in order to reduce the historical metadata associated with the artifacts.



Scenario:

Your site has several components that have been used within the context of several projects in PVOB_A.

You now need to move these components to a project in PVOB_B.

Regardless of your ClearCase version, the problem of conflicting and nonexistent metadata types still exists if the two PVOBs do not share a common AdminVOB. Short of creating a new AdminVOB and acquiring the metadata from each of the PVOBs, the following workaround is suggested.

WORKAROUND:

For each of the components that need to be used in the project (projb) of PVOB_B, one and only one baseline must be selected as a starting point for new components to be built in PVOB_B and to be used by projb.

The current site configuration:

PVOB_A


    Component:

      compx

    Baseline:

      BLX_LATEST

    Project:

      projX

PVOB_B


    Component:

      newcompx (to be created)

    Baseline:

      NEW_BLX (to be created)

    Project:

      projb (already created)

The following procedure must be performed for each component in PVOB_A that needs to be used in projb (in PVOB_B) or needs to be flattened within the same PVOB (PVOB_A).




1. Select the baseline that best suits the component configuration you wish to start from. In this example the compx component will be used, so the baseline selected will be BLX_LATEST (coming from projx).

Note: Ensure that this baseline is fully labelled.

GUI Example
To determine if the baseline is labeled, open Project Explorer > Select the Components folder > Right click on the component (to be exported) and select Browse Baselines.

A new Window will open displaying the baselines for this component.

Right click on the baseline you want to export and select Properties:





In this example you can see the Label status is Full.

Note: If the status shows Incremental, you can upgrade the baseline by selecting the Upgrade button.

Command Line Example
From the command line, you can run the following command from with in a view:

cleartool lsbl -component  component:<comp to be exported>@\project_vob


Then describe the baseline from within the component you want to export:

cleartool describe -long baseline:<bl name>@\pvob_a


Example:


M:\int\cvob_a>cleartool lsbl -component component:cvob_a@\pvob_a
2007-05-17T17:10:12-04  cvob_a_INITIAL  jdoe  "cvob_a_INITIAL"
  component: cvob_a@\pvob_a
2007-05-17T17:22:58-04  files_to_be_exported  jdoe   "files_to_be_exported"
  stream: project_a_Int@\pvob_a
  component: cvob_a@\pvob_a


M:\int\cvob_a>cleartool describe -long baseline:files_to_be_exported@\pvob_a
baseline "files_to_be_exported"
  created 2007-05-17T17:22:58-04 by John Doe (jdoe.group@host)
  owner: DOM\jdoe
  group: DOM\group
  stream: project_a_Int@\pvob_a
  component: cvob_a@\pvob_a
  label status: Fully Labeled
  change sets:
    proj_a_add_to_source@\pvob_a
  promotion level: INITIAL
  depends on:
  Attributes:
    PromotionLevel = "INITIAL"
  Hyperlinks:
    BaselineLbtype@135@\pvob_a -> lbtype:files_to_be_exported@\cvob_a

In this example the status is Full.

If the Label status is not full, you can upgrade the label status by running the following command:

cleartool chbl -full baseline:<basline_to_be_exported>@\pvob_a

Review the ClearCase Command Reference Guide on the topic of chbl (cleartool man chbl) for more information on changing a baseline.

2. Create a new non-UCM VOB to be used as the new component in PVOB_B.


Review the ClearCase Command Reference Guide on the topic of mkvob (cleartool man mkvob) for more information.




3. Create a non-UCM snapshot view.


Review the ClearCase Command Reference Guide on the topic of mkview (cleartool man mkview) for more information.




4. Load all necessary files needed by projb from compx and load the non-UCM VOB which will be empty.


Review the ClearCase Command Reference Guide on the topic of update (cleartool man update) for more information.






5. Within the snapshot view, CD into the new non-UCM VOB and import the compx files using clearfsimport.

Note: It is recommended to run clearfsimport with the -preview option first to ensure you are importing what you want. When satisfied, rerun the clearfsimport command without the option.

Review the ClearCase Command Reference Guide on the topic of clearfsimport (cleartool man clearfsimport) for more information.




6. Import the new VOB as a UCM component into PVOB_B.

Note: You can also import this component into the existing PVOB (PVOB_A) if your only purpose is to flatten the historical metadata of the component.

Review the Managing Software Project Guide for instructions on how to import a VOB as a UCM component.


    To make a VOB into a component

    In the Project Explorer, select the PVOB and do one of the following:
    • On Linux and the UNIX system, click Tools > Import > Import VOB.
    • On the Windows system, click Tools > Import > VOB as Component.

    The Import VOB window is displayed.

    In Available VOBs, select the VOB that you want to make into a component.
    • Click Add to move the VOB to the VOBs to Import list.

    You can add multiple VOBs to the VOBs to Import list.
    • In the VOBs to Import list, select a VOB and click Remove to move it back to the Available VOBs list.

    When you are finished, click Import.


7. Import the newly created label (from the clearfsimport command) as a baseline to make this component available for new and existing projects in PVOB_B.

Review the Managing Software Project Guide for instructions on how to import a label as a UCM baseline.



    To create a baseline by label type

    In the Project Explorer, select the PVOB. Do one of the following:
    • On Linux and the UNIX system, click Tools > Import > Import Label. Step 1 of the Import Label Wizard appears.
    • On the Windows system, click Tools > Import > Label as Baseline.
    In Available Components, select the component that contains the label from which you want to create a baseline.
    • Click Add to move that component to the Selected Components list.
    • Select a component in the Selected Components list and click Remove to move the component back to the Available Components list.

    Select the label type that you want to import, and enter the name of the baseline that you want to create for the versions identified by that label type.
    Note: You cannot import a label type from a global label type definition.

    Then select the desired baseline promotion level.


8. Add this new "flattened" component to your projects (new or existing).

Review the Managing Software Project Guide for instructions on how to add a component to a new or existing UCM project.

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"UCM: Component","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2003.06.00;7.0;7.0.1;7.1;7.1.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21131559