DevProcess.py 文件源码

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

项目:lib9 作者: Jumpscale 项目源码 文件源码
def _move_to_repo(self, issue, dest):
        """
        Moves issue to a certain destination repo

        @param issue Issue: issue object.
        @param dest Repository: destination repository object.
        """
        self.logger.info("%s: move to repo:%s" % (issue, dest))
        ref = self._issue_url(issue)
        body = "Issue moved from %s\n\n" % ref

        for line in issue.api.body.splitlines():
            if line.startswith("!!") or line.startswith(
                    '### Tasks:') or line.startswith('### Part of Story'):
                continue
            body += "%s\n" % line

        assignee = issue.api.assignee if issue.api.assignee else NotSet
        labels = issue.api.labels if issue.api.labels else NotSet
        moved_issue = dest.api.create_issue(title=issue.title, body=body,
                                            assignee=assignee, labels=labels)
        moved_issue.create_comment(self._create_comments_backlog(issue))
        moved_ref = 'https://github.com/%s/issues/%s' % (dest.fullname, moved_issue.number)
        issue.api.create_comment("Moved to %s" % moved_ref)
        issue.api.edit(state='close')  # we shouldn't process todos from closed issues.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号