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 = { ${_('Commit Flow')}: - ${'{}:{}'.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']} diff --git a/rhodecode/templates/email_templates/pull_request_review.mako b/rhodecode/templates/email_templates/pull_request_review.mako --- a/rhodecode/templates/email_templates/pull_request_review.mako +++ b/rhodecode/templates/email_templates/pull_request_review.mako @@ -124,9 +124,9 @@ data = { ${_('Commit Flow')}: - ${'{}:{}'.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']} diff --git a/rhodecode/templates/email_templates/pull_request_update.mako b/rhodecode/templates/email_templates/pull_request_update.mako --- a/rhodecode/templates/email_templates/pull_request_update.mako +++ b/rhodecode/templates/email_templates/pull_request_update.mako @@ -129,9 +129,9 @@ data = { ${_('Commit Flow')}: - ${'{}:{}'.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']} diff --git a/rhodecode/templates/pullrequests/pullrequest_show.mako b/rhodecode/templates/pullrequests/pullrequest_show.mako --- a/rhodecode/templates/pullrequests/pullrequest_show.mako +++ b/rhodecode/templates/pullrequests/pullrequest_show.mako @@ -143,9 +143,9 @@ ## pull url
  • %if h.is_hg(c.pull_request.source_repo): - <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> + <% clone_url = u'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> %elif h.is_git(c.pull_request.source_repo): - <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> + <% clone_url = u'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> %endif ${_('Pull changes from source')}: