23
from cherrypy import HTTPRedirect, response
23
from cherrypy import HTTPRedirect, InternalError, response
25
25
from loggerhead import util
35
35
@turbogears.expose()
36
36
def default(self, *args, **kw):
37
# /bundle/<rev_id>/filename
37
# /bundle/<rev_id>/[<compare_rev_id>/]filename
39
39
h = self._branch.get_history()
42
raise HTTPRedirect(self._branch.url('/changes'))
43
revid = h.fix_revid(args[0])
46
bundle_data = h.get_bundle(revid)
48
self.log.error('Exception fetching bundle: %s' % (x,))
49
util.log_exception(self.log)
50
raise HTTPRedirect(self._branch.url('/changes'))
52
response.headers['Content-Type'] = 'text/plain'
53
response.headers['Content-Length'] = len(bundle_data)
54
response.body = bundle_data
55
self.log.info('/bundle: %r seconds' % (time.time() - z,))
44
raise HTTPRedirect(self._branch.url('/changes'))
45
revid = h.fix_revid(args[0])
47
compare_revid = h.fix_revid(args[1])
52
bundle_data = h.get_bundle(revid, compare_revid)
54
self.log.exception('Exception fetching bundle')
55
raise InternalError('Could not fetch bundle')
57
response.headers['Content-Type'] = 'application/octet-stream'
58
response.headers['Content-Length'] = len(bundle_data)
59
response.body = bundle_data
60
self.log.info('/bundle: %r seconds' % (time.time() - z,))