コード例 #1
0
ファイル: Branch.cs プロジェクト: ekersey/git-tfs
        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);
        }
コード例 #2
0
ファイル: Branch.cs プロジェクト: ekersey/git-tfs
        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);
        }
コード例 #3
0
ファイル: Branch.cs プロジェクト: abezzub/git-tfs
        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);
        }
コード例 #4
0
ファイル: Branch.cs プロジェクト: runt18/git-tfs
        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);
        }
コード例 #5
0
ファイル: Branch.cs プロジェクト: sreeatmecs/git-tfs
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
ファイル: Branch.cs プロジェクト: JamesDunne/git-tfs
        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;
        }
コード例 #9
0
ファイル: Branch.cs プロジェクト: JamesDunne/git-tfs
        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);
        }