##// END OF EJS Templates
pull-requests: fixed problems with unicode characters in branches.
milka -
r4681:7eba96a2 stable
parent child Browse files
Show More
@@ -311,6 +311,7 b' class BaseRepository(object):'
311 311 DEFAULT_CONTACT = u"Unknown"
312 312 DEFAULT_DESCRIPTION = u"unknown"
313 313 EMPTY_COMMIT_ID = '0' * 40
314 COMMIT_ID_PAT = re.compile(r'[0-9a-fA-F]{40}')
314 315
315 316 path = None
316 317
@@ -618,7 +618,7 b' class GitRepository(BaseRepository):'
618 618 else:
619 619 output, __ = self.run_git_command(
620 620 ['merge-base', commit_id1, commit_id2])
621 ancestor_id = re.findall(r'[0-9a-fA-F]{40}', output)[0]
621 ancestor_id = self.COMMIT_ID_PAT.findall(output)[0]
622 622
623 623 log.debug('Found common ancestor with sha: %s', ancestor_id)
624 624
@@ -642,7 +642,7 b' class GitRepository(BaseRepository):'
642 642 '%s..%s' % (commit_id1, commit_id2)])
643 643 commits = [
644 644 repo1.get_commit(commit_id=commit_id, pre_load=pre_load)
645 for commit_id in re.findall(r'[0-9a-fA-F]{40}', output)]
645 for commit_id in self.COMMIT_ID_PAT.findall(output)]
646 646
647 647 return commits
648 648
@@ -171,9 +171,9 b' data = {'
171 171 <tr>
172 172 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
173 173 <td style="line-height:20px;">
174 <code>${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)}</code> ${_('of')} ${data['source_repo_url']}
174 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
175 175 &rarr;
176 <code>${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)}</code> ${_('of')} ${data['target_repo_url']}
176 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
177 177 </td>
178 178 </tr>
179 179
@@ -124,9 +124,9 b' data = {'
124 124 <tr>
125 125 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
126 126 <td style="line-height:20px;">
127 <code>${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)}</code> ${_('of')} ${data['source_repo_url']}
127 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
128 128 &rarr;
129 <code>${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)}</code> ${_('of')} ${data['target_repo_url']}
129 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
130 130 </td>
131 131 </tr>
132 132
@@ -129,9 +129,9 b' data = {'
129 129 <tr>
130 130 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
131 131 <td style="line-height:20px;">
132 <code>${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)}</code> ${_('of')} ${data['source_repo_url']}
132 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
133 133 &rarr;
134 <code>${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)}</code> ${_('of')} ${data['target_repo_url']}
134 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
135 135 </td>
136 136 </tr>
137 137
@@ -143,9 +143,9 b''
143 143 ## pull url
144 144 <li>
145 145 %if h.is_hg(c.pull_request.source_repo):
146 <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
146 <% clone_url = u'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
147 147 %elif h.is_git(c.pull_request.source_repo):
148 <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
148 <% clone_url = u'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
149 149 %endif
150 150
151 151 <span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
General Comments 1
Under Review
author

Auto status change to "Under Review"

You need to be logged in to leave comments. Login now