views:

411

answers:

2

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.

A: 

Can't you use the Web Service APIs with PowerShell 2.0's New-WebServiceProxy Cmdlet?

-Oisin

x0n
+2  A: 

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.

Keith Hill
Thanks Keith, ended up with: `Get-TfsItemHistory "$/ProjectName" -Recurse -Version C6000~6761 -Server "tfs" | fl Comment,ChangesetId,CreationDate,Committer | out-file C:\Changesets.txt` Works like a charm. I **really** appreciate the 32-bit heads up, I would have been banging my head on the desk over that since that's not an intuitive error in 64-bit at all.
Nick Craver
No problem. Glad that worked out for ya.
Keith Hill