当前位置: 首页>>代码示例>>Python>>正文


Python Ticket.values['changesets']方法代码示例

本文整理汇总了Python中trac.ticket.Ticket.values['changesets']方法的典型用法代码示例。如果您正苦于以下问题:Python Ticket.values['changesets']方法的具体用法?Python Ticket.values['changesets']怎么用?Python Ticket.values['changesets']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在trac.ticket.Ticket的用法示例。


在下文中一共展示了Ticket.values['changesets']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: process_request

# 需要导入模块: from trac.ticket import Ticket [as 别名]
# 或者: from trac.ticket.Ticket import values['changesets'] [as 别名]
    def process_request(self, req, db=None):
        req.perm.assert_permission('CHANGESET_VIEW')

        if not db:
            db = self.env.get_db_cnx()

        # Fetch the standard ticket fields
        cursor = db.cursor()

        ticket_id = req.args.get('ticket_id')
	req.hdf['ticket_id'] = ticket_id

        repos = self.env.get_repository(req.authname)
        authzperm = SubversionAuthorizer(self.env, req.authname)

        diff_options = get_diff_options(req)
        if req.args.has_key('update'):
            req.redirect(self.env.href.setchangeset(ticket_id))

	ticket = Ticket(self.env, ticket_id)

	ticket.setchangesets = self.get_setchangesets(ticket_id,db)

	ticket.values['setchangesets'] = ticket.setchangesets

	ticket.values['changesets'] = ""
	for changeset in ticket.setchangesets:
	    ticket.values['changesets'] +=  str(changeset)
	
	setchangesets = ticket.setchangesets
	req.hdf['ticket'] = ticket
	req.hdf['dbWarning'] = False

	# get the list of changesets for the ticket_id
	# then loop through and get the actual changesets like the following line
	chgset = []
	self.log.debug('PublishRevert: %s', ticket['ticketaction'])
	for rev in setchangesets:
	    authzperm.assert_permission_for_changeset(rev)
	    changeset = repos.get_changeset(rev)
            chgset.append(changeset)

        format = req.args.get('format')

        self._render_html(req, ticket, repos, chgset, diff_options)

        return 'setchangeset.cs', None
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:49,代码来源:setchangeset.py


注:本文中的trac.ticket.Ticket.values['changesets']方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。