Rev 428: Cleanups from Martin's review. in http://bazaar.launchpad.net/~jameinel/loggerhead/less_work_for_head_716217
John Arbash Meinel
john at arbash-meinel.com
Thu Feb 10 13:16:59 UTC 2011
At http://bazaar.launchpad.net/~jameinel/loggerhead/less_work_for_head_716217
------------------------------------------------------------
revno: 428
revision-id: john at arbash-meinel.com-20110210131656-t1q4lnfy2781jznf
parent: john at arbash-meinel.com-20110210051536-cb0gos23mrruty8e
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: less_work_for_head_716217
timestamp: Thu 2011-02-10 07:16:56 -0600
message:
Cleanups from Martin's review.
-------------- next part --------------
=== modified file 'loggerhead/controllers/__init__.py'
--- a/loggerhead/controllers/__init__.py 2011-02-10 05:05:43 +0000
+++ b/loggerhead/controllers/__init__.py 2011-02-10 13:16:56 +0000
@@ -60,7 +60,6 @@
"""
template_path = None
- sets_extra_headers = True
def __init__(self, branch, history_callable):
self._branch = branch
@@ -142,8 +141,6 @@
def _call_start_response(self, start_response, headers):
if 'Content-Type' not in headers:
headers['Content-Type'] = 'text/html'
- # Since HEAD is supposed to match GET, shouldn't we be doing something
- # like sorting the headers?
return start_response("200 OK", headers.items())
def get_revid(self):
=== modified file 'loggerhead/controllers/changelog_ui.py'
--- a/loggerhead/controllers/changelog_ui.py 2011-02-10 05:15:36 +0000
+++ b/loggerhead/controllers/changelog_ui.py 2011-02-10 13:16:56 +0000
@@ -37,17 +37,17 @@
def validate_call(self, path, kwargs, headers):
if path is not None or kwargs or self.args:
- # This includes a file-id, abort for now
+ # This includes extra arguments that we don't validate yet. So
+ # process as normal.
+
+ # path is not None indicates we have a changelog of a specific file
+ # kwargs can be a query or a file_id filter, etc.
+ # self.args indicates we have a revision id, or a revno. We need
+ # to validate that the revision is in the ancestry of the branch
+ # tip.
return False
- # Make sure we have a valid revid
- # XXX: If revid is a string and not in the history of the branch, we
- # won't detect that here. That is done as part of get_view. For
- # now, if self.args is not empty, we just abort above.
- self.get_revid()
# Note: We know it is safe to return True, because we don't set any
- # actual headers. As long as path is None and there aren't
- # kwargs, then the only remaining bit is if revid is not actually
- # part of the branch, we can fail early.
+ # actual headers.
return True
def get_values(self, path, kwargs, headers):
More information about the bazaar-commits
mailing list