understanding Afterstate and before for Merge Scenarios
![]()
vinitha dsouza (145●16●86)
| asked Jun 14 '18, 7:00 a.m.
edited Jun 14 '18, 2:07 p.m. by David Lafreniere (4.8k●7) Dear Team,
|
Accepted answer
![]()
David Lafreniere (4.8k●7)
| answered Jun 14 '18, 2:06 p.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Jun 14 '18, 2:07 p.m. A kind value of 0 (or "NONE") is a constant indicating the change has equivalent 'before' and 'after' states.
Both states can either be 'null', or both non-null (with the same state ID). For example, this may occur when a user resolves a conflict with "mine"; in this case the before state is the same as the afters state. The change set is relevant because it captures the fact that there was a merge (and records 'how' it was merged), but this change set will actually have 'no' change to the file in question if delivered for example.
The second question cannot easily be answered. If the other SCM allows you to record merge states, then you would need to consider the merge states in the change set. However if you are discarding all merge information, and if you are just trying to 'touch' a file based on an ordered series of change sets, then it would be reasonable to treat these change sets as a no-op.
vinitha dsouza selected this answer as the correct answer
Comments Thank you !!!
-Files have both an itemID and a stateID. Both of these are UUIDS. In your snippet above, the file has an itemID of "_vuVo8OkrEeapv92fnweYFw", and one possible state of that file (a merge state in this case) is: "_LqAs6ekwEeaC67b_5u2DUQ". Think of the state of a file as the 'version' of a file. (Note: in the UI we show version IDs, or integers, to make it easier to read). A 'null' state means the file has been deleted.
-In the example, when both the before and after states are null in a change set, this can happen if for example I delete the file in my workspace and complete the change set. Then someone else delivers a content modification to that file and delivers it, after I accept it I will be in a conflict, and could choose to "Resolve with Mine"... basically discarding his content change, and keeping my deleted state. So that new change set would start in a deleted state, and end in a deleted state, and had a merge state which was non-null, but essentially was ignored.
-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.
|