예제 #1
0
        private static void WriteSampleImportFile()
        {
            var output = string.Empty;
            var repos  = TfsStatic.GetGitRepos(SourceTeamProjectCollection);

            foreach (var repo in repos.value.OrderBy(o => o.magic_repo_name))
            {
                WriteLine(repo.magic_repo_name);
                output += $"{repo.remoteUrl}\t{repo.magic_repo_name}{Environment.NewLine}";
            }
            File.WriteAllText(".\\output.txt", output);
        }
예제 #2
0
 private static CreateImportRequestResponse CreateImportRequest(string remoteUrl, string newRepoName, CreateServiceEndpointResponse serviceEndPointResponse)
 {
     return(TfsStatic.CreateImportRequest(TargetTeamProjectCollection, TargetTeamProject, newRepoName, new CreateImportRequestRequest
     {
         parameters = new CreateImportRequestRequest_Parameters
         {
             deleteServiceEndpointAfterImportIsDone = true,
             gitSource = new CreateImportRequestRequest_Gitsource
             {
                 url = remoteUrl,
             },
             serviceEndpointId = serviceEndPointResponse.id,
         }
     }));
 }
예제 #3
0
 private static CreateServiceEndpointResponse CreateServiceEndPoint(string remoteUrl, string newRepoName)
 {
     return(TfsStatic.CreateServiceEndpoint(TargetTeamProjectCollection, TargetTeamProject, new CreateServiceEndpointRequest
     {
         authorization = new CreateServiceEndpointRequest_Authorization
         {
             scheme = "UsernamePassword",
             parameters = new CreateServiceEndpointRequest_Parameters
             {
                 username = "",
                 password = TfsStatic.PatKey,
             }
         },
         name = $"Import-{newRepoName.Replace(" ", "-")}-{Guid.NewGuid()}-Git",
         type = "git",
         url = remoteUrl,
     }));
 }