This patch allows loggerhead to serve Bazaar branches over HTTP. It does this by catching requests to any paths with a '.bzr' segment, and ensuring that those paths are served with a static application, rather than with the branch application. I've added a box with information about how to get the branch to every page in loggerhead. It's not beautiful, but it's a start. To do this well, I've had to tweak the CSS a bit. Hope it's OK. === modified file 'loggerhead/apps/branch.py' --- loggerhead/apps/branch.py 2008-12-05 18:52:44 +0000 +++ loggerhead/apps/branch.py 2009-01-23 20:39:37 +0000 @@ -70,6 +70,11 @@ kw = util.get_context(**kw) return self.url(*args, **kw) + @property + def served_url(self): + """The URL that you can fetch this branch from.""" + return self.url([]) + def static_url(self, path): return self._static_url_base + path === modified file 'loggerhead/apps/filesystem.py' --- loggerhead/apps/filesystem.py 2008-12-05 20:09:14 +0000 +++ loggerhead/apps/filesystem.py 2009-01-23 18:59:42 +0000 @@ -7,6 +7,7 @@ from paste.request import path_info_pop from paste import httpexceptions +from paste import urlparser from loggerhead.apps.branch import BranchWSGIApp from loggerhead.apps import favicon_app, static_app @@ -80,6 +81,9 @@ return static_app(environ, start_response) elif environ['PATH_INFO'] == '/favicon.ico': return favicon_app(environ, start_response) + elif '/.bzr/' in environ['PATH_INFO']: + app = urlparser.make_static(None, self.folder) + return app(environ, start_response) else: return BranchesFromFileSystemServer( self.folder, self)(environ, start_response) === modified file 'loggerhead/static/css/diff.css' --- loggerhead/static/css/diff.css 2008-07-24 22:07:40 +0000 +++ loggerhead/static/css/diff.css 2009-01-23 19:21:26 +0000 @@ -1,5 +1,5 @@ /*Info Box*/ -#infoContainer { +.infoContainer { width:970px; padding:10px 10px 0px 10px; margin:0px 0px 10px 0px; @@ -31,7 +31,7 @@ width:493px; margin:0px 0px 5px 0px; } -.information, .comiter, .timer, .mfrom, .mto, .revid { +.information, .committer, .timer, .mfrom, .mto, .revid { clear:both; margin:0px; padding:0px 0px 2px 18px; @@ -43,7 +43,7 @@ padding:1px 0px 0px 18px; margin:0px 10px 5px 0px; } -.comiter, .mfrom, .mto { +.committer, .mfrom, .mto { color:#000; padding:1px 0px 0px 18px; margin:0px 10px 5px 0px; === modified file 'loggerhead/static/css/files.css' --- loggerhead/static/css/files.css 2008-08-07 04:34:31 +0000 +++ loggerhead/static/css/files.css 2009-01-23 20:43:41 +0000 @@ -1,13 +1,5 @@ /*Info Box*/ -#infoContainer { - width:900px; - padding:10px 10px 0px 10px; - margin:0px 0px 10px 0px; - color:#666; - background:#fcfcfc; - border:1px solid #b7b7b7; -} -.information, .comiter, .timer, .mfrom, .mto, .revid { +.information, .committer, .timer, .mfrom, .mto, .revid { float:left; margin:0px 10px 5px 0px; padding:0px 0px 2px 18px; === modified file 'loggerhead/static/css/global.css' --- loggerhead/static/css/global.css 2008-09-09 22:47:45 +0000 +++ loggerhead/static/css/global.css 2009-01-23 20:52:17 +0000 @@ -329,3 +329,11 @@ font-weight:bold; font-size:18px; } +#branch-info { + width:900px; + padding:10px 10px 10px 10px; + margin:0px 0px 10px 0px; + color:#666; + background:#fcfcfc; + border:1px solid #b7b7b7; +} === modified file 'loggerhead/templatefunctions.py' --- loggerhead/templatefunctions.py 2008-10-24 02:26:05 +0000 +++ loggerhead/templatefunctions.py 2009-01-23 20:21:44 +0000 @@ -53,6 +53,11 @@ @templatefunc +def branchinfo(branch): + return _pt('branchinfo').expand(branch=branch, **templatefunctions) + + +@templatefunc def collapse_button(group, name, branch, normal='block'): return _pt('collapse-button').expand( group=group, name=name, normal=normal, branch=branch, === modified file 'loggerhead/templates/annotate.pt' --- loggerhead/templates/annotate.pt 2009-01-22 22:14:47 +0000 +++ loggerhead/templates/annotate.pt 2009-01-23 20:47:07 +0000 @@ -28,6 +28,8 @@
+ +