@@ -58,14 +58,35 @@ container_auth_enabled = false
proxypass_auth_enabled = false
## overwrite schema of clone url
# available vars:
# scheme - http/https
# user - current user
# pass - password
# netloc - network location
# path - usually repo_name
## available vars:
## scheme - http/https
## user - current user
## pass - password
## netloc - network location
## path - usually repo_name
# clone_uri = {scheme}://{user}{pass}{netloc}{path}
## issue tracking mapping for commits messages
## uncomment url_pat, issue_server, issue_prefix to enable
## pattern to get the issues from commit messages
## default one used here is #1234
#url_pat = (?:^#|\s#)(\w+)
## server url to the issue, each {id} will be replaced with id
## fetched from the regex
#issue_server = https://myissueserver.com/issue/{id}
## prefix to add to link to indicate it's an url
## #314 will be replaced by <issue_prefix><id>
#issue_prefix = #
####################################
### CELERY CONFIG ####
@@ -8,6 +8,7 @@ import hashlib
import StringIO
import urllib
import math
import logging
from datetime import datetime
from pygments.formatters.html import HtmlFormatter
@@ -41,6 +42,8 @@ from rhodecode.lib.utils import repo_nam
from rhodecode.lib import str2bool, safe_unicode, safe_str, get_changeset_safe
from rhodecode.lib.markup_renderer import MarkupRenderer
log = logging.getLogger(__name__)
def _reset(name, value=None, id=NotGiven, type="reset", **attrs):
"""
@@ -740,6 +743,33 @@ def urlify_text(text):
return literal(url_pat.sub(url_func, text))
def urlify_commit(text):
import re
import traceback
try:
conf = config['app_conf']
URL_PAT = re.compile(r'%s' % conf.get('url_pat'))
if URL_PAT:
ISSUE_SERVER = conf.get('issue_server')
ISSUE_PREFIX = conf.get('issue_prefix')
def url_func(match_obj):
issue_id = match_obj.groups()[0]
return ' <a href="%(url)s">%(issue-prefix)s%(id-repr)s</a>' % (
{'url':ISSUE_SERVER.replace('{id}',issue_id),
'id-repr':issue_id,
'issue-prefix':ISSUE_PREFIX,
'serv':ISSUE_SERVER,
}
)
return literal(URL_PAT.sub(url_func, text))
except:
log.error(traceback.format_exc())
pass
return text
def rst(source):
return literal('<div class="rst-block">%s</div>' %
@@ -2146,8 +2146,6 @@ h3.files_location {
#changeset_content .container .left .message {
font-style: italic;
color: #556CB5;
white-space: pre-wrap;
#changeset_content .container .left .message a:hover {
@@ -48,7 +48,7 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
<div class="left">
<div class="date">
${h.checkbox(cs.short_id,class_="changeset_range")}
<span>${_('commit')} ${cs.revision}: ${h.short_id(cs.raw_id)}@${cs.date}</span>
<span class="tooltip" title="${cs.date}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">${cs.revision}:${h.short_id(cs.raw_id)}</a></span>
</div>
<div class="author">
<div class="gravatar">
@@ -56,7 +56,7 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
<div title="${cs.author}" class="user">${h.person(cs.author)}</div>
<div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
<div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message))}</div>
<div class="right">
<div id="${cs.raw_id}_changes_info" class="changes">
@@ -52,7 +52,7 @@
<span>${h.person(c.changeset.author)}</span><br/>
<span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
<div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</div>
<div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message))}</div>
<div class="changes">
@@ -41,7 +41,7 @@
<td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</td>
<td><div class="author">${h.person(cs.author)}</div></td>
<td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
<td><div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div></td>
<td><div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message))}</div></td>
</tr>
%endfor
</table>
@@ -2,16 +2,19 @@
%if c.repo_changesets:
<table class="table_disp">
<tr>
<th class="left">${_('revision')}</th>
<th class="left">${_('commit message')}</th>
<th class="left">${_('age')}</th>
<th class="left">${_('author')}</th>
<th class="left">${_('branch')}</th>
<th class="left">${_('tags')}</th>
%for cnt,cs in enumerate(c.repo_changesets):
<tr class="parity${cnt%2}">
<td>
<div><pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">r${cs.revision}:${h.short_id(cs.raw_id)}</a></pre></div>
</td>
${h.link_to(h.truncate(cs.message,50),
h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id),
title=cs.message)}
@@ -20,7 +23,6 @@
${h.age(cs.date)}</span>
<td title="${cs.author}">${h.person(cs.author)}</td>
<td><div><pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">r${cs.revision}:${h.short_id(cs.raw_id)}</a></pre></div></td>
<span class="logtags">
<span class="branchtag">${cs.branch}</span>
Status change: