Creating a baseline programmatically
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...
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
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:
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;
2 other answers
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.
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