locked
How to get latest code in multiple systems at a time RRS feed

  • Question

  • I am working on application that need to get latest code in multiple systems at a time.I want to get  the latest code from TFS programmatically. Using command line utility i am able to get in one system. Please help me how to get latest code in multiple systems (i.e 4 systems).

    Wednesday, November 23, 2011 10:12 AM

Answers

  • Answered here, http://social.msdn.microsoft.com/Forums/en-US/tfspowertools/thread/32dc8919-dc1d-4373-9f83-1720c7bb94bd/

    That's easy to do with the TFS API.

    TeamProjectPicker tfsPP = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
                tfsPP.ShowDialog();
                this._tfs = tfsPP.SelectedTeamProjectCollection;
                this._selectedTeamProject = tfsPP.SelectedProjects[0].Name;
    
                var vcs = _tfs.GetService<VersionControlServer>();
                vcs.GetWorkspace("WorkspaceName", Environment.MachineName);
    


    Now if you can configure your workspace to span across multiple projects then you can easily perform the get of just one workspace to get a download of all the projects you need. 

    Or define multiple workspaces and get all those workspaces. 

    PS - You also have the option to create a new workspace programmatically and define the mapping to the server and local machine. It would help if you gave more details on what exactly you are looking to achieve. 

    HTH
    Cheers, Tarun 

     


    Please remember to mark the replies as answers if they help.

    Tarun Arora

    Blog: http://geekswithblogs.net/TarunArora  Subscribe in a reader

    Wednesday, November 23, 2011 11:32 PM

All replies

  • What do you mean with "multiple systems" multiple TFS servers?

    Some of TF commandline functions have a /collection option. With this option you can specify a server name and a collection name.
    But for the TF GET operation the current workspace is the important factum. So from my point of view it is sufficient to perform the TF GET operatins you want inside the workspaces you want to act on.


    Martin Richter -- MVP for VC++ [Germany] -- http://blog.m-ri.de
    Wednesday, November 23, 2011 1:58 PM
  • Answered here, http://social.msdn.microsoft.com/Forums/en-US/tfspowertools/thread/32dc8919-dc1d-4373-9f83-1720c7bb94bd/

    That's easy to do with the TFS API.

    TeamProjectPicker tfsPP = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
                tfsPP.ShowDialog();
                this._tfs = tfsPP.SelectedTeamProjectCollection;
                this._selectedTeamProject = tfsPP.SelectedProjects[0].Name;
    
                var vcs = _tfs.GetService<VersionControlServer>();
                vcs.GetWorkspace("WorkspaceName", Environment.MachineName);
    


    Now if you can configure your workspace to span across multiple projects then you can easily perform the get of just one workspace to get a download of all the projects you need. 

    Or define multiple workspaces and get all those workspaces. 

    PS - You also have the option to create a new workspace programmatically and define the mapping to the server and local machine. It would help if you gave more details on what exactly you are looking to achieve. 

    HTH
    Cheers, Tarun 

     


    Please remember to mark the replies as answers if they help.

    Tarun Arora

    Blog: http://geekswithblogs.net/TarunArora  Subscribe in a reader

    Wednesday, November 23, 2011 11:32 PM
  • Hi,

    I am also having same problem. I have 4 system for testing. Team explorer is not installed in any of the system and I am using commmands to get latest version into all systems. Is there any possibility to get latest version to all 4 systems at a time without running the commands manually from each system?

    Thanks in advance.

     



    • Edited by rkilaru Monday, November 28, 2011 2:35 PM
    Monday, November 28, 2011 11:12 AM
  • Hi Rkilaru,

    It is very simple to work with multiple team projects in parallel using the TFS API, having said that you can achive the same using the TFS power shell cmdlet as well. 

    The code I have shared above shows you how you can pull the latest source code from the version control to the local workspace using the TFS API. Have you tried it? Did you get any errors. 

    Please share more details and I am sure we'll be able to assist.

    HTH

    Cheers, Tarun


    Please remember to mark the replies as answers if they help.

    Tarun Arora

    Blog: http://geekswithblogs.net/TarunArora  Subscribe in a reader

    Monday, November 28, 2011 10:05 PM