Пример #1
0
 public bool Equals(CommitEdge other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Source == other.Source && Target == other.Target);
 }
Пример #2
0
        private bool AddCommitToGraph(Commit commit, CommitVertex childVertex)
        {
            var commitVertex = GetCommitVertex(commit);

            _graph.AddVertex(commitVertex);
            if (childVertex != null)
            {
                var edge = new CommitEdge(childVertex, commitVertex);
                if (_edges.ContainsKey(edge.Id))
                {
                    return(false);
                }

                _graph.AddEdge(edge);
                _edges.Add(edge.Id, edge);
            }
            return(true);
        }
Пример #3
0
        private void AddCommitsToGraph(Commit commit, CommitVertex childVertex)
        {
            var commitVertex = GetCommitVertex(commit);

            _graph.AddVertex(commitVertex);
            if (childVertex != null)
            {
                var edge = new CommitEdge(childVertex, commitVertex);
                if (_edges.ContainsKey(edge.Id))
                {
                    return;
                }
                _graph.AddEdge(edge);
                _edges.Add(edge.Id, edge);
            }

            foreach (var parent in commit.Parents)
            {
                AddCommitsToGraph(parent, commitVertex);
            }
        }