~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2008-07-25 20:59:53 UTC
  • mto: This revision was merged to the branch mainline in revision 183.
  • Revision ID: jelmer@samba.org-20080725205953-7zymhzysgi8za5oa
Remove executable bit from image.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import logging
4
4
import urllib
5
 
import sys
6
5
 
7
6
import bzrlib.branch
8
7
import bzrlib.lru_cache
18
17
from loggerhead.controllers.atom_ui import AtomUI
19
18
from loggerhead.controllers.download_ui import DownloadUI
20
19
from loggerhead.controllers.search_ui import SearchUI
21
 
from loggerhead.controllers.diff_ui import DiffUI
22
20
from loggerhead.history import History
23
21
from loggerhead import util
24
22
 
25
23
 
26
24
class BranchWSGIApp(object):
27
25
 
28
 
    def __init__(self, branch, friendly_name=None, config={},
29
 
                 graph_cache=None, branch_link=None, is_root=False):
 
26
    def __init__(self, branch, friendly_name=None, config={}, graph_cache=None):
30
27
        self.branch = branch
31
28
        self._config = config
32
29
        self.friendly_name = friendly_name
33
 
        self.branch_link = branch_link  # Currently only used in Launchpad
34
30
        self.log = logging.getLogger('loggerhead.%s' % (friendly_name,))
35
31
        if graph_cache is None:
36
32
            graph_cache = bzrlib.lru_cache.LRUCache()
37
33
        self.graph_cache = graph_cache
38
 
        self.is_root = is_root
39
34
 
40
35
    def get_history(self):
41
36
        _history = History(self.branch, self.graph_cache)
81
76
        'download': DownloadUI,
82
77
        'atom': AtomUI,
83
78
        'search': SearchUI,
84
 
        'diff': DiffUI,
85
79
        }
86
80
 
87
81
    def last_updated(self):
109
103
            raise httpexceptions.HTTPNotFound()
110
104
        self.branch.lock_read()
111
105
        try:
112
 
            try:
113
 
                c = cls(self, self.get_history())
114
 
                return c(environ, start_response)
115
 
            except:
116
 
                environ['exc_info'] = sys.exc_info()
117
 
                environ['branch'] = self
118
 
                raise
 
106
            c = cls(self, self.get_history())
 
107
            return c(environ, start_response)
119
108
        finally:
120
109
            self.branch.unlock()
121