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 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); } }
public MemberListBuilder(FileCommit fileCommit, Action<AbstractSyntaxNode, FileCommit> buildAction) { this.fileCommit = fileCommit; this.buildAction = buildAction; }
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]); }
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); }