Skip to content

Commit

Permalink
Show short commitid string in the timeline tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
tobami committed Jan 2, 2011
1 parent 76eb79c commit c2dfeda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions speedcenter/codespeed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Revision(models.Model):
message = models.TextField(blank=True)
author = models.CharField(max_length=30, blank=True)

def _short_commitid(self):
def get_short_commitid(self):
return self.commitid[:10]

def __unicode__(self):
return self.date.strftime("%h %d, %H:%M") + " - " + \
self._short_commitid() + " " + self.tag
self.get_short_commitid() + " " + self.tag

class Meta:
unique_together = ("commitid", "project")
Expand Down
19 changes: 10 additions & 9 deletions speedcenter/codespeed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,16 @@ def gettimelinedata(request):
baselineexe = Executable.objects.get(id=exeid)
for bench in benchmarks:
append = False
timeline = {}
timeline['benchmark'] = bench.name
timeline['benchmark_id'] = bench.id
timeline['benchmark_description'] = bench.description
timeline['units'] = bench.units
lessisbetter = bench.lessisbetter and ' (less is better)' or ' (more is better)'
timeline['lessisbetter'] = lessisbetter
timeline['executables'] = {}
timeline['baseline'] = "None"
timeline = {
'benchmark': bench.name,
'benchmark_id': bench.id,
'benchmark_description': bench.description,
'units': bench.units,
'lessisbetter': lessisbetter,
'executables': {},
'baseline': "None",
}

for executable in executables:
resultquery = Result.objects.filter(
Expand All @@ -296,7 +297,7 @@ def gettimelinedata(request):
std_dev = ""
if res.std_dev != None: std_dev = res.std_dev
results.append(
[str(res.revision.date), res.value, std_dev, res.revision.commitid]
[str(res.revision.date), res.value, std_dev, res.revision.get_short_commitid()]
)
timeline['executables'][executable] = results
append = True
Expand Down

0 comments on commit c2dfeda

Please sign in to comment.