Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Understanding after state and before State of Changeset

Hello Team,

We are actually developing a tool which can sync our Source code from RTC to our Legacy Tool. As part of this we have below questions, please answer,
- Question 1: In API, we see Change.after state and before state. What exactly is this?
- Question 2: We have Change-set which is Merge type- after state and before state both returned Null. In what cases this will happen.
- Question 3: What is ICHANGE.NONE, in what cases we get this?
  

0 votes


Accepted answer

Permanent link

I can answer about question 1.

before and after methods return an IVersionableHandle object: it is, basically, a version of a file under source control in RTC.
So, when you use before, you retrieve the the file as it was before the change; when you use after, you retrieve the file as it is after the change.
I suggest that you execute:
Integer changeKind = change.kind();
in order to get the kind of the change, i.e. whether the file has been added (changeKind=1), deleted (changeKind=16) or modified (changeKind=2) by the change.
When it has been added, you should only retrieve the after version; when it has been deleted, you should only retrieve the before version, when it has been modified, you can retrieve both before and after versions, according to your needs.

vinitha dsouza selected this answer as the correct answer

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jun 13 '18, 6:09 a.m.

Question was seen: 1,051 times

Last updated: Jun 15 '18, 1:39 a.m.

Confirmation Cancel Confirm