It's all about the answers!

Ask a question

How to get Version id of a change for each changeset from RTC stream?


Jagadeesh Marada (132) | asked Jun 13 '18, 5:40 a.m.

 Hi Techies,


I just want to fetch each file and versionid a Changeset,Where I am able to get the files but not version id. Is there any Api to get the Version id of each change.

I am getting file details of change set as below.

for (IChangeSet changeset : changesets) {
i=i+1;
System.out.println("Current Changeset :: "+i);
if(changeset!=null){
String commnet = changeset.getComment();
List<IChange> changes = changeset.changes();
for (IChange change : changes) {
FilePojo pojo = new FilePojo();
IVersionableHandle before = change.beforeState();
after = change.afterState();
if (after != null) {
try {
if (after.hasStateId()) {
IVersionable item = (IVersionable) scmService
.fetchState(after, null, null);

pojo.setFileName(item.getName());
pojo.setModifiedDate(item.modified());
pojo.setFilePath(gettingFullPathOfFile(after));
pojo.setComment(commnet);
filePojoList.add(pojo);
}
}catch (TeamRepositoryException e) {
e.printStackTrace();
}
}
}
}
}

Be the first one to answer this question!


Register or to post your answer.