It's all about the answers!

Ask a question

Automating Auto Resolve

David Rostocil (911410) | asked Jun 16 '10, 9:12 a.m.
I am working on a tool that will automate merging between two streams. As part of this I would like to have the option to allow for conflicts that are 'auto resolvable' to be resolved without user intervention. I first looked at the IAutoResolveConflictsOperation. This seems to at least be part of what I want to do. My understanding is that this will auto resolve all conflicts that are of the ILogicalChange.AUTOMERGE_CHANGE kind. However, in my testing I have come across at least one example of a change that is of kind ILogicalChange.CONFLICTED_CHANGE that is not auto resolvable with this operation, but I can still select the 'Auto Resolve' option from the right-click context menu in the pending changes view and the conflict is resolved for me. My main question is how can I perform that type of auto resolve programatically? The bigger question is, will that be covering all of the possible auto merge scenarios?

Thanks in advance,

2 answers

permanent link
David Rostocil (911410) | answered Jun 16 '10, 12:57 p.m.
I have since determined that the IAutoResolveConflictsOperation is the operation executed by the 'Auto Resolve' menu action. I have also discovered that the operation will not only resolve conflicts of the kind ILocalChange.AUTOMERGE_CHANGE but also conflicts of the ILocalChange.CONFLICTED_CHANGE when the conflict is of the type ILocalConflict.MODIFY_MODIFY. This is the case I have here, but for some reason I can auto resolve the conflict through the gui, which uses the IAutoResolveConflictsOperation operation, but I cannot resolve the conflict using the IAutoResolveConflictsOperation from my own code.

I did a little bit of debugging and it seems that everything is in order up intil a call to getAffectedCFA() , or affected copy file area. That method returns an empty list for my conflict and nothing is resolved. Am I missing an initialization step? Do I need to set up a copy file area? How would I go about doing that?

permanent link
praveen patidar (8623544) | answered May 09 '13, 10:06 p.m.
As per my understanding Auto Resolve will only allowed if you updated the file content in the workspace. What I have done is,
1. Downloaded all the Version (Source , Target and common ancestor)
2. Do a beyond compare merge and if it is resolvable by beyond compare put them back in the workspace using API.
Now If I see the workspace is says <Modified>-<Modified> -Auto Resolvable.  because I updated the remote file with the one merged with Beyond compare. Now I am able to do the Auto resolve.

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.