[bts-link] 01/01: Don't truncate bug URLs

Olivier Berger obergix at moszumanska.debian.org
Wed Oct 14 16:26:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

obergix pushed a commit to branch allura
in repository bts-link.

commit 90c75a01fabbb57c79af0b4c27034f3cae3b58e7
Author: Olivier Berger <olivier.berger at telecom-sudparis.eu>
Date:   Wed Oct 14 18:26:03 2015 +0200

    Don't truncate bug URLs
---
 remote/sourceforge.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/remote/sourceforge.py b/remote/sourceforge.py
index 491bf97..c5e545a 100644
--- a/remote/sourceforge.py
+++ b/remote/sourceforge.py
@@ -203,10 +203,21 @@ class RemoteSourceForgeTrackerTwo(RemoteSourceForge):
 class RemoteAlluraTracker(RemoteBts):
     def __init__(self, cnf):
         
-        bugre  = r'^%(uri)s/([0-9]+)$'
-        urifmt = '%(uri)s/%(id)s'
-        RemoteBts.__init__(self, cnf, bugre, urifmt, AlluraTrackerData)
+        RemoteBts.__init__(self, cnf, None, None, AlluraTrackerData)
 
+    # override base class method to extract the ID as useful as for _getUri
+    def extractBugid(self, uri):
+        bugre = re.compile(r"https?://sourceforge.net/p/(?P<project>.*)/(?P<type>.*)/(?P<id>[0-9]+)/?$")
+        res = bugre.match(uri)
+        if res:
+            return res.groupdict()
+        else:
+            return None
+
+    # return a meaningful uri
+    def _getUri(self, bugId):
+        return "http://sourceforge.net/p/%(project)s/%(type)s/%(id)s/" % bugId
+    
     def isClosing(self, status, resolution):
         return status == 'Closed' and resolution != 'Wont-Fix'
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bts-link/bts-link.git



More information about the bts-link-commits mailing list