Search code examples
antclearcase

How to check-out/check-in a file into a ClearCase snapshot view using an Ant script?


I would like to update a file under ClearCase source control. This needs to happen from an Ant script.

I have created a snapshot view for this purpose. ccupdate updates it just fine.

I have tried using cccheckout but it fails with the following error cleartool: Error: To operate on UCM branch, must be set to an activity and a UCM view..

Is there a way to check-out a file in a snapshot view, replace it and check-in the new version? If this involves creating/switching to an activity, please include this in your answer.


Solution

  • The Apache Ant ClearCase Tasks (2003!) are pre-UCM area.
    That means they have no notion of "UCM view" (snapshot or dynamic) or activities.

    If you are staying with ant, you could try (not tested) a tasks library like clearantlib, which allows you to execute any cleartool command (with ccexec)

    That way you can use a cleartool setact in order to set a UCM activity in the UCM view.
    Your checkout will proceed only when an activity is set.