Esempio n. 1
0
 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))
Esempio n. 2
0
 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))
Esempio n. 3
0
    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)
Esempio n. 4
0
 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))
Esempio n. 5
0
    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)
Esempio n. 6
0
 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))