diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py
--- a/rhodecode/lib/helpers.py
+++ b/rhodecode/lib/helpers.py
@@ -1522,7 +1522,10 @@ def process_patterns(text_string, repo_n
raise ValueError('Link format can be only one of:{} got {}'.format(
allowed_formats, link_format))
- active_entries = active_entries or get_active_pattern_entries(repo_name)
+ if active_entries is None:
+ log.debug('Fetch active patterns for repo: %s', repo_name)
+ active_entries = get_active_pattern_entries(repo_name)
+
issues_data = []
new_text = text_string
@@ -1580,6 +1583,7 @@ def urlify_commit_message(commit_text, r
Parses given text message and makes proper links.
issues are linked to given issue-server, and rest is a commit link
"""
+
def escaper(_text):
return _text.replace('<', '<').replace('>', '>')
@@ -1636,7 +1640,7 @@ def renderer_from_filename(filename, exc
def render(source, renderer='rst', mentions=False, relative_urls=None,
- repo_name=None):
+ repo_name=None, active_pattern_entries=None):
def maybe_convert_relative_links(html_source):
if relative_urls:
@@ -1651,7 +1655,8 @@ def render(source, renderer='rst', menti
if repo_name:
# process patterns on comments if we pass in repo name
source, issues = process_patterns(
- source, repo_name, link_format='rst')
+ source, repo_name, link_format='rst',
+ active_entries=active_pattern_entries)
return literal(
'
%s
' %
@@ -1662,7 +1667,8 @@ def render(source, renderer='rst', menti
if repo_name:
# process patterns on comments if we pass in repo name
source, issues = process_patterns(
- source, repo_name, link_format='markdown')
+ source, repo_name, link_format='markdown',
+ active_entries=active_pattern_entries)
return literal(
'%s
' %
diff --git a/rhodecode/templates/changeset/changeset_file_comment.mako b/rhodecode/templates/changeset/changeset_file_comment.mako
--- a/rhodecode/templates/changeset/changeset_file_comment.mako
+++ b/rhodecode/templates/changeset/changeset_file_comment.mako
@@ -5,7 +5,7 @@
##
<%namespace name="base" file="/base/base.mako"/>
-<%def name="comment_block(comment, inline=False)">
+<%def name="comment_block(comment, inline=False, active_pattern_entries=None)">
<% pr_index_ver = comment.get_index_version(getattr(c, 'versions', [])) %>
<% latest_ver = len(getattr(c, 'versions', [])) %>
% if inline:
@@ -156,7 +156,7 @@
- ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None))}
+ ${h.render(comment.text, renderer=comment.renderer, mentions=True, repo_name=getattr(c, 'repo_name', None), active_pattern_entries=active_pattern_entries)}
@@ -164,13 +164,17 @@
## generate main comments
<%def name="generate_comments(comments, include_pull_request=False, is_pull_request=False)">
+ <%
+ active_pattern_entries = h.get_active_pattern_entries(getattr(c, 'repo_name', None))
+ %>
+