From baa8ef1884993f13f7608393eee56b180ceffb14 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 5 Mar 2009 13:41:10 +0100 Subject: strip trailing summary field from git URLs some packages have them in the vcs-browser field, some don't --- vcsbrowsers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3