def get_commit_by_id(self, commit_id): commit = self._get_commit(commit_id) parent = commit.parents[0] if len(commit.parents) else 'NULL' files = self._diff_files(commit.id, parent) return Commit(commit.id, commit.committer, datetime.fromtimestamp(commit.commit_time), commit.message, files, lambda: generate_unified_diff(self, files, parent, commit.id))
def get_commit_by_id(self, commit_id): commit = self._get_commit(commit_id) files = self._diff_files(commit.id, commit.parents[0]) return Commit( commit.id, commit.committer, datetime.fromtimestamp(commit.commit_time), commit.message, files, generate_unified_diff(self, files, commit.parents[0], commit.id))
def _ctx_to_commit(self, ctx): diff = generate_unified_diff(self, ctx.files(), ctx.parents()[0].rev(), ctx.rev()) return Commit(ctx.rev(), ctx.user(), datetime.fromtimestamp(ctx.date()[0]), ctx.description(), ctx.files(), diff)
def get_commit_by_id(self, commit_id): commit = self._get_commit(commit_id) parent = commit.parents[0] if len(commit.parents) else 'NULL' files = self._diff_files(commit.id, parent) return Commit( commit.id, commit.committer, datetime.fromtimestamp(commit.commit_time), commit.message, files, lambda: generate_unified_diff(self, files, parent, commit.id))
def get_commit_by_id(self, commit_id): commit = self._get_commit(commit_id) files = self._diff_files(commit.id, commit.parents[0]) return Commit(commit.id, commit.committer, datetime.fromtimestamp(commit.commit_time), commit.message, files, generate_unified_diff(self, files, commit.parents[0], commit.id))