locked
GetLatest api TFS RRS feed

  • Question

  • Here's my question, I mapped my project to exemple D:\Test and I've done a GetLatest with the tfs api but if I modify the file directly in the folder D:\Test and do a GetLatest again with the tfs api it didn't see that the file is not the same as in TFS.

    Is there a way, with the tfs api, to do a GetLatest and replace the file that have been modify directly in the folder and not in tfs without having to do a force get?

    Thanks
    Tuesday, June 9, 2009 1:46 PM

Answers

  • >> Is there a way, with the tfs api, to do a GetLatest and replace the file that have been modify directly in the folder and not in tfs without having to do a force get?

    No.  You will need to check the MD5 hashes yourself.  That's how tools like tfpt online work.

    You could use GetOptions.All + GetOptions.Overwrite (that combo is the same as /force), but as you know it will be very slow because it redownloads everything.

    Wednesday, June 10, 2009 5:18 AM
    Moderator

All replies

  • try the overwrite flag

    tf get "c:\some\directory\*" /overwrite


    from:
    http://msdn.microsoft.com/en-us/library/fx7sdeyf(VS.80).aspx

    /overwrite

    Overwrites writable files that are not checked out.

    Tuesday, June 9, 2009 2:10 PM
  • I've done this with the tfs api but it didn't worked

    Dim request As GetRequest = New GetRequest("Y:\Test", RecursionType.Full, VersionSpec.Latest)
            Dim status As GetStatus
                     status = workspace.Get(request, GetOptions.Overwrite)
            End If
    Tuesday, June 9, 2009 2:18 PM
  • I tried this myself you want the GetAll option. Overwrite will only overwrite a readonly file if that file changed on the server. All does a get on your item spec. Force is the same as /all /overwrite.

    Dim request As GetRequest = New GetRequest("Y:\Test\*", RecursionType.Full, VersionSpec.Latest)
            Dim status As GetStatus
                     status = workspace.Get(request, GetOptions.GetAll)
            End If
    

    If you want to further limit the number of files that you get, you could check the attributes and "get /all" the files that are marked for read write. If there is a pending change it will simply through a warning which you could ignore.
    • Edited by Skyaddict Tuesday, June 9, 2009 2:48 PM
    Tuesday, June 9, 2009 2:28 PM
  • Didn't work either... I've tried with the TFS path too but didn't worked

    Dim request As GetRequest = New GetRequest("$/JCL", RecursionType.Full, VersionSpec.Latest)
    Dim status As GetStatus = workspace.Get(request, GetOptions.Overwrite)
    
    Tuesday, June 9, 2009 2:59 PM
  • did you try the GET all option. I am sorry I did an edit on my post above.
    Tuesday, June 9, 2009 3:09 PM
  • >> Is there a way, with the tfs api, to do a GetLatest and replace the file that have been modify directly in the folder and not in tfs without having to do a force get?

    No.  You will need to check the MD5 hashes yourself.  That's how tools like tfpt online work.

    You could use GetOptions.All + GetOptions.Overwrite (that combo is the same as /force), but as you know it will be very slow because it redownloads everything.

    Wednesday, June 10, 2009 5:18 AM
    Moderator