Download:
child 121:2ec2aa867f76
parent 119:2c3af104d654
120:21ef016ac29d
Anton Shestakov <av6@dwimlabs.net>, Thu, 07 Jul 2016 13:58:38 +0800
models: revs are not unique, can be nulls Revision numbers can change depending on --branch or --rev for hg clone.

4 файлов изменено, 5 вставок(+), 5 удалений(-) [+]
candolint/models.py file | annotate | diff | comparison | revisions
templates/check.html file | annotate | diff | comparison | revisions
templates/index.html file | annotate | diff | comparison | revisions
templates/project.html file | annotate | diff | comparison | revisions
--- a/candolint/models.py Thu Jul 07 13:55:51 2016 +0800
+++ b/candolint/models.py Thu Jul 07 13:58:38 2016 +0800
@@ -68,7 +68,7 @@
class Change(BaseModel):
- rev = pw.IntegerField()
+ rev = pw.IntegerField(null=True)
node = pw.CharField()
branch = pw.CharField()
date = pw.DateTimeField()
@@ -79,7 +79,7 @@
class Meta:
indexes = (
- (('rev', 'node', 'project'), True),
+ (('node', 'project'), True),
)
--- a/templates/check.html Thu Jul 07 13:55:51 2016 +0800
+++ b/templates/check.html Thu Jul 07 13:58:38 2016 +0800
@@ -33,7 +33,7 @@
<dl class="uk-description-list-horizontal list-terse">
{% set change = check.change %}
<dt>Commit:</dt>
- <dd><a href="{{ adapter.get_commit_url(change) }}">{{ change.rev }}:{{ change.node[:12] }}</a></dd>
+ <dd><a href="{{ adapter.get_commit_url(change) }}">{% if change.rev is not None %}{{ change.rev }}:{% end %}{{ change.node[:12] }}</a></dd>
<dt>Branch:</dt>
<dd><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></dd>
<dt>Author:</dt>
--- a/templates/index.html Thu Jul 07 13:55:51 2016 +0800
+++ b/templates/index.html Thu Jul 07 13:58:38 2016 +0800
@@ -16,7 +16,7 @@
<td class="uk-width-1-1 uk-text-break"><a href="{{ project.get_url() }}">{{ project.get_title() }}</a></td>
<td><a href="{{ project.get_url() }}/{{ check.ordinal }}">check #{{ check.ordinal }}</a></td>
<td><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></td>
- <td><a href="{{ adapter.get_commit_url(change) }}">{{ change.rev }}:{{ change.node[:12] }}</a></td>
+ <td><a href="{{ adapter.get_commit_url(change) }}">{% if change.rev is not None %}{{ change.rev }}:{% end %}{{ change.node[:12] }}</a></td>
<td>{% module Time(check.finished) %}</td>
<td>{{ check.get_duration() }}</td>
</tr>
--- a/templates/project.html Thu Jul 07 13:55:51 2016 +0800
+++ b/templates/project.html Thu Jul 07 13:58:38 2016 +0800
@@ -24,7 +24,7 @@
<td>{% module Badges(check) %}</td>
<td><a href="{{ project.get_url() }}/{{ check.ordinal }}">check #{{ check.ordinal }}</a></td>
<td><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></td>
- <td><a href="{{ adapter.get_commit_url(change) }}">{{ change.rev }}:{{ change.node[:12] }}</a></td>
+ <td><a href="{{ adapter.get_commit_url(change) }}">{% if change.rev is not None %}{{ change.rev }}:{% end %}{{ change.node[:12] }}</a></td>
<td class="uk-width-1-1 uk-text-break">
<div>{{ change.message }}</div>
<div>{{ change.author }}, {% module Time(change.date, False) %}</div>