Esempio n. 1
0
        private static bool ReadFileChanges(IEnumerator <string> lines, CommitFileChanges commitFileChanges)
        {
            while (lines.MoveNext())
            {
                if (lines.Current.Length == 0)
                {
                    return(false);
                }

                Match fileChangeMatch = fileChangeRegex.Match(lines.Current);
                if (!fileChangeMatch.Success)
                {
                    string message = string.Format("Expected file change but found: {0}", lines.Current);
                    throw new GitCommandFailedException(message, commitFileChanges);
                }

                FileCommit fileCommit = new FileCommit()
                {
                    ChangeType = GetFileChangeType(fileChangeMatch.Groups["ChangeType"].Value[0]),
                    Name       = fileChangeMatch.Groups["Name"].Value,
                    Commit     = commitFileChanges.Commit
                };
                commitFileChanges.FileCommits.Add(fileCommit);
            }

            return(true);
        }
Esempio n. 2
0
        private Task <IEnumerable <AbstractSyntaxNode> > FindChangesAsync(FileCommit commit)
        {
            SolutionWithSyntax oldText = GetOldText(commit);
            SolutionWithSyntax newText = GetNewText(commit);

            sourceTextByFileName[commit.Name] = newText;
            return(ChangeFinder.FindChangesForSingleDocumentSolutionAsync(oldText, newText));
        }
Esempio n. 3
0
        private void AddFileCommit(AbstractSyntaxNode member, FileCommit fileCommit)
        {
            string documentationId;

            if (documentationIds.TryGetValue(member.ToString(), out documentationId))
            {
                FileCommits fileCommits;
                if (!fileCommitsByMember.TryGetValue(documentationId, out fileCommits))
                {
                    fileCommits = new FileCommits();
                    fileCommitsByMember.Add(documentationId, fileCommits);
                }

                fileCommits.Add(fileCommit);
            }
        }
 public MemberListBuilder(FileCommit fileCommit, Action<AbstractSyntaxNode, FileCommit> buildAction)
 {
     this.fileCommit = fileCommit;
     this.buildAction = buildAction;
 }
Esempio n. 5
0
        private SolutionWithSyntax GetNewText(FileCommit commit)
        {
            string text = repository.FindFileAtRevision(commit.Name, commit.Commit.CommitId);

            return(SolutionWithSyntax.CreateSolutionForText(text));
        }
Esempio n. 6
0
 private SolutionWithSyntax GetOldText(FileCommit commit)
 {
     return(sourceTextByFileName[commit.Name]);
 }
Esempio n. 7
0
 public MemberListBuilder(FileCommit fileCommit, Action <AbstractSyntaxNode, FileCommit> buildAction)
 {
     this.fileCommit  = fileCommit;
     this.buildAction = buildAction;
 }
        private static bool ReadFileChanges(IEnumerator<string> lines, CommitFileChanges commitFileChanges)
        {
            while (lines.MoveNext())
            {
                if (lines.Current.Length == 0)
                {
                    return false;
                }

                Match fileChangeMatch = fileChangeRegex.Match(lines.Current);
                if (!fileChangeMatch.Success)
                {
                    string message = string.Format("Expected file change but found: {0}", lines.Current);
                    throw new GitCommandFailedException(message, commitFileChanges);
                }

                FileCommit fileCommit = new FileCommit()
                {
                    ChangeType = GetFileChangeType(fileChangeMatch.Groups["ChangeType"].Value[0]),
                    Name = fileChangeMatch.Groups["Name"].Value,
                    Commit = commitFileChanges.Commit
                };
                commitFileChanges.FileCommits.Add(fileCommit);
            }

            return true;
        }
 private SolutionWithSyntax GetNewText(FileCommit commit)
 {
     string text = repository.FindFileAtRevision(commit.Name, commit.Commit.CommitId);
     return SolutionWithSyntax.CreateSolutionForText(text);
 }
 private SolutionWithSyntax GetOldText(FileCommit commit)
 {
     return sourceTextByFileName[commit.Name];
 }
 private Task<IEnumerable<AbstractSyntaxNode>> FindChangesAsync(FileCommit commit)
 {
     SolutionWithSyntax oldText = GetOldText(commit);
     SolutionWithSyntax newText = GetNewText(commit);
     sourceTextByFileName[commit.Name] = newText;
     return ChangeFinder.FindChangesForSingleDocumentSolutionAsync(oldText, newText);
 }
        private void AddFileCommit(AbstractSyntaxNode member, FileCommit fileCommit)
        {
            string documentationId;
            if (documentationIds.TryGetValue(member.ToString(), out documentationId))
            {
                FileCommits fileCommits;
                if (!fileCommitsByMember.TryGetValue(documentationId, out fileCommits))
                {
                    fileCommits = new FileCommits();
                    fileCommitsByMember.Add(documentationId, fileCommits);
                }

                fileCommits.Add(fileCommit);
            }
        }