Exemple #1
0
    def _process_log_request(self, req):
        '''
        Process log request information.

        This method is invoked when cursor is over a RevTree changeset,
        returning corresponding revision log information.

        :param req: Trac request object
        :returns: template, template data, type of response
        '''

        try:
            rev = int(req.args['logrev'])
            repos = Repository.get_svn_repository(self.env)
            if not repos:
                raise TracError("Revtree only supports Subversion "
                                "repositories")
            chgset = repos.get_changeset(rev)
            wikimsg = wiki_to_html(to_unicode(chgset.message),
                                   self.env,
                                   req,
                                   None,
                                   True,
                                   False)
            data = {
                'chgset': True,
                'revision': rev,
                'time': format_datetime(chgset.date).replace('()', ''),
                'age': pretty_timedelta(chgset.date, None, 3600),
                'author': to_unicode(chgset.author) or u'anonymous',
                'message': wikimsg
            }

            return 'revtree_log.html', {'log': data}, 'application/xhtml+xml'
        except Exception as e:
            raise TracError("Invalid revision log request: %s" % e)