vcs.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:sphinxcontrib-vcs 作者: t2y 项目源码 文件源码
def get_changelog(self, repo, commit):
        item = nodes.list_item()

        item.append(self._make_message_node(commit.message, commit.hexsha))
        item.append(nodes.inline(text=six.text_type(' by ')))
        item.append(nodes.emphasis(text=six.text_type(commit.author.name)))
        item.append(nodes.inline(text=six.text_type(' at ')))

        commit_date = datetime.fromtimestamp(commit.authored_date)
        item.append(nodes.emphasis(text=six.text_type(commit_date)))

        if OPTION_WITH_REF_URL in self.options:
            ref_url = repo.get_commit_url(commit.hexsha)
            ref = nodes.reference('', commit.hexsha, refuri=ref_url)
            item.append(nodes.paragraph('', '', ref))

        if OPTION_INCLUDE_DIFF in self.options:
            diff = repo.get_diff(commit.hexsha)
            item.append(self._make_diff_node(diff, commit.hexsha))

        return item
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号