changeset 1933:3da456a3a211 beta

changed default issue tracker links pattern
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 21 Jan 2012 00:55:09 +0200
parents 1cf94aadabdc
children af1fafcd5927
files development.ini production.ini rhodecode/config/deployment.ini_tmpl rhodecode/lib/helpers.py
diffstat 4 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Fri Jan 20 23:31:05 2012 +0200
+++ b/development.ini	Sat Jan 21 00:55:09 2012 +0200
@@ -68,15 +68,15 @@
 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
 
 ## issue tracking mapping for commits messages
-## uncomment url_pat, issue_server, issue_prefix to enable
-
+## comment out issue_pat, issue_server, issue_prefix to enable
 
 ## pattern to get the issues from commit messages
-## default one used here is #1234
+## default one used here is #<numbers> with a regex passive group for `#`
+## {id} will be all groups matched from this pattern
 
-url_pat = (?:^#|\s#)(\w+)
+issue_pat = (?:\s*#)(\d+)
 
-## server url to the issue, each {id} will be replaced with id
+## server url to the issue, each {id} will be replaced with match
 ## fetched from the regex and {repo} is replaced with repository name
 
 issue_server_link = https://myissueserver.com/{repo}/issue/{id}
--- a/production.ini	Fri Jan 20 23:31:05 2012 +0200
+++ b/production.ini	Sat Jan 21 00:55:09 2012 +0200
@@ -68,23 +68,23 @@
 #clone_uri = {scheme}://{user}{pass}{netloc}{path}
 
 ## issue tracking mapping for commits messages
-## uncomment url_pat, issue_server, issue_prefix to enable
-
+## comment out issue_pat, issue_server, issue_prefix to enable
 
 ## pattern to get the issues from commit messages
-## default one used here is #1234
+## default one used here is #<numbers> with a regex passive group for `#`
+## {id} will be all groups matched from this pattern
 
-#url_pat = (?:^#|\s#)(\w+)
+issue_pat = (?:\s*#)(\d+)
 
-## server url to the issue, each {id} will be replaced with id
+## server url to the issue, each {id} will be replaced with match
 ## fetched from the regex and {repo} is replaced with repository name
 
-#issue_server_link = https://myissueserver.com/{repo}/issue/{id}
+issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 
 ## prefix to add to link to indicate it's an url
 ## #314 will be replaced by <issue_prefix><id>
 
-#issue_prefix = #
+issue_prefix = #
 
 
 ####################################
--- a/rhodecode/config/deployment.ini_tmpl	Fri Jan 20 23:31:05 2012 +0200
+++ b/rhodecode/config/deployment.ini_tmpl	Sat Jan 21 00:55:09 2012 +0200
@@ -68,23 +68,23 @@
 # clone_uri = {scheme}://{user}{pass}{netloc}{path}
 
 ## issue tracking mapping for commits messages
-## uncomment url_pat, issue_server, issue_prefix to enable
-
+## comment out issue_pat, issue_server, issue_prefix to enable
 
 ## pattern to get the issues from commit messages
-## default one used here is #1234
+## default one used here is #<numbers> with a regex passive group for `#`
+## {id} will be all groups matched from this pattern
 
-#url_pat = (?:^#|\s#)(\w+)
+issue_pat = (?:\s*#)(\d+)
 
-## server url to the issue, each {id} will be replaced with id
+## server url to the issue, each {id} will be replaced with match
 ## fetched from the regex and {repo} is replaced with repository name
 
-#issue_server_link = https://myissueserver.com/{repo}/issue/{id}
+issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 
 ## prefix to add to link to indicate it's an url
 ## #314 will be replaced by <issue_prefix><id>
 
-#issue_prefix = #
+issue_prefix = #
 
 
 ####################################
--- a/rhodecode/lib/helpers.py	Fri Jan 20 23:31:05 2012 +0200
+++ b/rhodecode/lib/helpers.py	Sat Jan 21 00:55:09 2012 +0200
@@ -788,7 +788,7 @@
     try:
         conf = config['app_conf']
 
-        URL_PAT = re.compile(r'%s' % conf.get('url_pat'))
+        URL_PAT = re.compile(r'%s' % conf.get('issue_pat'))
 
         if URL_PAT:
             ISSUE_SERVER_LNK = conf.get('issue_server_link')
@@ -799,7 +799,7 @@
                 if match_obj.group().startswith(' '):
                     pref = ' '
 
-                issue_id = match_obj.groups()[0]
+                issue_id = ''.join(match_obj.groups())
                 tmpl = (
                 '%(pref)s<a class="%(cls)s" href="%(url)s">'
                 '%(issue-prefix)s%(id-repr)s'