mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[ADD] revision committer
This commit is contained in:
parent
6265f24ce3
commit
23c91278d7
@ -250,14 +250,14 @@ class runbot_repo(osv.osv):
|
|||||||
repo.git(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
|
repo.git(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
|
||||||
repo.git(['fetch', '-p', 'origin', '+refs/pull/*/head:refs/pull/*'])
|
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])
|
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 = repo.git(['for-each-ref', '--format', fmt, '--sort=-committerdate', 'refs/heads', 'refs/pull'])
|
||||||
git_refs = git_refs.strip()
|
git_refs = git_refs.strip()
|
||||||
|
|
||||||
refs = [[decode_utf(field) for field in line.split('\x00')] for line in git_refs.split('\n')]
|
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
|
# create or get branch
|
||||||
branch_ids = Branch.search(cr, uid, [('repo_id', '=', repo.id), ('name', '=', name)])
|
branch_ids = Branch.search(cr, uid, [('repo_id', '=', repo.id), ('name', '=', name)])
|
||||||
if branch_ids:
|
if branch_ids:
|
||||||
@ -281,6 +281,7 @@ class runbot_repo(osv.osv):
|
|||||||
'branch_id': branch.id,
|
'branch_id': branch.id,
|
||||||
'name': sha,
|
'name': sha,
|
||||||
'author': author,
|
'author': author,
|
||||||
|
'committer': committer,
|
||||||
'subject': subject,
|
'subject': subject,
|
||||||
'date': dateutil.parser.parse(date[:19]),
|
'date': dateutil.parser.parse(date[:19]),
|
||||||
'modules': branch.repo_id.modules,
|
'modules': branch.repo_id.modules,
|
||||||
@ -453,6 +454,7 @@ class runbot_build(osv.osv):
|
|||||||
'domain': fields.function(_get_domain, type='char', string='URL'),
|
'domain': fields.function(_get_domain, type='char', string='URL'),
|
||||||
'date': fields.datetime('Commit date'),
|
'date': fields.datetime('Commit date'),
|
||||||
'author': fields.char('Author'),
|
'author': fields.char('Author'),
|
||||||
|
'committer': fields.char('Committer'),
|
||||||
'subject': fields.text('Subject'),
|
'subject': fields.text('Subject'),
|
||||||
'sequence': fields.integer('Sequence', select=1),
|
'sequence': fields.integer('Sequence', select=1),
|
||||||
'modules': fields.char("Modules to Install"),
|
'modules': fields.char("Modules to Install"),
|
||||||
@ -829,6 +831,7 @@ class runbot_build(osv.osv):
|
|||||||
'branch_id': build.branch_id.id,
|
'branch_id': build.branch_id.id,
|
||||||
'name': build.name,
|
'name': build.name,
|
||||||
'author': build.author,
|
'author': build.author,
|
||||||
|
'committer': build.committer,
|
||||||
'subject': build.subject,
|
'subject': build.subject,
|
||||||
}
|
}
|
||||||
self.create(cr, 1, new_build, context=context)
|
self.create(cr, 1, new_build, context=context)
|
||||||
@ -1061,6 +1064,7 @@ class RunbotController(http.Controller):
|
|||||||
'result': real_build.result,
|
'result': real_build.result,
|
||||||
'subject': build.subject,
|
'subject': build.subject,
|
||||||
'author': build.author,
|
'author': build.author,
|
||||||
|
'committer': build.committer,
|
||||||
'dest': build.dest,
|
'dest': build.dest,
|
||||||
'real_dest': real_build.dest,
|
'real_dest': real_build.dest,
|
||||||
'job_age': s2human(real_build.job_age),
|
'job_age': s2human(real_build.job_age),
|
||||||
|
@ -121,6 +121,7 @@
|
|||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
<field name="author"/>
|
<field name="author"/>
|
||||||
|
<field name="committer"/>
|
||||||
<field name="subject"/>
|
<field name="subject"/>
|
||||||
<field name="port"/>
|
<field name="port"/>
|
||||||
<field name="dest"/>
|
<field name="dest"/>
|
||||||
@ -146,6 +147,7 @@
|
|||||||
<field name="dest"/>
|
<field name="dest"/>
|
||||||
<field name="date"/>
|
<field name="date"/>
|
||||||
<field name="author"/>
|
<field name="author"/>
|
||||||
|
<field name="committer"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<field name="port"/>
|
<field name="port"/>
|
||||||
<field name="job"/>
|
<field name="job"/>
|
||||||
@ -385,7 +387,11 @@
|
|||||||
<br/>
|
<br/>
|
||||||
</t>
|
</t>
|
||||||
<t t-id="bu['author']">
|
<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>&nbsp;<t t-esc="bu['committer']"/>)
|
||||||
|
</t>
|
||||||
|
<br/>
|
||||||
</t>
|
</t>
|
||||||
<small><t t-esc="bu['dest']"/></small><br/>
|
<small><t t-esc="bu['dest']"/></small><br/>
|
||||||
<t t-call="runbot.build_name"/>
|
<t t-call="runbot.build_name"/>
|
||||||
@ -478,6 +484,7 @@
|
|||||||
<p>
|
<p>
|
||||||
Subject: <t t-esc="build['subject']"/><br/>
|
Subject: <t t-esc="build['subject']"/><br/>
|
||||||
Author: <t t-esc="build['author']"/><br/>
|
Author: <t t-esc="build['author']"/><br/>
|
||||||
|
Committer: <t t-esc="build['committer']"/><br/>
|
||||||
</p>
|
</p>
|
||||||
<table class="table table-condensed table-striped">
|
<table class="table table-condensed table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user