diff --git a/rhodecode/lib/vcs/backends/base.py b/rhodecode/lib/vcs/backends/base.py --- a/rhodecode/lib/vcs/backends/base.py +++ b/rhodecode/lib/vcs/backends/base.py @@ -311,6 +311,7 @@ class BaseRepository(object): DEFAULT_CONTACT = u"Unknown" DEFAULT_DESCRIPTION = u"unknown" EMPTY_COMMIT_ID = '0' * 40 + COMMIT_ID_PAT = re.compile(r'[0-9a-fA-F]{40}') path = None diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -618,7 +618,7 @@ class GitRepository(BaseRepository): else: output, __ = self.run_git_command( ['merge-base', commit_id1, commit_id2]) - ancestor_id = re.findall(r'[0-9a-fA-F]{40}', output)[0] + ancestor_id = self.COMMIT_ID_PAT.findall(output)[0] log.debug('Found common ancestor with sha: %s', ancestor_id) @@ -642,7 +642,7 @@ class GitRepository(BaseRepository): '%s..%s' % (commit_id1, commit_id2)]) commits = [ repo1.get_commit(commit_id=commit_id, pre_load=pre_load) - for commit_id in re.findall(r'[0-9a-fA-F]{40}', output)] + for commit_id in self.COMMIT_ID_PAT.findall(output)] return commits diff --git a/rhodecode/templates/email_templates/pull_request_comment.mako b/rhodecode/templates/email_templates/pull_request_comment.mako --- a/rhodecode/templates/email_templates/pull_request_comment.mako +++ b/rhodecode/templates/email_templates/pull_request_comment.mako @@ -171,9 +171,9 @@ data = {
${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)}
${_('of')} ${data['source_repo_url']}
+ ${data['source_ref_type']}:${pull_request.source_ref_parts.name}
${_('of')} ${data['source_repo_url']}
→
- ${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)}
${_('of')} ${data['target_repo_url']}
+ ${data['target_ref_type']}:${pull_request.target_ref_parts.name}
${_('of')} ${data['target_repo_url']}
${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)}
${_('of')} ${data['source_repo_url']}
+ ${data['source_ref_type']}:${pull_request.source_ref_parts.name}
${_('of')} ${data['source_repo_url']}
→
- ${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)}
${_('of')} ${data['target_repo_url']}
+ ${data['target_ref_type']}:${pull_request.target_ref_parts.name}
${_('of')} ${data['target_repo_url']}
${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)}
${_('of')} ${data['source_repo_url']}
+ ${data['source_ref_type']}:${pull_request.source_ref_parts.name}
${_('of')} ${data['source_repo_url']}
→
- ${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)}
${_('of')} ${data['target_repo_url']}
+ ${data['target_ref_type']}:${pull_request.target_ref_parts.name}
${_('of')} ${data['target_repo_url']}