Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS - Get a changeset range

Tags:

powershell

tfs

Every release I find it a good practice to go back and grab all the changeset notes to compare to the release notes to make sure we didn't miss anything. Since we have a blurb of all feature changes pretty well documented in the changeset notes, they're a valuable resource.

What I haven't found is a good way to extract these from TFS 2008. What I've tried:

  • The VS History Window: This only provides the first 100 characters or so, truncated ellipse style.
  • TFS Powertools: Maybe I'm missing something, but I can't get an ouput format that doesn't involve butchering the newlines in the comments, so making anything usable seems like a PITA, but maybe a PowerShell solution would be perfect here?

What I'm after is pretty simple:

  • Changeset comments
  • ID
  • Date
  • Username if possible

This within a certain range...whether it's restricted on dates or IDs, either's ok. If I could restrict it to within a certain branch in the project, that'd be a huge bonus.

What I'm doing now to get this data is opening up the TFS SQL Server directly and running this on the TfsVersionControl database:

SELECT    ChangeSetId, CreationDate, Comment
FROM      tbl_ChangeSet
WHERE     ChangeSetId > 6300

I tried but didn't find a good resource for this, it seems all the great TFS info that was on Vertigo's blogs has been lost as the links are now dead. Does anyone have a better/sane way of yanking out this info? The format isn't important, anything in a tabular/xml/whatever format that I can convert to be readable works.

Side note: We're upgrading to VS 2010 within a week or so of release...if the answer is VS2010/TFS2010 only that's even better since it's a long-term solution.

like image 494
Nick Craver Avatar asked Mar 02 '10 02:03

Nick Craver


1 Answers

The Team Foundation Power Tools (October 2008) comes with a PowerShell snapin (32-bit only if you happen to be on Windows x64). Try this:

Add-PSSnapin Microsoft.TeamFoundation.PowerShell
Get-TfsItemHistory . -Recurse -Version C57460~58090 | 
    fl Comment,ChangesetId,CreationDate,Committer


Comment      : Added printf's in a couple of event callbacks
ChangesetId  : 58090
CreationDate : 2/25/2010 1:46:09 PM
Committer    : ACME\johndoe
...

This does preserver newlines in the comments. IF you are on x64 Windows make sure you run this from a 32-bit (x86) PowerShell prompt.

like image 138
Keith Hill Avatar answered Oct 13 '22 23:10

Keith Hill