aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido G√ľnther <agx@sigxcpu.org>2009-03-05 13:41:10 +0100
committerGuido G√ľnther <agx@sigxcpu.org>2009-03-05 13:41:10 +0100
commitbaa8ef1884993f13f7608393eee56b180ceffb14 (patch)
treee7eafdd015703784008e36939d01774aff7f9198
parent706e7753b24c833c5214dbbfc1d70e380f6f4fdd (diff)
strip trailing summary field from git URLs
some packages have them in the vcs-browser field, some don't
-rw-r--r--vcsbrowsers.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcsbrowsers.py b/vcsbrowsers.py
index 616b433..ea7931c 100644
--- a/vcsbrowsers.py
+++ b/vcsbrowsers.py
@@ -1,7 +1,9 @@
# convenience wrappers to construct links
# into the webinterfaces of different VCSs
-class VCSBrowser:
+import re
+
+class VCSBrowser(object):
def __init__(self, url):
self.url = url.rstrip('/')
@@ -17,6 +19,10 @@ class GitWebBrowser(VCSBrowser):
URLs for gitweb:
e.g. http://git.debian.org/?p=pkg-libvirt/gtk-vnc.git
"""
+ def __init__(self, url):
+ url = re.sub(r';a=summary$', '', url)
+ VCSBrowser.__init__(self, url)
+
def commit(self, commitid):
return "%s;a=commitdiff;h=%s" % (self.url, commitid)