~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/__init__.py

  • Committer: Matt Nordhoff
  • Date: 2010-05-04 02:31:07 UTC
  • Revision ID: mnordhoff@mattnordhoff.com-20100504023107-mc14jz1yjs3owib4
Small to-do comment about a function added in bzr 1.18.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# along with this program; if not, write to the Free Software
18
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
 
20
 
import bzrlib.errors
21
20
import time
22
21
 
23
 
from paste.httpexceptions import HTTPNotFound
24
22
from paste.request import path_info_pop, parse_querystring
25
23
 
26
24
from loggerhead import util
99
97
        if 'Content-Type' not in headers:
100
98
            headers['Content-Type'] = 'text/html'
101
99
        writer = start_response("200 OK", headers.items())
102
 
        if environ.get('REQUEST_METHOD') == 'HEAD':
103
 
            # No content for a HEAD request
104
 
            return []
105
100
        template = load_template(self.template_path)
106
101
        z = time.time()
107
102
        w = BufferingWriter(writer, 8192)
117
112
        if h is None:
118
113
            return None
119
114
        if len(self.args) > 0 and self.args != ['']:
120
 
            try:
121
 
                revid = h.fix_revid(self.args[0])
122
 
            except bzrlib.errors.NoSuchRevision:
123
 
                raise HTTPNotFound;
 
115
            return h.fix_revid(self.args[0])
124
116
        else:
125
 
            revid = h.last_revid
126
 
        return revid
 
117
            return h.last_revid