/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/apps/branch.py

[rs=mwhudson] Merged the latest and greatest from trunk.

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
5
6
 
6
7
import bzrlib.branch
7
8
import bzrlib.lru_cache
30
31
        self._config = config
31
32
        self.friendly_name = friendly_name
32
33
        self.branch_link = branch_link  # Currently only used in Launchpad
33
 
        self.log = logging.getLogger('loggerhead.%s' % (friendly_name,))
 
34
        self.log = logging.getLogger('loggerhead.%s' % friendly_name)
34
35
        if graph_cache is None:
35
36
            graph_cache = bzrlib.lru_cache.LRUCache()
36
37
        self.graph_cache = graph_cache
85
86
 
86
87
    def last_updated(self):
87
88
        h = self.get_history()
88
 
        change = h.get_changes([ h.last_revid ])[0]
 
89
        change = h.get_changes([h.last_revid])[0]
89
90
        return change.date
90
91
 
91
92
    def branch_url(self):
108
109
            raise httpexceptions.HTTPNotFound()
109
110
        self.branch.lock_read()
110
111
        try:
111
 
            c = cls(self, self.get_history())
112
 
            return c(environ, start_response)
 
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
113
119
        finally:
114
120
            self.branch.unlock()