understanding Afterstate and before for Merge Scenarios
Dear Team,
- We have Merge scenario where a File A is Modified in Workspace A and same File A is deleted in another Workspace B like mentioned in url: https://jazz.net/forum/questions/41298/understanding-an-ichange
For this VersionHandle is Null both for after state and before state. I Use RTC API but i pasting the XML Content on respective Changeset,
<changes><internalId>_bdu4MTYnEee4-awF8FM7vw</internalId><kind>0</kind><before xsi:nil="true"/><after xsi:nil="true"/><item itemId="_vuVo8OkrEeapv92fnweYFw" xsi:type="filesystem:FileItemHandle"/><merges><internalId>_bdu4MjYnEee4-awF8FM7vw</internalId><state>_LqAs6ekwEeaC67b_5u2DUQ</state><kind>16</kind></merges></changes>
Queries: Why kind of Change- 0?
If we are doing a sync tool from one SCM TO other/legacy system, what is correct way of handling for merge scenarios,
Based on the Kind go ahead and do modify in legacy system or i have consider the Merge Changes related kind and handle?
Accepted answer
A kind value of 0 (or "NONE") is a constant indicating the change has equivalent 'before' and 'after' states.
Comments
Thank you !!!
if i understand correctly then if Change.kind is NONE then this Changeset has No Update other than that there is some Merge Operation which triggered.
Both states can either be 'null', or both non-null (with the same state ID)
Question 1:One example when above said case occur
Both states can either be 'null'
One example when above said case occur
both non-null (with the same state ID). What is State ID we are talking about.
Question 2:We are currently use below snippet to get File
Object file = SCMPlatform.getWorkspaceManager(rtcTeamRepo) .versionableManager().fetchCompleteState(versionableHandle,monitor);
But unfortunately in above said cases, how do we get File Information?
my expectation is that we would like to log this information "File/Folder:FileName No Change done"
-Having both states be non-null is more common than the deleted case. This happens if I make a change to a file and complete the change set. Someone else delivers a change and I accept it. I choose to "Resolve with Mine", which basically ignores the other persons change, and so in that new change set, nothing really happened to the file in the end.
If the before and after states are null, you may need to fetch the merge state (which would be non-null) to get a file object. This would allow you to get the name of the file.