Merge lp://staging/~jml/loggerhead/branch-from-loggerhead-simple into lp://staging/loggerhead

Proposed by Jonathan Lange
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~jml/loggerhead/branch-from-loggerhead-simple
Merge into: lp://staging/loggerhead
To merge this branch: bzr merge lp://staging/~jml/loggerhead/branch-from-loggerhead-simple
Reviewer Review Type Date Requested Status
Martin Albisetti Approve
Review via email: mp+3092@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :
Download full text (7.0 KiB)

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...

Read more...

Revision history for this message
Martin Albisetti (beuno) wrote :

Everything looks great.
The fact that you actually added docstring almost made me cry.

I'll add it to NEWS and merge, thanks.

review: Approve

Subscribers

People subscribed via source and target branches