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.
- <div metal:fill-slot="content">
+ <div metal:fill-slot="content">
+ <tal:branch-info replace="structure python:branchinfo(branch)" />
+
<!-- Something nicer-looking should be done with search -->
<p tal:condition="search_failed">
Sorry, no results found for your search.
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' apps/branch. py 2008-12-05 18:52:44 +0000 apps/branch. py 2009-01-23 20:39:37 +0000 context( **kw)
--- loggerhead/
+++ loggerhead/
@@ -70,6 +70,11 @@
kw = util.get_
return self.url(*args, **kw)
+ @property url_base + path
+ def served_url(self):
+ """The URL that you can fetch this branch from."""
+ return self.url([])
+
def static_url(self, path):
return self._static_
=== modified file 'loggerhead/ apps/filesystem .py' apps/filesystem .py 2008-12-05 20:09:14 +0000 apps/filesystem .py 2009-01-23 18:59:42 +0000
--- loggerhead/
+++ loggerhead/
@@ -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 'PATH_INFO' ] == '/favicon.ico': app(environ, start_response) 'PATH_INFO' ]: make_static( None, self.folder) eSystemServer(
self. folder, self)(environ, start_response)
from loggerhead.apps import favicon_app, static_app
@@ -80,6 +81,9 @@
return static_app(environ, start_response)
elif environ[
return favicon_
+ elif '/.bzr/' in environ[
+ app = urlparser.
+ return app(environ, start_response)
else:
return BranchesFromFil
=== modified file 'loggerhead/ static/ css/diff. css' static/ css/diff. css 2008-07-24 22:07:40 +0000 static/ css/diff. css 2009-01-23 19:21:26 +0000
--- loggerhead/
+++ loggerhead/
@@ -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' static/ css/files. css 2008-08-07 04:34:31 +0000 static/ css/files. css 2009-01-23 20:43:41 +0000
--- loggerhead/
+++ loggerhead/
@@ -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' static/ css/global. css 2008-09-09 22:47:45 +0000 static/ css/global. css 2009-01-23 20:52:17 +0000
--- loggerhead/
+++ loggerhead/
@@ -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/ templatefunctio ns.py' templatefunctio ns.py 2008-10-24 02:26:05 +0000 templatefunctio ns.py 2009-01-23 20:21:44 +0000
--- loggerhead/
+++ loggerhead/
@@ -53,6 +53,11 @@
@templatefunc ').expand( branch= branch, **templatefunct ions) button( group, name, branch, normal='block'): button' ).expand(
group= group, name=name, normal=normal, branch=branch,
+def branchinfo(branch):
+ return _pt('branchinfo
+
+
+@templatefunc
def collapse_
return _pt('collapse-
=== modified file 'loggerhead/ templates/ annotate. pt' templates/ annotate. pt 2009-01-22 22:14:47 +0000 templates/ annotate. pt 2009-01-23 20:47:07 +0000
--- loggerhead/
+++ loggerhead/
@@ -28,6 +28,8 @@
</h1>
<div metal:fill- slot="content" > branchinfo( branch) " /> "href python: url(['/ files', change.revno], clear=1)">browse files</a>
+ <tal:branch-info replace="structure python:
+
<ul id="submenuTabs">
<li id="first">
<a tal:attributes=
=== added file 'loggerhead/ templates/ branchinfo. pt' templates/ branchinfo. pt 1970-01-01 00:00:00 +0000 templates/ branchinfo. pt 2009-01-23 20:51:05 +0000 "python: branch. served_ url" /></code>
--- loggerhead/
+++ loggerhead/
@@ -0,0 +1,5 @@
+<div id="branch-info">
+ To get this branch, use: <br/>
+ <code>bzr branch
+ <tal:served-url tal:replace=
+</div>
=== modified file 'loggerhead/ templates/ changelog. pt' templates/ changelog. pt 2008-10-30 11:37:16 +0000 templates/ changelog. pt 2009-01-23 20:46:32 +0000
</tal: block>
--- loggerhead/
+++ loggerhead/
@@ -34,7 +34,9 @@
</h1>
- <div metal:fill- slot="content" > slot="content" > branchinfo( branch) " /> "search_ failed" >
+ <div metal:fill-
+ <tal:branch-info replace="structure python:
+
<!-- Something nicer-looking should be done with search -->
<p tal:condition=
Sorry, no results found for your search.
=== modified file 'loggerhead/ templates/ inventory. pt' templates/ inventory. pt 2008-10-30 11:22:46 +0000 templates/ inventory. pt 2009-01-23 20:45:05 +0000
--- loggerhead/
+++ loggerhead/
@@ -28,6 +28,8 @@
</h1>
<div metal:fill- slot="content" > branchinfo( branch) " /> "python: not change">
+ <tal:branch-info replace="structure python:
+
<p tal:condition=
No revisions!
</p>
=== modified file 'loggerhead/ templates/ revision. pt' templates/ revision. pt 2008-09-09 22:47:45 +0000 templates/ revision. pt 2009-01-23 20:52:04 +0000
(compared to revision <tal:block content= "python: history. get_revno( compare_ revid)" />)
</tal: compare- to>
</span> </h1> branchinfo( branch) " /> "href python: url(['/ files', change.revno]);
title string:browse files at revision ${change/revno}"
--- loggerhead/
+++ loggerhead/
@@ -30,6 +30,7 @@
+ <tal:branch-info replace="structure python:
<ul id="submenuTabs">
<li id="first"><a tal:attributes=
=== modified file 'loggerhead/ templates/ revisioninfo. pt' templates/ revisioninfo. pt 2008-08-05 19:25:28 +0000 templates/ revisioninfo. pt 2009-01-23 19:19:03 +0000 revision- info"> infoContainer" > "python: util.hide_ email(change. author) "></div> "python: util.hide_ email(change. author) "></div> "python: util.date_ time(change. date)"> </div> change. parents[ 1:]"> "title string:Merged From ${parent/revno};
--- loggerhead/
+++ loggerhead/
@@ -1,6 +1,6 @@
-<div id="infoContainer" class="
+<div class="
<div id="infTxt">
- <div class="comiter" tal:content=
+ <div class="committer" tal:content=
<div class="timer" tal:content=
<div class="mfrom" tal:repeat="parent python:
<a tal:attributes=