~mnordhoff/loggerhead/cheezum

« back to all changes in this revision

Viewing changes to loggerhead/controllers/annotate_ui.py

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-10 00:13:18 UTC
  • mfrom: (164.18.29 trunk)
  • mto: (164.35.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 242.
  • Revision ID: guillo.gonzo@gmail.com-20080910001318-78w16x9zl9p7f1k3
 * merge with trunk 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import posixpath
22
22
 
23
 
from paste.httpexceptions import HTTPBadRequest
 
23
from paste.httpexceptions import HTTPBadRequest, HTTPServerError
24
24
 
25
25
from loggerhead.controllers import TemplatedBranchView
26
26
from loggerhead import util
62
62
            path = h.get_path(revid, file_id)
63
63
        filename = os.path.basename(path)
64
64
 
 
65
        # Directory Breadcrumbs
 
66
        directory_breadcrumbs = (
 
67
            util.directory_breadcrumbs(
 
68
                self._branch.friendly_name,
 
69
                self._branch.is_root,
 
70
                'files'))
 
71
 
 
72
        # Create breadcrumb trail for the path within the branch
 
73
        try:
 
74
            inv = h.get_inventory(revid)
 
75
        except:
 
76
            self.log.exception('Exception fetching changes')
 
77
            raise HTTPServerError('Could not fetch changes')
 
78
        branch_breadcrumbs = util.branch_breadcrumbs(path, inv, 'files')
 
79
 
65
80
        return {
66
81
            'revid': revid,
67
82
            'file_id': file_id,
71
86
            'change': h.get_changes([ revid ])[0],
72
87
            'contents': list(h.annotate_file(file_id, revid)),
73
88
            'fileview_active': True,
 
89
            'directory_breadcrumbs': directory_breadcrumbs,
 
90
            'branch_breadcrumbs': branch_breadcrumbs,
74
91
        }