/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/controllers/annotate_ui.py

  • Committer: Robey Pointer
  • Date: 2006-12-13 23:52:52 UTC
  • Revision ID: robey@lag.net-20061213235252-9a4lxj0idj65rbk8
add a caching system for revision/change entries, since those should never
change, and stuff the history object into a global shared (locked) var so
we don't rebuild the revision-graph cache on every page load.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
import posixpath
23
23
import textwrap
 
24
import time
24
25
 
25
26
import turbogears
26
27
from cherrypy import HTTPRedirect, session
27
28
 
28
 
from loggerhead.history import History
29
29
from loggerhead import util
30
30
 
31
31
 
42
42
 
43
43
    @turbogears.expose(html='loggerhead.templates.annotate')
44
44
    def default(self, *args, **kw):
45
 
        h = History.from_folder(turbogears.config.get('loggerhead.folder'))
 
45
        z = time.time()
 
46
        h = util.get_history()
 
47
        
46
48
        if len(args) > 0:
47
49
            revid = args[0]
48
50
        else:
76
78
            'history': h,
77
79
            'navigation': navigation,
78
80
            'change': h.get_change(revid),
79
 
            'contents': h.annotate_file(file_id, revid),
 
81
            'contents': list(h.annotate_file(file_id, revid)),
80
82
        }
 
83
        h.flush_cache()
 
84
        log.info('/annotate: %r secs' % (time.time() - z,))
81
85
        return vals