Showing posts with label UCM Activities. Show all posts
Showing posts with label UCM Activities. Show all posts

How to create UCM Activities without a UCM view

To create an activity without having or being set in to a UCM or non-UCM view, you must first have the following information:

  • The exact name, including proper punctuation and case, of the integration or development stream in which the user wishes to create the activity on.

  • The exact name, including proper punctuation and case, of the project VOB

Command Syntax

The following command can be used from either a Windows, UNIX or Linux prompt from any location on the system to create a new UCM activity:

cleartool mkactivity -in

Example

Let us assume you want to create an activity called "friday_build" on a stream called "repro_dev" that is in a Project VOB named "ucmpvob" which is located on a Windows server:

C:\>cleartool mkactivity -in stream:repro_dev@\ucmpvob friday_build@\ucmpvob
Created activity "friday_build".


Note: For a developer to use this newly created activity, they will need to set to this activity using a UCM view:

M:\repro_dev>cleartool setact friday_build
Set activity "friday_build" in view "repro_dev".

List all activities in a stream from command line

The activities in a stream can be viewed from within ClearCase Project Explorer:

The cleartool lsstream -long displays the activities from command line:


    C:\>cleartool lsstream -long prj1_dev@\PVOB1
    stream "prj1_dev"
    31-Mar-06.19:44:07 by administrator.None@IBM-8D5F4F33A08
    master replica: original@\PVOB1
    owner: IBM-8D5F4F33A08\administrator
    group: IBM-8D5F4F33A08\None
    project: prj1@\PVOB1 (development stream)
    default deliver stream: prj1_int@\PVOB1
    development streams:
    contains activities:
    test1_24942@\PVOB1
    rebase.prj1_dev.20060602.145948@\PVOB1
    foundation baselines:
    comp2_INITIAL@\PVOB1 (comp2@\PVOB1) (modifiable)
    prj1_6_2_2006@\PVOB1 (comp1@\PVOB1) (modifiable)
    recommended baselines:
    views:
    prj1_dev_vu
    administrator_admin_prj1_snap
    policies:
    POLICY_DELIVER_REQUIRE_REBASE disabled
    POLICY_DELIVER_NCO_DEVSTR disabled
    ...

To limit the output to only display activities:

    M:\prj1_dev_vu>cleartool lsstream -fmt %[activities]p
    test1_24942 rebase.prj1_dev.20060602.145948

Removing change set versions of a UCM activity from the GUI

Important Considerations

The following procedure is used to remove checked in versions from the change set of a UCM activity.

Note: For any checked out version listed in the change set, cancel the checkout and the version will no longer appear in the change set list. Refer to technote 1146869 for directions.

Removing checked in versions should be done with discretion and under conditions that warrant such action. Instances where a deliver or rebase fails leaving checked in versions which are preventing the operation from being canceled, as detailed in technote 1125189 and technote 1179696.

When removing versions as a result of a failed rebase, then the checked in versions will be listed on the development stream, and vice-versa when removing versions as the result of a failed deliver operation (the checked in versions will be listed on the target stream).

This is important because this procedure requires that the checked in versions be removed from within the ClearCase Version Tree. You need to know specifically what stream the change set versions are on to be sure and remove the correct ones.

Note: Merge arrows are removed from the source to the target version that was created as a result of a deliver or rebase operation; hence, there are no dangling hyperlinks left to cleanup.

File versions should be removed before removing the versions of directory elements. This will help avoid stranding any elements and causing them to get put into the lost+found; refer to technote 1120317 for more details.

IMPORTANT: The eye graphic in the Version Tree should not be relied on when using this procedure, as it may or may not be selecting the version that needs to be removed. The eye points to the version that is selected by your view's config spec, which may not be the version you need to remove.


Removing Checked In Versions

  1. Open ClearCase Explorer > select the UCM view and click My Activities:



  2. Right-click the activity > select Properties > select the Change Set tab:



  3. Right-click the first file element listed (and note the version listed to its right as this is the version that will need to be removed) > select Version Tree:

    Note: If there are multiple versions listed for a file element, as seen in the above screen capture, then you will need to remove each of them. The order in which they are removed is insignificant, you can remove version 1 first or last.




  4. Right-click the version that was listed in the change set > select Delete > review the details in the Delete Confirmation window > click Yes to proceed:



  5. The Version Tree should update dynamically with the change, if not, then click F5 to refresh the window, and the version will be gone:



    Note: The Delete must be repeated to remove all versions for this file element from the change set.

  6. The change set pane will not update dynamically and cannot be refreshed using F5, you must close the Properties window and reopen it to see that the version has been removed from the change set:




  7. Repeat the steps as needed to remove all file element versions from the change of the UCM activity.

  8. After removing all versions, the activity can be removed from Project Explorer > select the stream > highlight the activity in the left-hand pane > go to File > Delete (or click the Delete key) > click Yes to Proceed:



    Note: An error will occur, if either of the following are true:
    • The activity is not empty:



    • The activity is still set in a UCM view:

Change the name of an activity from GUI or CLI

Every activity has a Headline and an ID. The Headline is the visible description (or name) you see when performing a checkout or checkin of a file within a UCM view, whereas the ID is an internal field that holds the name of the object in the VOB database. These can be identical, but that is not required.

From GUI, both the Headline and ID can be changed from Project Explorer > right-click the activity > select Properties:


From command line (CLI), the Headline can be changed using cleartool chactivity:

    cleartool chactivity -headline activity-id

The ID can be changed with cleartool rename:

    cleartool rename activity: activity:

Example:

There are two activities with the same headline, test1, but this can occur because each has an ID that is unique, test1_24942 and test1_27032, respectively:


    Y:\Projvob> cleartool lsactivity
    29-Nov-99.13:48:56 test1_24942 cpostma "test1"
    29-Nov-99.13:59:36 test1_27032 cpostma "test1"

Change the ID of the first activity, from test1_24942 to bugfix:

    Y:\Projvob>cleartool rename activity:test1_24942 activity:bugfix
    Renamed activity from "test1_24942" to "bugfix".

    Y:\Projvob>cleartool lsactivity
    29-Nov-99.13:48:56 bugfix cpostma "test1"
    29-Nov-99.13:59:36 test1_27032 cpostma "test1"

Change the Headline of the first activity from test1 to bugfix:

    Y:\Projvob>cleartool chactivity -headline bugfix bugfix
    Changed activity "bugfix".

    Y:\Projvob>cleartool lsactivity
    29-Nov-99.13:48:56 bugfix cpostma "bugfix"
    29-Nov-99.13:59:36 test1_27032 cpostma "test

List the contributing activities in the change set of a baseline or an integration activity

BASELINES

Baselines are used to mark a set of versions as a stable configuration or a bench mark, and can span multiple components in a project.

For more information on Baselines and their uses, see IBM Rational ClearCase Managing Software Projects.

You can view the contributing activities in a baseline from GUI or CLI as follows:

GUI - ClearCase Component Tree Browser

  1. From Project Explorer, right-click a component and select Browse Baselines:



  2. Right-click the baseline and select Properties > Activites tab:





CLI - cleartool describe

Command syntax:

cleartool describe baseline:@\PVOB

Example:
C:\>cleartool des baseline:proj1_new_baseline@\pvob1
baseline "proj1_new_baseline"
created 2006-07-17T21:38:48-04 by admin.ccusers@IBM-D15F3483123
owner: IBM-D15F3483123\admin
group: IBM-D15F3483123\ccusers
stream: project1_int@\pvob1
component: comp1@\pvob1
label status: Fully Labeled
change sets:
deliver.admin_proj1_dev2.20060717.213815@\pvob1
promotion level: INITIAL
depends on:
Attributes:
PromotionLevel = "INITIAL"
Hyperlinks:
BaselineLbtype -> lbtype:proj1_7_17_2006@\multivob
UseBaseline <- stream:admin_proj1@\pvob1
UseBaseline <- stream:admin_project1@\pvob1


INTEGRATION ACTIVITY

Integration activities track work completed as a result of a deliver or rebase operation, and they are named accordingly with a prefix of either deliver or rebase to help distinguish them from user created activities.

For more information About activities, see IBM Rational ClearCase Developing Software.

You can view the contributing activities in an integration activity from GUI or CLI as follows:

GUI - ClearCase Project Explorer

Note: The screen capture is from Microsoft® Windows®, but this feature is available on UNIX® and Linux® also.

  1. Start Project Explorer, select a stream in the left-hand pane, and the integration activities will appear in the right-hand pane:

    Note: Integration activities only exist in a stream as the result of a deliver or rebase operation.



  2. Right-click the activity and select Show Contributing Activities:




CLI - cleartool lsactivity -contrib

Command Syntax:

cleartool lsactivity -contrib @\pvob

Note: You can list the intergration activities in a stream using cleartool describe stream:@\PVOB.

Example:

>cleartool lsactivity -contrib deliver.admin_proj1_dev2.20060717.213815@\pvob1
new_file


Note:
The following command provides information that closely matches the GUI results above:

cleartool lsact -fmt "%[contrib_acts]p" deliver.admin_proj1_dev2.20060717.213815@\pvob1

Activities delivered since the last baseline

When working in a UCM project, it is often useful to determine the activities delivered to an integration stream since the last baseline was applied. The cleartool diffbl command can accomplish this. However, cleartool diffbl must be run against each modifiable component that the project uses.

The command syntax is:

cleartool diffbl -activities baseline: stream:

For example:

1. First determine the most recent baseline created in the desired component.

%> cleartool lsbl -stream integration_stream -component user1_comp@/vobstore/pvob
25-Jul-01.11:12:59 REL1.1.117 user1 "REL1.1"
stream: integration_stream@/vobstore/pvob
component: user1_comp@/vobstore/pvob
23-Aug-01.16:09:43 REL1.2.117 user1 "REL1.2"
stream: integration_stream@/vobstore/pvob
component: user1_comp@/vobstore/pvob
23-Aug-01.16:22:29 REL1.3.117 user1 "REL1.3"
stream: integration_stream@/vobstore/pvob
component: user1_comp@/vobstore/pvob
31-Aug-01.12:20:21 REL1.4.117 user1 "REL1.4"
stream: integration_stream@/vobstore/pvob
component: user1_comp@/vobstore/pvob

2. Then run the following command to determine what activities have been delivered since the baselines creation:

%> cleartool diffbl -activities baseline:REL1.3.117 stream:integration_stream@/vobstore/pvob
>> deliver.development_steam.20010824.080503 "deliver development_steam on 08/24/01 08:05:03."
>> deliver.development_steam.20010824.080802 "deliver development_steam on 08/24/01 08:08:02."
>> deliver.development_steam.20010824.084755 "deliver development_steam on 08/24/01 08:47:55."
>> deliver.development_steam.20010828.102859 "deliver development_steam on 08/28/01 10:28:59.”
>> deliver.development_steam.20010831.121802 "deliver development_steam on 08/31/01 12:18:02."
-> trigger "trigger"

If you need to write a script to perform this operation, the following commands are useful...

1. To obtain the stream name the current view is associated with, run

cleartool lsstream -short -cview

2. To obtain the project the stream is associated with, run

cleartool describe -fmt "%[project]p\n" stream:

3. To obtain the modifiable components list, one component per line, run

cleartool describe -fmt "%[mod_comps]Np" project:

4. To list all the baselines for a given component in a given stream:

cleartool lsbl -comp -stream

Determining dependent UCM activities in ClearCase

For any given element in an activity's change set, all versions are delivered from a given stream in the range between the version in the change set and either the version most recently delivered or the version in the stream's foundation baseline (whichever is later).




Notice that because version 3 of prog.c was delivered in a previous deliver operation, the dependencies between Activities B and C, which contain versions of prog.c, are as follows:

  1. You can deliver Activity B without delivering Activity C.
  2. To deliver Activity C, which contains version 6, users must also deliver Activity B, which contains the versions between 6 and the most recent delivery of prog.c.
  3. Because Activity B also contains versions of lib.c, users may be required to deliver other activities to satisfy dependencies for lib.c.

For example, if Activity D (not shown in the above diagram) contained an undelivered version 6 of lib.c, delivering Activity B would require user to deliver Activity D as well.

For more information on delivering activities, refer to the Rational ClearCase Developing Software Guide.

With that said, a dependency between activities can arise from the fact that they contain versions of the same element, or because they are included in the same baseline.

There is no direct and reliable method to verify if an activity is required to be delivered with another due to a change set dependency.

The best way to determine if two activities need to be delivered together is to attempt a deliver of one activity by itself. If there are dependencies, a message will appear during the deliver notifying you of the dependency.

Moving a UCM version in a change set from one activity to another

From the ClearCase Project Explorer:

  1. Highlight the stream and select the activity from which you want to move the versions.

  2. Right-click to bring up the properties of the activity.



  3. Select the Change Set tab, select the Change Set and right-click on it to bring up a context menu.

  4. Select "Move to Activity...".



  5. From the available list of activities choose an existing one or choose to create a new activity by selecting the "New" button and creating the new activity.

  6. Highlight the activity to which you want to move the versions to and click OK.



  7. Click OK again.



From the command line:
  1. Change directory (cd) to the view that is associated with the stream which contains the change set and activity to be moved.

  2. M:\test_proj1>cleartool lsact -long new
    activity "new"
    13-Jul-01.13:10:47 by username.cc_users@username_ntw
    owner: username
    group: CC_USERS
    stream: test_proj1.9907@\test_pvob
    title: new
    change set versions:
    M:\test_proj1\test_comp\dir1\mytext.txt@@\main\test_proj1.9907\1
    M:\test_proj1\test_comp\dir1\hello.txt@@\main\test_proj1.9907\1

  3. M:\test_proj1>cleartool chact -fcset new -tcset MOVED M:\test_proj1\test_comp\dir1\mytext.txt@@\main\test_proj1.9907\1
    Moved version "M:\test_proj1\test_comp\dir1\mytext.txt@@\main\test_proj1.9907\1"
    from activity "new" to activity "MOVED".