17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
from cherrypy import HTTPRedirect, session
26
from cherrypy import HTTPError
30
28
from loggerhead import util
53
51
h = self._branch.get_history()
54
52
util.set_context(kw)
57
revid = h.fix_revid(args[0])
61
file_id = kw.get('file_id', None)
63
raise HTTPRedirect(self._branch.url('/changes'))
66
revid_list, revid = h.get_file_view(revid, file_id)
68
self.log.error('Exception fetching changes: %s' % (x,))
69
util.log_exception(self.log)
70
raise HTTPRedirect(self._branch.url('/changes'))
72
# no navbar for revisions
73
navigation = util.Container()
75
path = h.get_path(revid, file_id)
76
filename = os.path.basename(path)
79
'branch': self._branch,
86
'navigation': navigation,
87
'change': h.get_changes([ revid ])[0],
88
'contents': list(h.annotate_file(file_id, revid)),
91
self.log.info('/annotate: %r secs' % (time.time() - z,))
57
revid = h.fix_revid(args[0])
63
path = '/'.join(args[1:])
64
if not path.startswith('/'):
67
file_id = kw.get('file_id', None)
68
if (file_id is None) and (path is None):
69
raise HTTPError(400, 'No file_id or filename provided to annotate')
72
file_id = h.get_file_id(revid, path)
74
# no navbar for revisions
75
navigation = util.Container()
78
path = h.get_path(revid, file_id)
79
filename = os.path.basename(path)
82
'branch': self._branch,
89
'navigation': navigation,
90
'change': h.get_changes([ revid ])[0],
91
'contents': list(h.annotate_file(file_id, revid)),
94
self.log.info('/annotate: %r secs' % (time.time() - z,))