1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| namespace CAppGetBranchTFS
{
class Program
{
static string serverName = "http://xxxxxx:8080";
static void Main(string[] args)
{
Console.WriteLine(DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"));
Console.WriteLine("Connecting to {0}...", serverName);
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(serverName);
Console.WriteLine("SessionId : {0}", tfs.SessionId);
Console.WriteLine("tfs.Uri.AbsolutePath : {0}", tfs.Uri.AbsolutePath);
Console.WriteLine("tfs.Uri.AbsoluteUri : {0}", tfs.Uri.AbsoluteUri);
VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
Console.WriteLine("start Get Branch...");
BranchHistoryTreeItem[][] _BranchHistory = vcs.GetBranchHistory(new ItemSpec[] { new ItemSpec("$/XXXX", RecursionType.Full) }, LatestVersionSpec.Latest);
foreach (BranchHistoryTreeItem _Item in _BranchHistory[0])
{
Console.WriteLine(" : {0}", _Item.Relative.BranchToItem.ServerItem);
}
Console.Write("end Get Branch...");
Console.ReadKey();
}
}
} |
Partager