Changeset - 79b3c9c66c54
[Not reviewed]
beta
0 5 0
Marcin Kuzminski - 13 years ago 2012-05-25 18:59:15
marcin@python-works.com
Added optional repo_name into issue tracker url to get just the name of repo without group prefix
5 files changed with 16 insertions and 8 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -46,6 +46,8 @@ port = 5000
 
use = egg:rhodecode
 
full_stack = true
 
static_files = true
 
# Optional Languages
 
# en, fr, pt_BR, zh_CN, zh_TW
 
lang = en
 
cache_dir = %(here)s/data
 
index_dir = %(here)s/data/index
 
@@ -78,7 +80,8 @@ default_encoding = utf8
 
issue_pat = (?:\s*#)(\d+)
 

	
 
## server url to the issue, each {id} will be replaced with match
 
## fetched from the regex and {repo} is replaced with repository name
 
## fetched from the regex and {repo} is replaced with full repository name
 
## including groups {repo_name} is replaced with just name of repo
 

	
 
issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 

	
production.ini
Show inline comments
 
@@ -46,6 +46,8 @@ port = 8001
 
use = egg:rhodecode
 
full_stack = true
 
static_files = true
 
# Optional Languages
 
# en, fr, pt_BR, zh_CN, zh_TW
 
lang = en
 
cache_dir = %(here)s/data
 
index_dir = %(here)s/data/index
 
@@ -78,7 +80,8 @@ default_encoding = utf8
 
issue_pat = (?:\s*#)(\d+)
 

	
 
## server url to the issue, each {id} will be replaced with match
 
## fetched from the regex and {repo} is replaced with repository name
 
## fetched from the regex and {repo} is replaced with full repository name
 
## including groups {repo_name} is replaced with just name of repo
 

	
 
issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 

	
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -80,7 +80,8 @@ default_encoding = utf8
 
issue_pat = (?:\s*#)(\d+)
 

	
 
## server url to the issue, each {id} will be replaced with match
 
## fetched from the regex and {repo} is replaced with repository name
 
## fetched from the regex and {repo} is replaced with full repository name
 
## including groups {repo_name} is replaced with just name of repo
 

	
 
issue_server_link = https://myissueserver.com/{repo}/issue/{id}
 

	
rhodecode/lib/helpers.py
Show inline comments
 
@@ -44,6 +44,7 @@ from rhodecode.lib.utils2 import str2boo
 
from rhodecode.lib.markup_renderer import MarkupRenderer
 
from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError
 
from rhodecode.lib.vcs.backends.base import BaseChangeset
 
from rhodecode.model.db import URL_SEP
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -885,7 +886,6 @@ def urlify_commit(text_, repository=None
 

	
 
        return ''.join(links)
 

	
 

	
 
    # urlify changesets - extrac revisions and make link out of them
 
    text_ = urlify_changesets(escaper(text_), repository)
 

	
 
@@ -912,7 +912,8 @@ def urlify_commit(text_, repository=None
 
                url = ISSUE_SERVER_LNK.replace('{id}', issue_id)
 
                if repository:
 
                    url = url.replace('{repo}', repository)
 

	
 
                    repo_name = repository.split(URL_SEP)[-1]
 
                    url = url.replace('{repo_name}', repo_name)
 
                return tmpl % {
 
                     'pref': pref,
 
                     'cls': 'issue-tracker-link',
rhodecode/model/db.py
Show inline comments
 
@@ -47,7 +47,7 @@ from rhodecode.lib.caching_query import 
 
from rhodecode.model.meta import Base, Session
 
import hashlib
 

	
 

	
 
URL_SEP = '/'
 
log = logging.getLogger(__name__)
 

	
 
#==============================================================================
 
@@ -523,7 +523,7 @@ class Repository(Base, BaseModel):
 

	
 
    @classmethod
 
    def url_sep(cls):
 
        return '/'
 
        return URL_SEP
 

	
 
    @classmethod
 
    def get_by_repo_name(cls, repo_name):
 
@@ -776,7 +776,7 @@ class RepoGroup(Base, BaseModel):
 

	
 
    @classmethod
 
    def url_sep(cls):
 
        return '/'
 
        return URL_SEP
 

	
 
    @classmethod
 
    def get_by_group_name(cls, group_name, cache=False, case_insensitive=False):
0 comments (0 inline, 0 general)