##// END OF EJS Templates
pull-requests: handle non-ascii branches from short branch selector via URL
marcink -
r3504:7963a3f6 stable
parent child Browse files
Show More
@@ -1420,8 +1420,8 b' class PullRequestModel(BaseModel):'
1420 _ = translator or get_current_request().translate
1420 _ = translator or get_current_request().translate
1421
1421
1422 commit_id = safe_str(commit_id) if commit_id else None
1422 commit_id = safe_str(commit_id) if commit_id else None
1423 branch = safe_str(branch) if branch else None
1423 branch = safe_unicode(branch) if branch else None
1424 bookmark = safe_str(bookmark) if bookmark else None
1424 bookmark = safe_unicode(bookmark) if bookmark else None
1425
1425
1426 selected = None
1426 selected = None
1427
1427
@@ -1439,10 +1439,11 b' class PullRequestModel(BaseModel):'
1439 )
1439 )
1440
1440
1441 groups = []
1441 groups = []
1442
1442 for group_key, ref_list, group_name, match in sources:
1443 for group_key, ref_list, group_name, match in sources:
1443 group_refs = []
1444 group_refs = []
1444 for ref_name, ref_id in ref_list:
1445 for ref_name, ref_id in ref_list:
1445 ref_key = '%s:%s:%s' % (group_key, ref_name, ref_id)
1446 ref_key = u'{}:{}:{}'.format(group_key, ref_name, ref_id)
1446 group_refs.append((ref_key, ref_name))
1447 group_refs.append((ref_key, ref_name))
1447
1448
1448 if not selected:
1449 if not selected:
@@ -1456,11 +1457,11 b' class PullRequestModel(BaseModel):'
1456 ref = commit_id or branch or bookmark
1457 ref = commit_id or branch or bookmark
1457 if ref:
1458 if ref:
1458 raise CommitDoesNotExistError(
1459 raise CommitDoesNotExistError(
1459 'No commit refs could be found matching: %s' % ref)
1460 u'No commit refs could be found matching: {}'.format(ref))
1460 elif repo.DEFAULT_BRANCH_NAME in repo.branches:
1461 elif repo.DEFAULT_BRANCH_NAME in repo.branches:
1461 selected = 'branch:%s:%s' % (
1462 selected = u'branch:{}:{}'.format(
1462 repo.DEFAULT_BRANCH_NAME,
1463 safe_unicode(repo.DEFAULT_BRANCH_NAME),
1463 repo.branches[repo.DEFAULT_BRANCH_NAME]
1464 safe_unicode(repo.branches[repo.DEFAULT_BRANCH_NAME])
1464 )
1465 )
1465 elif repo.commit_ids:
1466 elif repo.commit_ids:
1466 # make the user select in this case
1467 # make the user select in this case
General Comments 0
You need to be logged in to leave comments. Login now