[ADD] revision committer

This commit is contained in:
Denis Ledoux 2014-07-30 13:27:39 +02:00
parent 6265f24ce3
commit 23c91278d7
2 changed files with 14 additions and 3 deletions

View File

@ -250,14 +250,14 @@ class runbot_repo(osv.osv):
repo.git(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
repo.git(['fetch', '-p', 'origin', '+refs/pull/*/head:refs/pull/*'])
fields = ['refname','objectname','committerdate:iso8601','authorname','subject']
fields = ['refname','objectname','committerdate:iso8601','authorname','subject','committername']
fmt = "%00".join(["%("+field+")" for field in fields])
git_refs = repo.git(['for-each-ref', '--format', fmt, '--sort=-committerdate', 'refs/heads', 'refs/pull'])
git_refs = git_refs.strip()
refs = [[decode_utf(field) for field in line.split('\x00')] for line in git_refs.split('\n')]
for name, sha, date, author, subject in refs:
for name, sha, date, author, subject, committer in refs:
# create or get branch
branch_ids = Branch.search(cr, uid, [('repo_id', '=', repo.id), ('name', '=', name)])
if branch_ids:
@ -281,6 +281,7 @@ class runbot_repo(osv.osv):
'branch_id': branch.id,
'name': sha,
'author': author,
'committer': committer,
'subject': subject,
'date': dateutil.parser.parse(date[:19]),
'modules': branch.repo_id.modules,
@ -453,6 +454,7 @@ class runbot_build(osv.osv):
'domain': fields.function(_get_domain, type='char', string='URL'),
'date': fields.datetime('Commit date'),
'author': fields.char('Author'),
'committer': fields.char('Committer'),
'subject': fields.text('Subject'),
'sequence': fields.integer('Sequence', select=1),
'modules': fields.char("Modules to Install"),
@ -829,6 +831,7 @@ class runbot_build(osv.osv):
'branch_id': build.branch_id.id,
'name': build.name,
'author': build.author,
'committer': build.committer,
'subject': build.subject,
}
self.create(cr, 1, new_build, context=context)
@ -1061,6 +1064,7 @@ class RunbotController(http.Controller):
'result': real_build.result,
'subject': build.subject,
'author': build.author,
'committer': build.committer,
'dest': build.dest,
'real_dest': real_build.dest,
'job_age': s2human(real_build.job_age),

View File

@ -121,6 +121,7 @@
<field name="name"/>
<field name="date"/>
<field name="author"/>
<field name="committer"/>
<field name="subject"/>
<field name="port"/>
<field name="dest"/>
@ -146,6 +147,7 @@
<field name="dest"/>
<field name="date"/>
<field name="author"/>
<field name="committer"/>
<field name="state"/>
<field name="port"/>
<field name="job"/>
@ -385,7 +387,11 @@
<br/>
</t>
<t t-id="bu['author']">
<t t-esc="bu['author']"/><br/>
<t t-esc="bu['author']"/>
<t t-if="bu['committer'] and bu['author'] != bu['committer']" t-id="bu['committer']">
(<span class="glyphicon glyphicon-arrow-right"></span>&amp;nbsp;<t t-esc="bu['committer']"/>)
</t>
<br/>
</t>
<small><t t-esc="bu['dest']"/></small><br/>
<t t-call="runbot.build_name"/>
@ -478,6 +484,7 @@
<p>
Subject: <t t-esc="build['subject']"/><br/>
Author: <t t-esc="build['author']"/><br/>
Committer: <t t-esc="build['committer']"/><br/>
</p>
<table class="table table-condensed table-striped">
<tr>