Ejemplo n.º 1
0
        private void AddTagAnnotation(Tag tag)
        {
            var vertex = new TagAnnotationVertex(tag.Annotation);

            _contents.AddVertex(vertex);
            var edge = new GraphContents.Edge {
                Source = tag.Annotation.Sha, Target = tag.Annotation.Target.Sha
            };

            _contents.AddEdge(edge);
        }
Ejemplo n.º 2
0
        private void AddTreeEntry(Tree tree, TreeEntry entry)
        {
            if (entry.Target is Tree)
            {
                AddTree(entry.Target as Tree);
            }
            else if (entry.Target is Blob)
            {
                AddBlob(entry.Target as Blob);
            }
            else
            {
                throw new NotSupportedException("Invalid tree entry, not supported: " + entry.Target.GetType());
            }
            var edge = new GraphContents.Edge {
                Source = tree.Sha, Target = entry.Target.Sha, Tag = entry.Name
            };

            _contents.AddEdge(edge);
        }
Ejemplo n.º 3
0
        private void AddCommit(Commit commit)
        {
            var commitVertex = new CommitVertex(commit);

            _contents.AddVertex(commitVertex);
            commit.Parents.ForEach(AddCommit);
            commit.Parents
            .Select(p => new GraphContents.Edge {
                Source = commit.Sha, Target = p.Sha
            })
            .ForEach(edge => _contents.AddEdge(edge));
            if (_parameters.IncludeCommitContent)
            {
                AddTree(commit.Tree);
                var edge = new GraphContents.Edge {
                    Source = commit.Sha, Target = commit.Tree.Sha, Tag = "/"
                };
                _contents.AddEdge(edge);
            }
        }
Ejemplo n.º 4
0
 private void AddCommit(Commit commit)
 {
     var commitVertex = new CommitVertex(commit);
     _contents.AddVertex(commitVertex);
     commit.Parents.ForEach(AddCommit);
     commit.Parents
           .Select(p => new GraphContents.Edge {Source = commit.Sha, Target = p.Sha})
           .ForEach(edge => _contents.AddEdge(edge));
     if (_parameters.IncludeCommitContent)
     {
         AddTree(commit.Tree);
         var edge = new GraphContents.Edge {Source = commit.Sha, Target = commit.Tree.Sha, Tag = "/"};
         _contents.AddEdge(edge);
     }
 }
Ejemplo n.º 5
0
 private void AddTreeEntry(Tree tree, TreeEntry entry)
 {
     if (entry.Target is Tree)
     {
         AddTree(entry.Target as Tree);
     }
     else if (entry.Target is Blob)
     {
         AddBlob(entry.Target as Blob);
     }
     else
     {
         throw new NotSupportedException("Invalid tree entry, not supported: " + entry.Target.GetType());
     }
     var edge = new GraphContents.Edge {Source = tree.Sha, Target = entry.Target.Sha, Tag = entry.Name};
     _contents.AddEdge(edge);
 }
Ejemplo n.º 6
0
 private void AddTagAnnotation(Tag tag)
 {
     var vertex = new TagAnnotationVertex(tag.Annotation);
     _contents.AddVertex(vertex);
     var edge = new GraphContents.Edge {Source = tag.Annotation.Sha, Target = tag.Annotation.Target.Sha};
     _contents.AddEdge(edge);
 }