Free Standards Group enhancements to bzr add-ons

James Westby jw+debian at jameswestby.net
Wed Aug 30 21:20:08 BST 2006


On (30/08/06 11:58), Jeff Licquia wrote:
> The Free Standards Group is nearly done migrating from CVS to bzr.  We
> use a few bzr add-ons: PQM, bzr-webserve, and Michael Ellerman's tags
> plugin.
> 

> We've also discovered that webserve doesn't handle the case well where
> the repository in question doesn't exist.  To see what I mean, try:
> 
> http://bzr.freestandards.org/lsb/devel/nonexistent-branch
> 
> If I get a chance, a fix for that may appear soon in our webserve
> branch.  But I won't be heartbroken if someone beats me to it. :-)
> 

As long as it wont break your heart you can use the attached bundle.

James

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256
-------------- next part --------------
# Bazaar revision bundle v0.8
#
# message:
#   An actual fix
# committer: James Westby <jw+debian at jameswestby.net>
# date: Wed 2006-08-30 18:37:17.545000076 +0100

=== modified file webserve/hgweb.py
--- webserve/hgweb.py
+++ webserve/hgweb.py
@@ -1624,21 +1624,25 @@
             virtual = ""
 
         if virtual:
-            real = self.cp.get(virtual,"path")
-
-            style = get(virtual,"style","")
-            if style == "": mapfile = "map"
-            else:           mapfile = "map-"+style
-
-            h = hgweb(real, get(virtual,"name",virtual),
-                get(virtual,"template",""), mapfile)
-
-            h.dolock = int(get(virtual,"lock","0"))
-            h.profile = int(get(virtual,"profile","0"))
-            h.tararchive = int(get(virtual,"tararchive","0"))
-
-            h.run()
-            return
+            try:
+                real = self.cp.get(virtual,"path")
+            except ConfigParser.NoSectionError:
+                virtual = ""
+
+            if virtual:
+                style = get(virtual,"style","")
+                if style == "": mapfile = "map"
+                else:           mapfile = "map-"+style
+
+                h = hgweb(real, get(virtual,"name",virtual),
+                    get(virtual,"template",""), mapfile)
+
+                h.dolock = int(get(virtual,"lock","0"))
+                h.profile = int(get(virtual,"profile","0"))
+                h.tararchive = int(get(virtual,"tararchive","0"))
+
+                h.run()
+                return
 
         def header(**map):
             yield tmpl("header", **map)

# revision id: jw+debian at jameswestby.net-20060830173717-61ab193c1fc5f957
# sha1: 7285b29614bda8b70f3cfbc108de420eb0875c02
# inventory sha1: 7961f32ee6711863fde4afebcb4c6a36392dcf46
# parent ids:
#   jw+debian at jameswestby.net-20060830172938-73f60671009f3f63
# base id: ghigo at venice-20060828201956-25d1dd11d4868aaa
# properties:
#   branch-nick: bazaar-webserve.fix.no.branch

# message:
#   Another attempt
# committer: James Westby <jw+debian at jameswestby.net>
# date: Wed 2006-08-30 18:29:38.460999966 +0100

=== modified file webserve/hgweb.py // encoding:base64
LS0tIHdlYnNlcnZlL2hnd2ViLnB5CisrKyB3ZWJzZXJ2ZS9oZ3dlYi5weQpAQCAtMTYyOCw2ICsx
NjI4LDcgQEAKICAgICAgICAgICAgICAgICByZWFsID0gc2VsZi5jcC5nZXQodmlydHVhbCwicGF0
aCIpCiAgICAgICAgICAgICBleGNlcHQgQ29uZmlnUGFyc2VyLk5vU2VjdGlvbkVycm9yOgogICAg
ICAgICAgICAgICAgIHZpcnR1YWwgPSAiIgorICAgICAgICAgICAgICAgIHJlYWwgPSBzZWxmLmNw
LmdldCh2aXJ0dWFsLCJwYXRoIikKIAogICAgICAgICAgICAgc3R5bGUgPSBnZXQodmlydHVhbCwi
c3R5bGUiLCIiKQogICAgICAgICAgICAgaWYgc3R5bGUgPT0gIiI6IG1hcGZpbGUgPSAibWFwIgoK

# revision id: jw+debian at jameswestby.net-20060830172938-73f60671009f3f63
# sha1: 29de2ad16276209894d8731f1bd1cc755efaeafc
# inventory sha1: 4245c8af78ff5eb3925a01a0ab220d51bd97bb3a
# parent ids:
#   jw+debian at jameswestby.net-20060830171844-f4c548e26bb90d71
# properties:
#   branch-nick: bazaar-webserve.fix.no.branch

# message:
#   Redirect to main page
# committer: James Westby <jw+debian at jameswestby.net>
# date: Wed 2006-08-30 18:18:44.694000006 +0100

=== modified file webserve/hgweb.py // encoding:base64
LS0tIHdlYnNlcnZlL2hnd2ViLnB5CisrKyB3ZWJzZXJ2ZS9oZ3dlYi5weQpAQCAtMTYyNyw4ICsx
NjI3LDcgQEAKICAgICAgICAgICAgIHRyeToKICAgICAgICAgICAgICAgICByZWFsID0gc2VsZi5j
cC5nZXQodmlydHVhbCwicGF0aCIpCiAgICAgICAgICAgICBleGNlcHQgQ29uZmlnUGFyc2VyLk5v
U2VjdGlvbkVycm9yOgotICAgICAgICAgICAgICAgIHNlbGYuc2VuZF9lcnJvciggNDA0LCAiVW5r
bm93biBicmFuY2ggW3BhdGg9JXNdXG4iJXBhdGgpCi0KKyAgICAgICAgICAgICAgICB2aXJ0dWFs
ID0gIiIKIAogICAgICAgICAgICAgc3R5bGUgPSBnZXQodmlydHVhbCwic3R5bGUiLCIiKQogICAg
ICAgICAgICAgaWYgc3R5bGUgPT0gIiI6IG1hcGZpbGUgPSAibWFwIgoK

# revision id: jw+debian at jameswestby.net-20060830171844-f4c548e26bb90d71
# sha1: 49bfd71f6a42121d2112e8ad7f62c396fd53fcd8
# inventory sha1: 0ef670984039a20febb7c47cbe32d693626b0655
# parent ids:
#   jw+debian at jameswestby.net-20060830171332-aa616812ae85566e
# properties:
#   branch-nick: bazaar-webserve.fix.no.branch

# message:
#   Use qualified class name
# committer: James Westby <jw+debian at jameswestby.net>
# date: Wed 2006-08-30 18:13:32.592000008 +0100

=== modified file webserve/hgweb.py // encoding:base64
LS0tIHdlYnNlcnZlL2hnd2ViLnB5CisrKyB3ZWJzZXJ2ZS9oZ3dlYi5weQpAQCAtMTYyNiw3ICsx
NjI2LDcgQEAKICAgICAgICAgaWYgdmlydHVhbDoKICAgICAgICAgICAgIHRyeToKICAgICAgICAg
ICAgICAgICByZWFsID0gc2VsZi5jcC5nZXQodmlydHVhbCwicGF0aCIpCi0gICAgICAgICAgICBl
eGNlcHQgTm9TZWN0aW9uRXJyb3I6CisgICAgICAgICAgICBleGNlcHQgQ29uZmlnUGFyc2VyLk5v
U2VjdGlvbkVycm9yOgogICAgICAgICAgICAgICAgIHNlbGYuc2VuZF9lcnJvciggNDA0LCAiVW5r
bm93biBicmFuY2ggW3BhdGg9JXNdXG4iJXBhdGgpCiAKIAoK

# revision id: jw+debian at jameswestby.net-20060830171332-aa616812ae85566e
# sha1: 3c09132f94272b97f78ec4b321614442a0d3ddbb
# inventory sha1: d199eb0d239b1c0a86e4c0c47c89fccb43f4771c
# parent ids:
#   jw+debian at jameswestby.net-20060830165822-646b62bc1829f5e6
# properties:
#   branch-nick: bazaar-webserve.fix.no.branch

# message:
#   Attempt to fix the traceback when unknown branch requested
# committer: James Westby <jw+debian at jameswestby.net>
# date: Wed 2006-08-30 17:58:22.177999973 +0100

=== modified file webserve/hgweb.py // encoding:base64
LS0tIHdlYnNlcnZlL2hnd2ViLnB5CisrKyB3ZWJzZXJ2ZS9oZ3dlYi5weQpAQCAtMTYyNCw3ICsx
NjI0LDExIEBACiAgICAgICAgICAgICB2aXJ0dWFsID0gIiIKIAogICAgICAgICBpZiB2aXJ0dWFs
OgotICAgICAgICAgICAgcmVhbCA9IHNlbGYuY3AuZ2V0KHZpcnR1YWwsInBhdGgiKQorICAgICAg
ICAgICAgdHJ5OgorICAgICAgICAgICAgICAgIHJlYWwgPSBzZWxmLmNwLmdldCh2aXJ0dWFsLCJw
YXRoIikKKyAgICAgICAgICAgIGV4Y2VwdCBOb1NlY3Rpb25FcnJvcjoKKyAgICAgICAgICAgICAg
ICBzZWxmLnNlbmRfZXJyb3IoIDQwNCwgIlVua25vd24gYnJhbmNoIFtwYXRoPSVzXVxuIiVwYXRo
KQorCiAKICAgICAgICAgICAgIHN0eWxlID0gZ2V0KHZpcnR1YWwsInN0eWxlIiwiIikKICAgICAg
ICAgICAgIGlmIHN0eWxlID09ICIiOiBtYXBmaWxlID0gIm1hcCIKCg==

# revision id: jw+debian at jameswestby.net-20060830165822-646b62bc1829f5e6
# sha1: ed3acb7c384e7499a9dba0f57537ac76f2fbe9dc
# inventory sha1: 9f7cd7a92d35e76901cc2e2be1e5290ecc56fb1a
# parent ids:
#   ghigo at venice-20060828201956-25d1dd11d4868aaa
# properties:
#   branch-nick: bazaar-webserve.fix.no.branch



More information about the bazaar mailing list