public static void WriteRemoteTfsBranchStructure(ITfsHelper tfsHelper, string tfsRepositoryPath, IEnumerable <IGitTfsRemote> tfsRemotes = null) { var root = tfsHelper.GetRootTfsBranchForRemotePath(tfsRepositoryPath); var visitor = new WriteBranchStructureTreeVisitor(tfsRepositoryPath, tfsRemotes); root.AcceptVisitor(visitor); }
public int DisplayBranchData() { // should probably pull this from options so that it is settable from the command-line const string remoteId = GitTfsConstants.DefaultRepositoryId; var tfsRemotes = _globals.Repository.ReadAllTfsRemotes(); if (DisplayRemotes) { if (!ManageAll) { var remote = _globals.Repository.ReadTfsRemote(remoteId); Trace.TraceInformation("\nTFS branch structure:"); WriteRemoteTfsBranchStructure(remote.Tfs, remote.TfsRepositoryPath, tfsRemotes); return(GitTfsExitCodes.OK); } else { var remote = tfsRemotes.First(r => r.Id == remoteId); foreach (var branch in remote.Tfs.GetBranches().Where(b => b.IsRoot)) { var root = remote.Tfs.GetRootTfsBranchForRemotePath(branch.Path); var visitor = new WriteBranchStructureTreeVisitor(remote.TfsRepositoryPath, tfsRemotes); root.AcceptVisitor(visitor); } return(GitTfsExitCodes.OK); } } WriteTfsRemoteDetails(tfsRemotes); return(GitTfsExitCodes.OK); }
public static void WriteRemoteTfsBranchStructure(ITfsHelper tfsHelper, TextWriter writer, string tfsRepositoryPath, IEnumerable<IGitTfsRemote> tfsRemotes = null) { var root = tfsHelper.GetRootTfsBranchForRemotePath(tfsRepositoryPath); var visitor = new WriteBranchStructureTreeVisitor(tfsRepositoryPath, writer, tfsRemotes); root.AcceptVisitor(visitor); }
private void WriteRemoteTfsBranchStructure(TextWriter writer, string remoteId, IEnumerable<IGitTfsRemote> tfsRemotes) { writer.WriteLine("\nTFS branch structure:"); var repo = globals.Repository; var remote = repo.ReadTfsRemote(remoteId); var root = remote.Tfs.GetRootTfsBranchForRemotePath(remote.TfsRepositoryPath); var visitor = new WriteBranchStructureTreeVisitor(remote.TfsRepositoryPath, writer, tfsRemotes); root.AcceptVisitor(visitor); }
private void WriteRemoteTfsBranchStructure(TextWriter writer, string remoteId, IEnumerable <IGitTfsRemote> tfsRemotes) { writer.WriteLine("\nTFS branch structure:"); var repo = globals.Repository; var remote = repo.ReadTfsRemote(remoteId); var root = remote.Tfs.GetRootTfsBranchForRemotePath(remote.TfsRepositoryPath); var visitor = new WriteBranchStructureTreeVisitor(remote.TfsRepositoryPath, writer, tfsRemotes); root.AcceptVisitor(visitor); }
public static void WriteRemoteTfsBranchStructure(ITfsHelper tfsHelper, TextWriter writer, string tfsRepositoryPath, IEnumerable <IGitTfsRemote> tfsRemotes = null) { var root = tfsHelper.GetRootTfsBranchForRemotePath(tfsRepositoryPath); if (!tfsHelper.CanGetBranchInformation) { throw new GitTfsException("error: this version of TFS doesn't support this functionality"); } var visitor = new WriteBranchStructureTreeVisitor(tfsRepositoryPath, writer, tfsRemotes); root.AcceptVisitor(visitor); }
public int DisplayBranchData() { // should probably pull this from options so that it is settable from the command-line const string remoteId = GitTfsConstants.DefaultRepositoryId; var tfsRemotes = globals.Repository.ReadAllTfsRemotes(); if (DisplayRemotes) { if (!ManageAll) { var remote = globals.Repository.ReadTfsRemote(remoteId); stdout.WriteLine("\nTFS branch structure:"); WriteRemoteTfsBranchStructure(remote.Tfs, stdout, remote.TfsRepositoryPath, tfsRemotes); return(GitTfsExitCodes.OK); } else { var remote = tfsRemotes.First(r => r.Id == remoteId); if (!remote.Tfs.CanGetBranchInformation) { throw new GitTfsException("error: this version of TFS doesn't support this functionality"); } foreach (var branch in remote.Tfs.GetBranches().Where(b => b.IsRoot)) { var root = remote.Tfs.GetRootTfsBranchForRemotePath(branch.Path); var visitor = new WriteBranchStructureTreeVisitor(remote.TfsRepositoryPath, stdout, tfsRemotes); root.AcceptVisitor(visitor); } return(GitTfsExitCodes.OK); } } WriteTfsRemoteDetails(stdout, tfsRemotes); return(GitTfsExitCodes.OK); }
public int DisplayBranchData() { // should probably pull this from options so that it is settable from the command-line const string remoteId = GitTfsConstants.DefaultRepositoryId; var tfsRemotes = globals.Repository.ReadAllTfsRemotes(); if (DisplayRemotes) { if (!ManageAll) { var remote = globals.Repository.ReadTfsRemote(remoteId); stdout.WriteLine("\nTFS branch structure:"); WriteRemoteTfsBranchStructure(remote.Tfs, stdout, remote.TfsRepositoryPath, tfsRemotes); return GitTfsExitCodes.OK; } else { var remote = tfsRemotes.First(r => r.Id == remoteId); if (!remote.Tfs.CanGetBranchInformation) { throw new GitTfsException("error: this version of TFS doesn't support this functionality"); } foreach (var branch in remote.Tfs.GetBranches().Where(b=>b.IsRoot)) { var root = remote.Tfs.GetRootTfsBranchForRemotePath(branch.Path); var visitor = new WriteBranchStructureTreeVisitor(remote.TfsRepositoryPath, stdout, tfsRemotes); root.AcceptVisitor(visitor); } return GitTfsExitCodes.OK; } } WriteTfsRemoteDetails(stdout, tfsRemotes); return GitTfsExitCodes.OK; }
public static void WriteRemoteTfsBranchStructure(ITfsHelper tfsHelper, TextWriter writer, string tfsRepositoryPath, IEnumerable<IGitTfsRemote> tfsRemotes = null) { var root = tfsHelper.GetRootTfsBranchForRemotePath(tfsRepositoryPath); if (!tfsHelper.CanGetBranchInformation) { throw new GitTfsException("error: this version of TFS doesn't support this functionality"); } var visitor = new WriteBranchStructureTreeVisitor(tfsRepositoryPath, writer, tfsRemotes); root.AcceptVisitor(visitor); }