Search code examples
javatfseclipse-plugineclipse-rcpchangeset

Eclipse - How to retrieve the tfs changeset number so it can be displayed within Java class


I am trying to retrieve the changeset number of a file, so I can place within a comment block at the top of the file.

I have already retrieved other details such as comments, author and date and time by the code below.

Code

String comments = pc.getPendingChanges().getComment();
String author =  pc.getPendingChanges().getAllPendingChanges()[0].getPendingSetOwnerDisplay();
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
                Date date = new Date();

PC is:

final PendingCheckin pc =  getPendingCheckin();

Edit

Any tips on how to improve the question?


Solution

  • String version = String.valueOf(pc.getPendingChanges().getAllPendingChanges()[0].getVersion());