Auto Resolve Using Java API.
![](http://jazz.net/_images/myphoto/6940d787e763c55a67e9cb597779b2d9.jpg)
Hello,
I am doing the stream to stream merge using RTC API. for the conflict files management, we are creating new change sets and attaching the work item. I am ok with the Merge part using Beyond compare.
I am doing beyond compare merge for the conflict files. the files that are well merged with BC I will upload back in the Workspace. After upload I am doing below stuff to mark as merge and move the files from Conflict to the merged change set. a
IVersionableHandle ori = iItemConflictReport.getOriginalSelectedContributorState();
IVersionableHandle selected = iItemConflictReport.getSelectedContributorState();
IVersionableHandle proposed = iItemConflictReport.getProposedContributorState();
System.out.println("- Mark as Merged for All files. "+fileItem.getName());
wsConn.commit(csHandle,Collections.singleton(opFactory.markAsMerged(ori, selected, proposed)), null);
-----------------------------------------------------------
Issue : There is also an option at UI for Auto resolve, I tried the above thing before doing BC Merge without downloading but it is actually merging with proposed version only.
Question :
Is it possible to Merge using API ? Is RTC system smart enough to Merge a simple conflict ?
If I have version labeled as Auto Resolvable means after accepting changes my source and target becomes equal then how can I detect those changes using the conflict report API ?
I am doing the stream to stream merge using RTC API. for the conflict files management, we are creating new change sets and attaching the work item. I am ok with the Merge part using Beyond compare.
I am doing beyond compare merge for the conflict files. the files that are well merged with BC I will upload back in the Workspace. After upload I am doing below stuff to mark as merge and move the files from Conflict to the merged change set. a
IVersionableHandle ori = iItemConflictReport.getOriginalSelectedContributorState();
IVersionableHandle selected = iItemConflictReport.getSelectedContributorState();
IVersionableHandle proposed = iItemConflictReport.getProposedContributorState();
System.out.println("- Mark as Merged for All files. "+fileItem.getName());
wsConn.commit(csHandle,Collections.singleton(opFactory.markAsMerged(ori, selected, proposed)), null);
-----------------------------------------------------------
Issue : There is also an option at UI for Auto resolve, I tried the above thing before doing BC Merge without downloading but it is actually merging with proposed version only.
Question :
Is it possible to Merge using API ? Is RTC system smart enough to Merge a simple conflict ?
If I have version labeled as Auto Resolvable means after accepting changes my source and target becomes equal then how can I detect those changes using the conflict report API ?
Accepted answer
![](http://jazz.net/_images/myphoto/6940d787e763c55a67e9cb597779b2d9.jpg)
For the Eclipse client, it uses Eclipse merging capabilities for text files. This isn't something you can call from the plain Java API. Other clients may implement their own auto-merging logic.
Comments
![](http://jazz.net/_images/myphoto/6940d787e763c55a67e9cb597779b2d9.jpg)
Thats what I read in one of the article but I lost the article. Thanks for the confirmation. I have seen the option to do
opFactory.merge(IMergeResultOp, versionable, versionable)
Can you please tell me how this API works? Where to get the IMergeResultOp object to pass?
![](http://jazz.net/_images/myphoto/dbae95bdb19ad8361907d9b236827b71.jpg)
IMergeResultOp has subinterfaces:
- IWorkspaceConnection.IDeleteOp, IWorkspaceConnection.IRevertOp, IWorkspaceConnection.ISaveOp, IWorkspaceConnection.IUndoOp
Instances are manufactured by
IWorkspaceConnection.IConfigurationOpFactory