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

    Question

  • 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,

    Wednesday, June 21, 2006 9:30 PM

Answers

  • 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.
    Wednesday, June 21, 2006 9:58 PM
  • Currently you need to rightclick a file -> Properties.  Or use 'tf prop' as mentioned earlier.

    VS2008 SP1 has a "modified date" column in Source Control Explorer.  You'll have to install SP1 on both the client & server when it's released in a couple days.
    Thursday, May 08, 2008 6:00 PM

All replies

  • 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.
    Wednesday, June 21, 2006 9:58 PM
  • 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,

    Thursday, June 22, 2006 7:19 PM
  • Sounds like a good plan of attack. If you are successful please let us
    know! :-)
    Friday, June 23, 2006 4:03 PM
  • 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,

     

    Friday, June 23, 2006 5:54 PM
  • 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?
    Friday, June 23, 2006 7:00 PM
  • 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,

    Friday, June 23, 2006 8:23 PM
  • Any ideas? I am out of luck over here.

    Tuesday, June 27, 2006 1:26 PM
  • Looks like not many people care what is "Date Modified". But I do. And I surprised that not many complaints about missing that information. 

     

    In good old Visual Source Safe days, the clients have an option under

    "Tools -->Options-->Local Files --> Set Date/time on local files" options are Current, Modification and CheckIn.  And VSS interface would show the Date-Time field for all the files in the list, which would be checkin or modification time stamp that is captured at the time of checking in.

     

    Is that option still available in TFS ?

    Thursday, April 10, 2008 7:54 PM
  • Hi, have read your posts and I have almost the same situation and for me filedate is cruical for determing weather or not a file is newer or older then current version in TFS,

    It's annoying that TFS modifyes filedate just to check out the same version.

    Have you found any solution for this yet?

    Wednesday, April 23, 2008 8:47 AM
  • Nope.

     

    I did some reading about TFS on MSDN. Nowhere it seems to suggest that they have this information available.

     

    Currently I am forced to use the "Changeset" option when doing the deployments to see what all the files that got checked in since last build.  Which is good in some ways to help during the deployment times.  But does not serve the cause when you are looking at the file in windows explorer or wondering what is the last time a file is touched.

     

    I can not imagine why TFS requirements did not include all the functionalities currently available in VSS and more.  It looks like TFS development team is interested in 'reinventing the wheel' in terms of feature requirements.

    Thursday, April 24, 2008 10:59 AM
  • Any news on 'Date Modified', I don't see it in 2008 VS Team Explorer when viewing file properties in either Pending changes or in Unshelve details mode.

    I would like to be able to see 'Date Modified' for TFS or shelvset version and the 'Date Modified' for my WorkSpace version and be able to sort on these columns within the Team Explorer plugin.

     

    It seems funny that a Source Control solution would not find the file attributes such as this and others like 'Date Created' important.  Am I missing something?

     

    In addition, I think it would be great to be able to search for files across shelvesets.

     

    Thursday, May 08, 2008 5:28 PM
  • Currently you need to rightclick a file -> Properties.  Or use 'tf prop' as mentioned earlier.

    VS2008 SP1 has a "modified date" column in Source Control Explorer.  You'll have to install SP1 on both the client & server when it's released in a couple days.
    Thursday, May 08, 2008 6:00 PM
  • Richard,

    Thanks so much for the information and your prompt reply!

    I am now waiting anxiously for SP1.

     

    Thursday, May 08, 2008 7:01 PM
  • Does this mean that modified date is handled in a better way now when using the "get latest" command?

    I do hope that u have fixed this.

     

    /Kenneth

     

    Friday, May 09, 2008 6:26 AM
  • No, the Get command is unchanged.
    Friday, May 09, 2008 10:59 PM
  • Does not look like Mircosoft is interested in getting this fixed at.

    hmm. I stil miss my old VSS.

    It looks like complaining to others who does not care about the time stamps on the files. But for the people who care, it is a absolute necessary.
    Wednesday, October 22, 2008 2:40 PM
  • I've got the same problem using Visual Studio 2008 (version 9.0.30729.1 SP).
    I expected to get the "modified time" for all files at e.g. "Get Latest" with Team Foundation.
    But the only time I can see is the add/check-in time and this is when using "History".
    I cannot see any time stamps at all using right-click and "Properties" in the Source Control Explorer.

    The only solution I have come to this far is to zip each file before adding it to the repository...
    Tuesday, October 28, 2008 12:13 PM
  • Yes, I too would like Get Latest to maintain the date modified attribute of the file, or at least set the date modified attribute to the last check in date.
    Wednesday, November 26, 2008 9:31 PM
  • I to am concerned by this scenario.

    I have multiple work spaces, my laptop, my workstation at home and one at work. 
    We keep all our web sites in source control, and for the ASP sites, publish directly from what's checked into that site's branch.
    The file's modification time is a very important indicator to be able to tell if all the files on a site are up-to-date, unless we wish to waste bandwidth by performing a deep comparison on all the files.

    Come on Microsoft, TFS source control is all .Net code which means that the .Net class System.IO.FileInfo could be used to Set the last write time right after the file is written.

    It's what 3 to 5 lines of code?
    • Edited by Jaeger Mitchell Tuesday, March 03, 2009 8:54 AM Fixing Spelling Mistakes
    Tuesday, March 03, 2009 8:51 AM
  • I have just started using TFS Source Control, and while I like most of what I see, this issue is a big annoyance.

    When I do a Get, it seems to me that the modified-date on the local copies should be the date of the changeset. It doesn't make any sense that the modified-date is set to the present date because a Get doesn't change the file. (Am I wrong? If someone can give me a sensible explanation of the present functionality, I would accept it.)

    What is the appropriate place for reporting this as a bug or complaint so that the Microsoft team working on Source Control will see it?
    Tuesday, March 10, 2009 12:11 AM
  • I too find that this is a big annoyance.  Actually, it's more than a big annoyance; it makes the build process "Just Not Work(tm)"!

    It's impossible to write a suitable 'make' file when TFS changes the dates the way it does.

    If there isn't an option to check out a file preserving the 'last modified' date, this or any other version control system is not suitable for anything other than hobby-quality activities.
    Friday, March 27, 2009 4:28 PM
  • Whe have just started using tsf and also ran into this problem.
    it is big annoy


    after reading this site it is my intention to create a plugin, (as soon as i know how to do this)  
    connect to the tsfversioncontrol database and pick up the latest checkin date from the tbl_changeset

    i hope this will work.
    Wednesday, April 15, 2009 10:20 AM
  • And yet another. I have the same "publish a website via ftp" problem, where I can't copy only modified files because the dates are changed every time the website is checked out. Having finally found a combination of ftp server (filezilla) and scriptable client (Beyond Compare 3), which maintain the dates and do the upload comparison correctly, it is really disappointing to discover that this is missing from Team Foundation Server.
    Friday, May 29, 2009 9:03 AM
  • I don't see why the timestamp for unmodified files is changing in your scenario.  Running Get should only touch files that need to be touched.  Are you creating & destroying your workspace every time you publish, or something like that?

    In any case, if you decide you need to extract the file history info, I'd highly recommend using the TFS client API and not poking in the database.
    Tuesday, June 02, 2009 6:44 PM
  • I have a very hard time understanding why the TFS team would remove functionality that is present in all other source control systems.

    I take it the TFS team has heard about build automation, part of which may well include actions that rely on a files change date, as you can see from the posts above.

    So instead of giving non-answers would it maybe be a good idea to implement the feature asap?
    Friday, June 05, 2009 9:50 AM
  • FWIW, I submitted a bug report to the Microsoft Connect site. You can see the response from Microsoft and "vote" for it (whatever that may mean) at:

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=422366

    My impression is that there hasn't been enough noise about this for it to show up on the TFS team's radar screen.

    Friday, June 05, 2009 6:42 PM
  • Thomas: what build system do you use that is incompatible with the way Get works?  There is probably a better way.

    To be clear - no workaround is necessary for MS build tools such as Visual Studio, the msbuild command line, nmake, and build.exe from the DDK.  From my limited searching, Ant / NAnt should be configurable to match TFS's behavior as well.
    Saturday, June 06, 2009 7:15 PM
  • Well the issue is not related to getting the source and building the binaries, this basic task is in no way concerned about the files' modification dates.

    However since all other source control systems that I have had experience with, including Source Safe, offered a choice of timestamp on the files when doing a get/check out operation, some companies, including my own, have built functionality which relies on this.

    In our case we use it when building distribution packages where custom sql scripts are logged when they have been applied, and we use the file timestamp to ensure that scripts that have already been applied (and thus will not be applied again) have not been changed.

    But again the problem is not what we are using it for, it is the fact that the TFS team has chosen to remove basic functionality that existed in Source Safe and other competing products on the market.
    Tuesday, June 09, 2009 2:32 PM
  • I've done a little prototyping on a solution using TFS Power Tools - Powershell commands.  This one liner will set the change date for files in a directory.

    Get-TfsChildItem |

          ?{$_.ItemType -eq "File"} |

          %{ $file = Get-Item (Split-Path $_.ServerItem -Leaf);

             $file.IsReadOnly = $false;

             $file.LastWriteTime =  $_.CheckinDate

           }


    The problem is only a little harder to work out a recursive process but very doable.
    Monday, June 22, 2009 11:24 PM
  • CheckInDate is different than Modified Date.  Though very close to what could help many.  However, it should be built-in option available for this (just like VSS has) than writing AddIn or whatever and deal with making sure that every developer on the team has this.

    BTW, is there any one from MSFT watching over these requests from user group or just each of us crying out loud at each other?
    Tuesday, September 22, 2009 1:45 AM
  • Here is the situation I'm in...

    We audit our applications annually, to make sure we are following our development procedures correctly.  One of the audits requires us to compare dates of source files to the date of the associated executable file.  If I extract the source files for a particular version of software and compare it to an executable file that was created, say, in June, my source files will all have newer dates than my executable.  FAILED AUDIT!  Audits are a big enough pain, now the source control tool I use appears to have been designed to make the job harder.

    To use TFS, I now have to come up with a new set of procedures to ensure the audits will pass.  If I continue to use VSS, I have no problem.

    I work for a pretty big company (in the top 100 of the Fortune 500), and this problem will likely limit the use of TFS.  I, like several other posters, am really surprised that a very basic feature in VSS was not implemented in TFS.
    Tuesday, October 20, 2009 3:48 PM
  • TFS is simply not an enterprise class SCM. It's a project management tool with a SCM bolted on to the side. It's missing features that even free SCMs have.
    Friday, February 12, 2010 5:01 PM
  • Not to go into huge detail, but yes, our company needs to have a File Last Modification Date/Time available in TFS, or we can't adopt it.

    This needs to be an option, such as VSS has, to "Set date/time on local files" either "Current", "Modification", or "Check-In". Then we (and everyone else) will be able to choose how we want checked-out files handled.

    Adding such an option would be extremely simple, *IF* the TFS database already has a column to hold the Modification Date. If it doesn't, then I can understand Microsoft's reluctance to add this feature. They don't want to admit that they have "goofed" by forgetting it.

    However, it has now been 5 years and 2 new versions since this was first requested (I've been reading forums today), and one would think that Microsoft would have gotten the hint. Guess not.

    Reminds me of the old Bugs Bunny cartoons, when Daffy Duck is falling off a cliff, and Bugs says "I wonder if Daffy will remember he can fly...<splat>...Guess not!"

    *Sigh* Time to uninstall TFS and go back to VSS for a few more years. Or find a free SCC program that works a bit better. *Sigh*

    Monday, July 12, 2010 5:44 PM
  • Come on Microsoft, WAKE UP.

    Understand the basic needs of SCM. We do like TFS for many of the other features. There is not single day has gone by in last 2 years when some one in our team cries out loud because they could not depend on the time stamp on the file system.

    If each of our curses worth even a penny each, I guess, we could have paid that money to fly to Richmond and knock the doors of Microsoft office and wake them up.

    We are patiently waiting for Microsoft to wake up and listen to years old request.

    Does any one know how to make Microsoft Team to force subscribe to this item, so that they can listen to us?  First time I wish I am hacker to do that myself.

    Friday, September 03, 2010 1:55 PM
  • RajeshM, you indicate that you have created a VS Add-in to get the Modified date of a file.  Would you be willing to share the add-in thus saving others time and effort creating their own?

    Thanks,

    Monday, January 16, 2012 5:49 PM
  • Come on Microsoft, WAKE UP.

    Understand the basic needs of SCM. We do like TFS for many of the other features. There is not single day has gone by in last 2 years when some one in our team cries out loud because they could not depend on the time stamp on the file system.

    If each of our curses worth even a penny each, I guess, we could have paid that money to fly to Richmond and knock the doors of Microsoft office and wake them up.

    We are patiently waiting for Microsoft to wake up and listen to years old request.

    Does any one know how to make Microsoft Team to force subscribe to this item, so that they can listen to us?  First time I wish I am hacker to do that myself.


    Microsoft must not be using TFS as their SCM system. MS should be embarrassed to be missing such basic functionality. Our company also has processes built around the use of the file change date time.
    Wednesday, June 26, 2013 1:20 AM
  • So the TFS team produced a product lacking this piece of user functionality, which had worked and was well defined and driven out because of a user need in the prior VSS product.

    The TFS team has now had over 5 years and they still have not delivered this basic Source Control feature and other than recognizing it as a need, no commitment on delivery seems to be the status quo.  I wonder what drives the feature set for this team?  Obviously, not the massive number of requests I've seen for this feature across their forum sites and other development blogs in general.

    Maybe next year, or the year after that...


    Objects - first class citizens: identity, public interfaces and the authority for their own behaviour and state

    Wednesday, October 30, 2013 2:51 PM