本文整理汇总了Python中trac.versioncontrol.RepositoryManager.notify方法的典型用法代码示例。如果您正苦于以下问题:Python RepositoryManager.notify方法的具体用法?Python RepositoryManager.notify怎么用?Python RepositoryManager.notify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.versioncontrol.RepositoryManager
的用法示例。
在下文中一共展示了RepositoryManager.notify方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_request
# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
def process_request(self, request):
payload = request.args.get('payload')
if not payload:
raise Exception('Payload not found')
payload = simplejson.loads(payload)
repository_name = payload['repository']['name']
repository = self.env.get_repository(repository_name)
if not repository:
raise Exception('Repository "%s" not found' % repository_name)
# CachedRepository
if repository.repos:
repository.repos.git.repo.remote('update')
# Normal repository
else:
repository.git.repo.remote('update')
manager = RepositoryManager(self.env)
revision_ids = [ commit['id'] for commit in payload['commits'] ]
try:
self.env.log.debug('Adding changesets: %s' % revision_ids)
manager.notify('changeset_added', repository_name, revision_ids)
except Exception as exception:
self.env.log.error(exception)
request.send_response(204)
request.send_header('Content-Length', 0)
request.write('')
raise RequestDone
示例2: _do_changeset_modified
# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
def _do_changeset_modified(self, reponame, *revs):
if is_default(reponame):
reponame = ''
rm = RepositoryManager(self.env)
errors = rm.notify('changeset_modified', reponame, revs)
for error in errors:
printout(error)
示例3: _do_changeset_added
# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
def _do_changeset_added(self, reponame, *revs):
if is_default(reponame):
reponame = ""
rm = RepositoryManager(self.env)
errors = rm.notify("changeset_added", reponame, revs)
for error in errors:
printout(error)
示例4: _do_changeset_modified
# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
def _do_changeset_modified(self, reponame, *revs):
if is_default(reponame):
reponame = ''
rm = RepositoryManager(self.env)
rm.notify('changeset_modified', reponame, revs)
示例5: _do_changeset_added
# 需要导入模块: from trac.versioncontrol import RepositoryManager [as 别名]
# 或者: from trac.versioncontrol.RepositoryManager import notify [as 别名]
def _do_changeset_added(self, reponame, *revs):
if is_default(reponame):
reponame = ""
rm = RepositoryManager(self.env)
rm.notify("changeset_added", reponame, revs)