43
46
template_path = 'loggerhead.templates.inventory'
45
def get_values(self, h, args, kw, headers):
47
revid = h.fix_revid(args[0])
48
def get_values(self, history, revid, path, kwargs, headers):
51
inv = history.get_inventory(revid)
53
self.log.exception('Exception fetching changes')
54
raise HTTPServerError('Could not fetch changes')
56
file_id = kwargs.get('file_id', None)
57
start_revid = kwargs.get('start_revid', None)
58
sort_type = kwargs.get('sort', None)
51
60
# no navbar for revisions
52
61
navigation = util.Container()
63
change = history.get_changes([ revid ])[0]
64
# add parent & merge-point branch-nick info, in case it's useful
65
history.get_branch_nicks([ change ])
68
if not path.startswith('/'):
70
file_id = history.get_file_id(revid, path)
72
path = inv.id2path(file_id)
75
file_id = inv.root.file_id
78
idpath = inv.get_idpath(file_id)
80
updir = dirname(path)[1:]
53
84
# Directory Breadcrumbs
54
85
directory_breadcrumbs = util.directory_breadcrumbs(
55
86
self._branch.friendly_name,
59
90
if not is_null_rev(revid):
61
inv = h.get_inventory(revid)
92
inv = history.get_inventory(revid)
63
94
self.log.exception('Exception fetching changes')
64
95
raise HTTPServerError('Could not fetch changes')
66
file_id = kw.get('file_id', inv.root.file_id)
67
start_revid = kw.get('start_revid', None)
68
sort_type = kw.get('sort', None)
70
change = h.get_changes([revid])[0]
97
change = history.get_changes([ revid ])[0]
71
98
# add parent & merge-point branch-nick info, in case it's useful
72
h.get_branch_nicks([change])
74
path = inv.id2path(file_id)
75
if not path.startswith('/'):
77
idpath = inv.get_idpath(file_id)
80
updir_file_id = idpath[-2]
99
history.get_branch_nicks([ change ])
87
101
# Create breadcrumb trail for the path within the branch
88
102
branch_breadcrumbs = util.branch_breadcrumbs(path, inv, 'files')
89
filelist = h.get_filelist(inv, file_id, sort_type)
103
filelist = history.get_filelist(inv, file_id, sort_type)