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.
--- a/candolint/models.py Thu Jul 07 13:55:51 2016 +0800
+++ b/candolint/models.py Thu Jul 07 13:58:38 2016 +0800
- rev = pw.IntegerField()
+ rev = pw.IntegerField(null=True)
date = pw.DateTimeField()
- (('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
<dl class="uk-description-list-horizontal list-terse">
{% set change = check.change %}
- <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>
<dd><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></dd>
--- a/templates/index.html Thu Jul 07 13:55:51 2016 +0800
+++ b/templates/index.html Thu Jul 07 13:58:38 2016 +0800
<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>
--- a/templates/project.html Thu Jul 07 13:55:51 2016 +0800
+++ b/templates/project.html Thu Jul 07 13:58:38 2016 +0800
<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>