It's all about the answers!

Ask a question

Creating a baseline programmatically


0
1
Luca Martinucci (1.0k397112) | asked Jun 09 '11, 6:23 a.m.
Is it possible to programmatically (via Java API or via scm command line) create a component baseline when a delivery is completed?
This function should work this way:
- verify whether each component has changed since the last baseline
- create a baseline on each modified component
Doing this is easy, for example, in ClearCase, but I'm still a newbie in RTC...

Accepted answer


permanent link
Nick Edgar (6.5k711) | answered Oct 20 '11, 12:50 p.m.
JAZZ DEVELOPER
Yes. A snapshot in RTC is also essentially a composite baseline (the implementation term is BaselineSet). Baselines will be created for each component, unless they're already at a baseline level.

This is actually configurable in the API, but the UI and SCM CLI always create a new baseline if needed.

The API is on interface com.ibm.team.scm.client.IWorkspaceConnection:

public IBaselineSetHandle createBaselineSet(Collection excludedComponents, String name,
String comment, boolean createNewBaselines, IProgressMonitor monitor) throws TeamRepositoryException;
Luca Martinucci selected this answer as the correct answer

2 other answers



permanent link
Nick Edgar (6.5k711) | answered Jun 09 '11, 2:33 p.m.
JAZZ DEVELOPER
Yes, you may use the SCM CLI to create a snapshot on the target workspace/stream (or source workspace). It will create baselines for any components that aren't already at a baseline.


./scm.sh help create snapshot
Help on create snapshot
Create a new snapshot associated with the workspace or stream. The snapshot will create baselines for itself if necessary.

Aliases: ss

Usage: scm create snapshot [options] <workspace>
workspace - Workspace or stream associated with the snapshot (name[@repo], alias, uuid[@repo]).

Options:
--certificate arg - The file containing the user's login certificate.
--smartCard - Use the connected smart card for authentication.
-d [--description] arg - Description for the snapshot.
-n [--name] arg - Name for the snapshot. If omitted, the workspace's name will be used.
-P [--password] arg - Password for repository.
-r [--repository-uri] arg - URI specifying the location of repository.
-u [--username] arg - Username for repository.

permanent link
Jirong Hu (1.5k9295258) | answered Oct 20 '11, 10:41 a.m.
Yes, you may use the SCM CLI to create a snapshot on the target workspace/stream (or source workspace). It will create baselines for any components that aren't already at a baseline.


I think snapshot is something like "composite baseline" in ClearCase. Question:

1. In CC, when we create a new baseline in a stream has multiple components, it creates a so called composite baseline in the stream. Underline it will create a new baseline on any component has new changes. Will snapshot do the same?

Thanks
Jirong

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.