##// END OF EJS Templates
pull-requests: fixed problems with unicode characters in branches.
milka -
r4681:7eba96a2 stable
parent child
Show More
@@ -311,6 +311,7 class BaseRepository(object):
311 DEFAULT_CONTACT = u"Unknown"
311 DEFAULT_CONTACT = u"Unknown"
312 DEFAULT_DESCRIPTION = u"unknown"
312 DEFAULT_DESCRIPTION = u"unknown"
313 EMPTY_COMMIT_ID = '0' * 40
313 EMPTY_COMMIT_ID = '0' * 40
314 COMMIT_ID_PAT = re.compile(r'[0-9a-fA-F]{40}')
314
315
315 path = None
316 path = None
316
317
@@ -618,7 +618,7 class GitRepository(BaseRepository):
618 else:
618 else:
619 output, __ = self.run_git_command(
619 output, __ = self.run_git_command(
620 ['merge-base', commit_id1, commit_id2])
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 log.debug('Found common ancestor with sha: %s', ancestor_id)
623 log.debug('Found common ancestor with sha: %s', ancestor_id)
624
624
@@ -642,7 +642,7 class GitRepository(BaseRepository):
642 '%s..%s' % (commit_id1, commit_id2)])
642 '%s..%s' % (commit_id1, commit_id2)])
643 commits = [
643 commits = [
644 repo1.get_commit(commit_id=commit_id, pre_load=pre_load)
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 return commits
647 return commits
648
648
@@ -171,9 +171,9 data = {
171 <tr>
171 <tr>
172 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
172 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
173 <td style="line-height:20px;">
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 &rarr;
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 </td>
177 </td>
178 </tr>
178 </tr>
179
179
@@ -124,9 +124,9 data = {
124 <tr>
124 <tr>
125 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
125 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
126 <td style="line-height:20px;">
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 &rarr;
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 </td>
130 </td>
131 </tr>
131 </tr>
132
132
@@ -129,9 +129,9 data = {
129 <tr>
129 <tr>
130 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
130 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
131 <td style="line-height:20px;">
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 &rarr;
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 </td>
135 </td>
136 </tr>
136 </tr>
137
137
@@ -143,9 +143,9
143 ## pull url
143 ## pull url
144 <li>
144 <li>
145 %if h.is_hg(c.pull_request.source_repo):
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 %elif h.is_git(c.pull_request.source_repo):
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 %endif
149 %endif
150
150
151 <span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
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