File Versioning
My company is looking to migrate from Perforce to Team System for our source control.
Some of our developers have an issue with the way TFS version files, in Perforce each file has it's own individual file version while TFS seems to version files by changeset number.
Is there a way to change how TFS versions files?
Thanks in advance
Kurt
Answers
I don't think the database stores those numbers anywhere, no. On the bright side, if you're calling an API like QueryHistory then you don't really need it -- the number is directly related to the index in the resultset...
$hist = tfhist .\Links.html for($i = 0; $i -lt $hist.Count; ++$i) { $hist[$i] = $hist[$i] | Add-Member noteproperty -name Version -val ($hist.Count - $i) -pass } $hist | ft -auto changesetid, version, creationdate, comment ChangesetId Version CreationDate Comment ----------- ------- ------------ ------- 12359 7 10/19/2009 3:15:23 PM XML parser in Powershell RC doesn't like doctypes anymore (?) 11960 6 9/18/2009 12:51:45 PM 10733 5 7/9/2009 3:52:35 PM put build info on links page 10363 4 6/19/2009 3:12:05 PM Update master page for new silverlight URI format 9054 3 4/3/2009 1:35:47 AM 9044 2 4/2/2009 11:43:21 PM fisheye 9019 1 4/2/2009 6:38:18 PM - alternate TickerLife project w/o BlackLight layout...
- Marked As Answer byHongye SunMSFT, ModeratorMonday, November 09, 2009 6:19 AM
- Proposed As Answer byHongye SunMSFT, ModeratorThursday, November 05, 2009 9:54 AM
All Replies
- Each individual file is stored by version, but TFS treats a checkin as an atomic action in a changeset.
So you can see the history of a file, and when you look at the details, you see the context (changeset) of the checkin.
So what do you think is limiting the functionality you require?
Ewald - Please remember to mark the replies as answers if they help.

Blog: www.ewaldhofman.nl - He wants to be able to do something like:# fetch the 1st version of the file that was ever checked in, regardless what changeset counter on the server was at the timetf get file.cs -version V1Many other systems (notably, CVS and VSS) use a similar numbering scheme. It need not contradict the concept of atomic checkins, as shown by Perforce. Even TFS had something like this in 2005 Beta 1, using the special 'V' syntax, but it was cut shortly afterward.In theory you could extend it all sorts of fun ways:# fetch the third most recent versiontf get file.cs -version T-2# fetch the version immediately prior to what Bob is working ontf get file.cs -version WBob-1...but those aren't necessary given the rich client object model, in my opinion.
First of all thank you for the responses, I think I can explain a little better now.
The main issue is when looking at the history in TFS you only see the changeset number and not the actual version number of the file which perforce displays both.
So if I understand correctly each file does actually have an individual file version it's just not displayed in the history window, correct?
Thanks in advance- That is correct. When you look at the properties of the file, you can see the version of the file though.
Ewald - Please remember to mark the replies as answers if they help.

Blog: www.ewaldhofman.nl I don't think the database stores those numbers anywhere, no. On the bright side, if you're calling an API like QueryHistory then you don't really need it -- the number is directly related to the index in the resultset...
$hist = tfhist .\Links.html for($i = 0; $i -lt $hist.Count; ++$i) { $hist[$i] = $hist[$i] | Add-Member noteproperty -name Version -val ($hist.Count - $i) -pass } $hist | ft -auto changesetid, version, creationdate, comment ChangesetId Version CreationDate Comment ----------- ------- ------------ ------- 12359 7 10/19/2009 3:15:23 PM XML parser in Powershell RC doesn't like doctypes anymore (?) 11960 6 9/18/2009 12:51:45 PM 10733 5 7/9/2009 3:52:35 PM put build info on links page 10363 4 6/19/2009 3:12:05 PM Update master page for new silverlight URI format 9054 3 4/3/2009 1:35:47 AM 9044 2 4/2/2009 11:43:21 PM fisheye 9019 1 4/2/2009 6:38:18 PM - alternate TickerLife project w/o BlackLight layout...
- Marked As Answer byHongye SunMSFT, ModeratorMonday, November 09, 2009 6:19 AM
- Proposed As Answer byHongye SunMSFT, ModeratorThursday, November 05, 2009 9:54 AM


