diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-03-05 13:41:10 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-03-05 13:41:10 +0100 |
commit | baa8ef1884993f13f7608393eee56b180ceffb14 (patch) | |
tree | e7eafdd015703784008e36939d01774aff7f9198 /vcsbrowsers.py | |
parent | 706e7753b24c833c5214dbbfc1d70e380f6f4fdd (diff) |
strip trailing summary field from git URLs
some packages have them in the vcs-browser field, some don't
Diffstat (limited to 'vcsbrowsers.py')
-rw-r--r-- | vcsbrowsers.py | 8 |
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) |