How to get Line of code changes
![]() I am able get change set details using below code:
List<ChangeImpl> changeSetList = ((IChangeSet) repo.itemManager().
fetchCompleteItem((IChangeSetHandle)changeSetHandle, IItemManager.DEFAULT, null)).changes();
IScmService scmService = (IScmService) ((IClientLibraryContext) repo).getServiceInterface(IScmService.class);
for(ChangeImpl chSet : changeSetList){
System.out.println("Change Set Details: "+chSet);
IVersionableHandle after = chSet.afterState();
IVersionable item = (IVersionable) scmService.fetchState(after, null, null);
if (item instanceof IFileItem) {
IFileItem fileItem = (IFileItem) item;
String readContent = readFileContent(item, repo);
System.out.println("READ CONTENT :: "+readContent);
}
}
How to get number of line of code added or modified or deleted last in the repository? Is their any method to get it for a specific file?
|
Accepted answer
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.