##// END OF EJS Templates
#518 multiple issues patterns...
marcink -
r2866:736678a8 beta
parent child Browse files
Show More
@@ -26,3 +26,4 b' List of contributors to RhodeCode projec'
26 Dominik Ruf <dominikruf@gmail.com>
26 Dominik Ruf <dominikruf@gmail.com>
27 xpol <xpolife@gmail.com>
27 xpol <xpolife@gmail.com>
28 Vincent Caron <vcaron@bearstech.com>
28 Vincent Caron <vcaron@bearstech.com>
29 Zachary Auclair <zach101@gmail.com> No newline at end of file
@@ -108,6 +108,16 b' issue_server_link = https://myissueserve'
108
108
109 issue_prefix = #
109 issue_prefix = #
110
110
111 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
112 ## multiple patterns, to other issues server, wiki or others
113 ## below an example how to create a wiki pattern
114 # #wiki-some-id -> https://mywiki.com/some-id
115
116 #issue_pat_wiki = (?:wiki-)(.+)
117 #issue_server_link_wiki = https://mywiki.com/{id}
118 #issue_prefix_wiki = WIKI-
119
120
111 ## instance-id prefix
121 ## instance-id prefix
112 ## a prefix key for this instance used for cache invalidation when running
122 ## a prefix key for this instance used for cache invalidation when running
113 ## multiple instances of rhodecode, make sure it's globally unique for
123 ## multiple instances of rhodecode, make sure it's globally unique for
@@ -16,6 +16,7 b' news'
16
16
17 - #558 Added config file to hooks extra data
17 - #558 Added config file to hooks extra data
18 - bumbped mercurial version to 2.3.1
18 - bumbped mercurial version to 2.3.1
19 - #518 added possibility of specifing multiple patterns for issues
19
20
20 fixes
21 fixes
21 +++++
22 +++++
@@ -108,6 +108,16 b' issue_server_link = https://myissueserve'
108
108
109 issue_prefix = #
109 issue_prefix = #
110
110
111 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
112 ## multiple patterns, to other issues server, wiki or others
113 ## below an example how to create a wiki pattern
114 # #wiki-some-id -> https://mywiki.com/some-id
115
116 #issue_pat_wiki = (?:wiki-)(.+)
117 #issue_server_link_wiki = https://mywiki.com/{id}
118 #issue_prefix_wiki = WIKI-
119
120
111 ## instance-id prefix
121 ## instance-id prefix
112 ## a prefix key for this instance used for cache invalidation when running
122 ## a prefix key for this instance used for cache invalidation when running
113 ## multiple instances of rhodecode, make sure it's globally unique for
123 ## multiple instances of rhodecode, make sure it's globally unique for
@@ -108,6 +108,16 b' issue_server_link = https://myissueserve'
108
108
109 issue_prefix = #
109 issue_prefix = #
110
110
111 ## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
112 ## multiple patterns, to other issues server, wiki or others
113 ## below an example how to create a wiki pattern
114 # #wiki-some-id -> https://mywiki.com/some-id
115
116 #issue_pat_wiki = (?:wiki-)(.+)
117 #issue_server_link_wiki = https://mywiki.com/{id}
118 #issue_prefix_wiki = WIKI-
119
120
111 ## instance-id prefix
121 ## instance-id prefix
112 ## a prefix key for this instance used for cache invalidation when running
122 ## a prefix key for this instance used for cache invalidation when running
113 ## multiple instances of rhodecode, make sure it's globally unique for
123 ## multiple instances of rhodecode, make sure it's globally unique for
@@ -1007,19 +1007,23 b' def urlify_commit(text_, repository=None'
1007
1007
1008 # allow multiple issue servers to be used
1008 # allow multiple issue servers to be used
1009 valid_indices = [
1009 valid_indices = [
1010 x.group(1)
1010 x.group(1)
1011 for x in map(lambda x: re.match(r'issue_pat(.*)', x), conf.keys())
1011 for x in map(lambda x: re.match(r'issue_pat(.*)', x), conf.keys())
1012 if x and conf.has_key('issue_server_link'+x.group(1)) and conf.has_key('issue_prefix'+x.group(1))
1012 if x and 'issue_server_link%s' % x.group(1) in conf
1013 ]
1013 and 'issue_prefix%s' % x.group(1) in conf
1014 ]
1014
1015
1015 #log.debug('found issue server suffixes ' + ','.join(valid_indices) + ' during valuation of: \n' + newtext)
1016 log.debug('found issue server suffixes `%s` during valuation of: %s'
1017 % (','.join(valid_indices), newtext))
1016
1018
1017 for pattern_index in valid_indices:
1019 for pattern_index in valid_indices:
1018 ISSUE_PATTERN = conf.get('issue_pat'+pattern_index)
1020 ISSUE_PATTERN = conf.get('issue_pat%s' % pattern_index)
1019 ISSUE_SERVER_LNK = conf.get('issue_server_link'+pattern_index)
1021 ISSUE_SERVER_LNK = conf.get('issue_server_link%s' % pattern_index)
1020 ISSUE_PREFIX = conf.get('issue_prefix'+pattern_index)
1022 ISSUE_PREFIX = conf.get('issue_prefix%s' % pattern_index)
1021
1023
1022 #log.debug(ISSUE_PATTERN + ' ' + ISSUE_SERVER_LNK + ' ' + ISSUE_PREFIX)
1024 log.debug('pattern suffix `%s` PAT:%s SERVER_LINK:%s PREFIX:%s'
1025 % (pattern_index, ISSUE_PATTERN, ISSUE_SERVER_LNK,
1026 ISSUE_PREFIX))
1023
1027
1024 URL_PAT = re.compile(r'%s' % ISSUE_PATTERN)
1028 URL_PAT = re.compile(r'%s' % ISSUE_PATTERN)
1025
1029
@@ -1048,9 +1052,8 b' def urlify_commit(text_, repository=None'
1048 'issue-prefix': ISSUE_PREFIX,
1052 'issue-prefix': ISSUE_PREFIX,
1049 'serv': ISSUE_SERVER_LNK,
1053 'serv': ISSUE_SERVER_LNK,
1050 }
1054 }
1051
1052 newtext = URL_PAT.sub(url_func, newtext)
1055 newtext = URL_PAT.sub(url_func, newtext)
1053 #log.debug('after '+pattern_index+':\n'+newtext)
1056 log.debug('processed prefix:`%s` => %s' % (pattern_index, newtext))
1054
1057
1055 # if we actually did something above
1058 # if we actually did something above
1056 if valid_indices:
1059 if valid_indices:
General Comments 0
You need to be logged in to leave comments. Login now