コード例 #1
0
        void RefreshGraph(LogRetriever logRetriever)
        {
            var commits       = logRetriever.GetRecentCommits().ToArray();
            var activeRefName = logRetriever.GetActiveReferenceName();

            var reachableCommitHashes = commits.Select(c => c.Hash).ToArray();
            var unreachableHashes     = logRetriever.GetRecentUnreachableCommitHashes();
            var unreachableCommits    = logRetriever
                                        .GetSpecificCommits(unreachableHashes)
                                        .Where(c => !reachableCommitHashes.Contains(c.Hash))
                                        .ToArray();

            _graph = GenerateGraphFromCommits(commits, activeRefName, unreachableCommits);
            OnPropertyChanged("Graph");
        }
コード例 #2
0
ファイル: ViewModel.cs プロジェクト: Jan-Thes/GitViz
        void RefreshGraph(LogRetriever logRetriever)
        {
            var commits       = logRetriever.GetRecentCommits(NumOfCommitsToShow).ToArray();
            var activeRefName = logRetriever.GetActiveReferenceName();

            var reachableCommitHashes = commits.Select(c => c.Hash).ToArray();
            var unreachableHashes     = logRetriever.GetRecentUnreachableCommitHashes();
            IEnumerable <Commit> unreachableCommits = null;

            if (VisualizeUnreachable)
            {
                unreachableCommits = logRetriever
                                     .GetSpecificCommits(unreachableHashes)
                                     .Where(c => !reachableCommitHashes.Contains(c.Hash))
                                     .ToArray();
            }

            Graph = GenerateGraphFromCommits(commits, activeRefName, unreachableCommits);
        }
コード例 #3
0
ファイル: ViewModel.cs プロジェクト: rhwy/GitViz
        void RefreshGraph(LogRetriever logRetriever)
        {
            var commits = logRetriever.GetRecentCommits().ToArray();
            var activeRefName = logRetriever.GetActiveReferenceName();

            var reachableCommitHashes = commits.Select(c => c.Hash).ToArray();
            var unreachableHashes = logRetriever.GetRecentUnreachableCommitHashes();
            var unreachableCommits = logRetriever
                .GetSpecificCommits(unreachableHashes)
                .Where(c => !reachableCommitHashes.Contains(c.Hash))
                .ToArray();

            _graph = GenerateGraphFromCommits(commits, activeRefName, unreachableCommits);
            OnPropertyChanged("Graph");
        }
コード例 #4
0
        public void ShouldReturnSameDataForSpecificCommitsAsWhenRetrievedViaRecentCommits()
        {
            using (var tempFolder = new TemporaryFolder())
            {
                var tempRepository = new TemporaryRepository(tempFolder);
                tempRepository.RunCommand("init");
                tempRepository.TouchFileAndCommit();
                tempRepository.TouchFileAndCommit();

                var executor = new GitCommandExecutor(tempFolder.Path);
                var logRetriever = new LogRetriever(executor);

                var recentCommits = logRetriever.GetRecentCommits().ToArray();
                var recentCommitHashes = recentCommits.Select(c => c.Hash);

                var specificCommits = logRetriever.GetSpecificCommits(recentCommitHashes);

                CollectionAssert.AreEqual(recentCommits, specificCommits, new SerializedObjectComparer());
            }
        }