~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2008-08-06 18:33:20 UTC
  • mto: (197.1.9 pathargs)
  • mto: This revision was merged to the branch mainline in revision 202.
  • Revision ID: jelmer@samba.org-20080806183320-6llann0k480dlb9y
add --log-folder option.

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
 
26
24
class BranchWSGIApp(object):
27
25
 
28
26
    def __init__(self, branch, friendly_name=None, config={},
29
 
                 graph_cache=None, branch_link=None, is_root=False):
 
27
                 graph_cache=None, branch_link=None):
30
28
        self.branch = branch
31
29
        self._config = config
32
30
        self.friendly_name = friendly_name
35
33
        if graph_cache is None:
36
34
            graph_cache = bzrlib.lru_cache.LRUCache()
37
35
        self.graph_cache = graph_cache
38
 
        self.is_root = is_root
39
36
 
40
37
    def get_history(self):
41
38
        _history = History(self.branch, self.graph_cache)
81
78
        'download': DownloadUI,
82
79
        'atom': AtomUI,
83
80
        'search': SearchUI,
84
 
        'diff': DiffUI,
85
81
        }
86
82
 
87
83
    def last_updated(self):
109
105
            raise httpexceptions.HTTPNotFound()
110
106
        self.branch.lock_read()
111
107
        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
 
108
            c = cls(self, self.get_history())
 
109
            return c(environ, start_response)
119
110
        finally:
120
111
            self.branch.unlock()
121