How to perform SCM checkin operation
Hi,
I'm looking for a way to perform check-in using plain API with the same behaviour of "scm checkin" command from scmtools. Is there some code (of scmtools if possible) I can read in order to get this running?
Particulary I'm looking for methods to
- get the workspace I'm in at the launch
- get the component giving file path
- check-in operation
This because there is not an Ant task to perform it during a build.
Thanks,
Michele.
I'm looking for a way to perform check-in using plain API with the same behaviour of "scm checkin" command from scmtools. Is there some code (of scmtools if possible) I can read in order to get this running?
Particulary I'm looking for methods to
- get the workspace I'm in at the launch
- get the component giving file path
- check-in operation
This because there is not an Ant task to perform it during a build.
Thanks,
Michele.
One answer
Relating to the previous point I've some more detailed questions:
1 - in order to get the workspace (as object) I think I can use ISandbox, but I'm not sure to have completely understand ISandbox. It seems that I can get ISandbox from every single file in filesystem using SharingManager.getInstance().getSandbox(base, false) but it exists (as ISandbox.isExistingSandbox method) only if base is an IPath to the root of the workspace.
2- checkin operation could be done using an ICheckinOperation. These object has two different methods:
- requestCheckin(IShareable[] arg0, IChangeSetHandle arg1, String arg2, IProgressMonitor arg3)
- requestCheckin(IWorkspaceConnection arg0, IComponentHandle arg1, ILocalChange[] arg2, IChangeSetHandle arg3, String arg4, IProgressMonitor arg5)
For what I understand, the second one must be used in order to check-in of more than one local change, obtained using getPendingChanges. what I really don't understand is how to use the first method and which kind of ISharable objects have to be provided.
Any help will be appreciated.
Thanks,
Michele.
1 - in order to get the workspace (as object) I think I can use ISandbox, but I'm not sure to have completely understand ISandbox. It seems that I can get ISandbox from every single file in filesystem using SharingManager.getInstance().getSandbox(base, false) but it exists (as ISandbox.isExistingSandbox method) only if base is an IPath to the root of the workspace.
2- checkin operation could be done using an ICheckinOperation. These object has two different methods:
- requestCheckin(IShareable[] arg0, IChangeSetHandle arg1, String arg2, IProgressMonitor arg3)
- requestCheckin(IWorkspaceConnection arg0, IComponentHandle arg1, ILocalChange[] arg2, IChangeSetHandle arg3, String arg4, IProgressMonitor arg5)
For what I understand, the second one must be used in order to check-in of more than one local change, obtained using getPendingChanges. what I really don't understand is how to use the first method and which kind of ISharable objects have to be provided.
Any help will be appreciated.
Thanks,
Michele.