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.
评论列表
文章目录