Get Latest Version changes a file's 'Date Modified' and 'Date Created' attributes

Hi,

We are currently using Team Foundation Server as our source control solution for a pilot project.

When a user right clicks on a file in 'Source Control Browser' in Visual Studio 2005 and selects 'Get Latest Version,' he/she gets the file without any problem. However, the 'Date Modified' and 'Date Created' attributes of the local file are set to the time he/she got the file from the source control. It is important for us that we get the files with the exact date attributes that they were checked in with.

Use-case senario:

-User A modifies a file on June 20th and checks it in.

-User B gets the latest version of the file on June 21th.

-The file on B's machine states that the file was last modified on June 21th and thus fails our entire Test Procedure.

Any ideas on how this can be corrected?

Thanks,

[884 byte] By [TFSAdmin] at [2007-12-21]
# 1
The v1 client doesn’t have this option, unfortunately. You’ll have to
use the ‘tf properties’ command or the TFS API to get this information.
RichardBergMSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 2

Thanks for the info Richard.

What I think I would need to do is create a VS Add-in that invokes a function to change the 'Date Modified' and 'Date Created' attribute of the file everytime a Get event is raised on the VersionControlServer.

Thanks,

TFSAdmin at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 3
Sounds like a good plan of attack. If you are successful please let us
know! :-)
RichardBergMSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 4

I have created the VS Add-in. When an user selects 'Get Latest Version,' It catches the Getting,OperationStarting & OperationFinished events on the VersionControlServer and gets the recursive listing of the files . However, when I looked at the 'Item' class in Microsoft.VisualStudio.TeamFoundation.Client namespace, there is no property that would give me the file attributes that I am looking for ('Date Modified' and 'Date Created'). The only date-related attribute the class has is 'CheckInDate.'

Also, I looked up the 'tf properties' command. The information displayed by the command seems to be from the above 'Item' class. The property named 'Last Modified' seems to be showing the 'CheckInDate.'

It seems I am back at square one. My senario is as follows:

- User A creates a file on his computer on June 19th. He/She checks in the file in TFS on June 20th.

- User B checks out the file on June 21th and needs to know when was the file actually created.

Is there any way to get this information?

Thanks,

TFSAdmin at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 5
CheckInDate should be the same as 'modified.'
By 'created' you mean June 19th? We don't store that info in the TFS
database. This is the first time I've seen anyone ask for this -- can
you give us an idea what kinds of file metadata you feel are missing and
how you would use them?
RichardBergMSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 6

Hi Richard,

We are using Team Foundation Server as a source control solution for our installation projects. We develop our own installation packages i.e., we are not using MSI yet. So, we have solutions that have hundreds of files (image files, binary files etc...) as resources. Our testing process for these installation packages is as follows:

* Before a resource file is placed on the source control, the developer reports the file's properties to a central location through a website.

* Our test automation programs use these file's properties to ensure that correct file is being deployed by the installation package in all the install scenarios across all the platforms in all the supported languages (150+ scenarios). Among many others, the following file metadata is compared:

- File Name,

- File Location (Path),

- File MD5 code,

- File Creation Date (i.e., in the scenario outlined before June 19th) and

- file language & version (if it is a binary file).

As far as we have experienced, file metadata like name, language, version etc. is maintained by the TFS other than the 'File Creation Date.' We have a geographically distributed team and all the team members use Team Explorer to get/check-out the files. I was planning on writing a VS add-in that I would distribute to all the users. The add-in would handle the Get event from the TeamExplorer (i.e., when the user selects 'Get Latest Version') and change the 'CreatedTime:' property of all the files created/changed on the local workspace as a result of the event. Currently, I am able to handle all the required events and get the recursive list of all the files that have been created/changed as a result. However, I cannot get the CreatedTime value for the files from TFS. Is there any workaround for this? It is important for us that we match the files as it wraps up our automated test process and validates the entire procedure.

Thanks for your valued input,

TFSAdmin at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 7

Any ideas? I am out of luck over here.

TFSAdmin at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...

Visual Studio Team System

Site Classified