23
from paste.httpexceptions import HTTPNotFound, HTTPServerError
25
from bzrlib.revision import is_null as is_null_rev
23
from paste.httpexceptions import HTTPServerError
27
25
from loggerhead import util
28
26
from loggerhead.controllers import TemplatedBranchView
48
46
revid = h.last_revid
49
inv = h.get_inventory(revid)
51
self.log.exception('Exception fetching changes')
52
raise HTTPServerError('Could not fetch changes')
54
file_id = kw.get('file_id', inv.root.file_id)
55
start_revid = kw.get('start_revid', None)
56
sort_type = kw.get('sort', None)
50
58
# no navbar for revisions
51
59
navigation = util.Container()
52
# Directory Breadcrumbs
53
directory_breadcrumbs = util.directory_breadcrumbs(
54
self._branch.friendly_name,
58
if not is_null_rev(revid):
60
inv = h.get_inventory(revid)
62
self.log.exception('Exception fetching changes')
63
raise HTTPServerError('Could not fetch changes')
65
file_id = kw.get('file_id', inv.root.file_id)
66
start_revid = kw.get('start_revid', None)
67
sort_type = kw.get('sort', None)
69
change = h.get_changes([ revid ])[0]
70
# add parent & merge-point branch-nick info, in case it's useful
71
h.get_branch_nicks([ change ])
73
path = inv.id2path(file_id)
74
if not path.startswith('/'):
76
idpath = inv.get_idpath(file_id)
79
updir_file_id = idpath[-2]
86
# Create breadcrumb trail for the path within the branch
87
branch_breadcrumbs = util.branch_breadcrumbs(path, inv, 'files')
88
filelist = h.get_filelist(inv, file_id, sort_type)
61
change = h.get_changes([ revid ])[0]
62
# add parent & merge-point branch-nick info, in case it's useful
63
h.get_branch_nicks([ change ])
65
path = inv.id2path(file_id)
66
if not path.startswith('/'):
68
idpath = inv.get_idpath(file_id)
71
updir_file_id = idpath[-2]
98
74
updir_file_id = None
99
branch_breadcrumbs = []
103
79
'branch': self._branch,
110
86
'updir_file_id': updir_file_id,
111
'filelist': filelist,
87
'filelist': h.get_filelist(inv, file_id, sort_type),
113
89
'posixpath': posixpath,
114
90
'navigation': navigation,
115
91
'url': self._branch.context_url,
116
92
'start_revid': start_revid,
117
93
'fileview_active': True,
118
'directory_breadcrumbs': directory_breadcrumbs,
119
'branch_breadcrumbs': branch_breadcrumbs,