How to check in multiple files in workspace using IScmService or using plain java api?
![]() Currently I am succeeded to check in single file in workspace , but I want to check in multiple files using batchCommit() or commit() method. Does anyone have idea of how to commit/check in multiple files using client side api/plain java api? |
Accepted answer
![]()
Ralph Schoon (62.0k●3●36●43)
| answered Jan 23 '19, 6:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I have published what I know about this API and here this is done: https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/
The files are in a zip file, but that should be irrelevant.
Ralph Schoon selected this answer as the correct answer
Comments Hi @Ralph Schoon thanks for your valuable answer...I already tried this but it has multiple calls of commit() for each file, but while I am checking "Metronome" to check API call by eclipse client, eclipse call method batchCommit(), it commit and save no.of files in single shot. Do you have any idea about how to use this batchCommit() or how to check in multiple files in single shot? If I would want to know how batchCommit() works, I would use a development environment set up according to the RTC Extensions Workspace and then use the Eclipse Java Search to search for the usage of the method batchCommit(). |
One other answer
![]()
If you are writing a client-side plugin, here's the corresponding API:
ITeamRepository repo = getRepo();
IWorkspaceHandle workspaceHandle = getWorkspace();
IWorkspaceManager wm = ScmPlatform.getWorkspaceManager(repo);
IWorkspaceConnection wc = wm.getWorkspaceConnection(workspaceHandle, monitor);
From here you can use the wc#commit(...) method. Note: this method has an argument called 'configOp' that is a Collection of IConfigurationOps. So you first create a new List<IConfigurationOps>, then iterate across the files (IVersionable) you want to check-in, call this: wc.configurationOpFactory().save(versionable); and then add that return result to your 'configOp' collection, then make the wc#commit(...) API call.
|