public override async Task FindFromSourceControl() { var folder = PathFile.Substring(0, PathFile.LastIndexOf("/")); string fileJSON = PathFile.Substring(PathFile.LastIndexOf("/") + 1); var requestJSON = new CommitRequest { Path = PathFile }; FileCommits = (await client.Repository.Commit.GetAll( idRepository, requestJSON)) .Select(translate) .ToArray(); var dateJSON = FileCommits.Max(it => it.CommitedDate); var requestFolder = new CommitRequest { Since = dateJSON.AddTicks(1), Path = folder }; FolderCommits = (await client.Repository.Commit.GetAll( idRepository, requestFolder)) .Where(it => it.Commit.Committer.Date > dateJSON) .Select(translate) .ToArray(); File = (await client.Repository.Content.GetAllContents(idRepository, PathFile)).First().Content; }
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 CommitFileChanges() { Commit = new Commit(); FileCommits = new FileCommits(); log = new StringBuilder(); }