Show More
The requested changes are too big and content was truncated. Show full diff
@@ -0,0 +1,42 b'' | |||
|
1 | |RCE| 4.20.1 |RNS| | |
|
2 | ------------------ | |
|
3 | ||
|
4 | Release Date | |
|
5 | ^^^^^^^^^^^^ | |
|
6 | ||
|
7 | - 2020-07-27 | |
|
8 | ||
|
9 | ||
|
10 | New Features | |
|
11 | ^^^^^^^^^^^^ | |
|
12 | ||
|
13 | ||
|
14 | ||
|
15 | General | |
|
16 | ^^^^^^^ | |
|
17 | ||
|
18 | - Permissions: rename write+ to write or higher for more explicit meaning. | |
|
19 | ||
|
20 | ||
|
21 | Security | |
|
22 | ^^^^^^^^ | |
|
23 | ||
|
24 | ||
|
25 | ||
|
26 | Performance | |
|
27 | ^^^^^^^^^^^ | |
|
28 | ||
|
29 | ||
|
30 | ||
|
31 | Fixes | |
|
32 | ^^^^^ | |
|
33 | ||
|
34 | - Files: fixed creation of new files for empty repos. | |
|
35 | - Notifications: properly inject the custom email headers into templates. | |
|
36 | - Store file integration: fixed support for nested subdirs. | |
|
37 | ||
|
38 | ||
|
39 | Upgrade notes | |
|
40 | ^^^^^^^^^^^^^ | |
|
41 | ||
|
42 | - Un-scheduled release addressing problems in 4.20.X releases. |
@@ -66,3 +66,5 b' ddef396a6567117de531d67d44c739cbbfc3eebb' | |||
|
66 | 66 | c0c65acd73914bf4368222d510afe1161ab8c07c v4.19.1 |
|
67 | 67 | 7ac623a4a2405917e2af660d645ded662011e40d v4.19.2 |
|
68 | 68 | ef7ffda65eeb90c3ba88590a6cb816ef9b0bc232 v4.19.3 |
|
69 | 3e635489bb7961df93b01e42454ad1a8730ae968 v4.20.0 | |
|
70 | 7e2eb896a02ca7cd2cd9f0f853ef3dac3f0039e3 v4.20.1 |
@@ -9,6 +9,7 b' Release Notes' | |||
|
9 | 9 | .. toctree:: |
|
10 | 10 | :maxdepth: 1 |
|
11 | 11 | |
|
12 | release-notes-4.20.1.rst | |
|
12 | 13 | release-notes-4.20.0.rst |
|
13 | 14 | release-notes-4.19.3.rst |
|
14 | 15 | release-notes-4.19.2.rst |
@@ -211,7 +211,7 b' class RepoFilesView(RepoAppView):' | |||
|
211 | 211 | |
|
212 | 212 | return file_node |
|
213 | 213 | |
|
214 | def _is_valid_head(self, commit_id, repo): | |
|
214 | def _is_valid_head(self, commit_id, repo, landing_ref): | |
|
215 | 215 | branch_name = sha_commit_id = '' |
|
216 | 216 | is_head = False |
|
217 | 217 | log.debug('Checking if commit_id `%s` is a head for %s.', commit_id, repo) |
@@ -237,7 +237,11 b' class RepoFilesView(RepoAppView):' | |||
|
237 | 237 | return branch_name, sha_commit_id, is_head |
|
238 | 238 | |
|
239 | 239 | # checked branches, means we only need to try to get the branch/commit_sha |
|
240 |
if |
|
|
240 | if repo.is_empty(): | |
|
241 | is_head = True | |
|
242 | branch_name = landing_ref | |
|
243 | sha_commit_id = EmptyCommit().raw_id | |
|
244 | else: | |
|
241 | 245 | commit = repo.get_commit(commit_id=commit_id) |
|
242 | 246 | if commit: |
|
243 | 247 | branch_name = commit.branch |
@@ -696,8 +700,9 b' class RepoFilesView(RepoAppView):' | |||
|
696 | 700 | if not c.renderer: |
|
697 | 701 | c.lines = filenode_as_lines_tokens(c.file) |
|
698 | 702 | |
|
699 |
_branch_name, _sha_commit_id, is_head = |
|
|
700 |
commit_id, self.rhodecode_vcs_repo |
|
|
703 | _branch_name, _sha_commit_id, is_head = \ | |
|
704 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
705 | landing_ref=self.db_repo.landing_ref_name) | |
|
701 | 706 | c.on_branch_head = is_head |
|
702 | 707 | |
|
703 | 708 | branch = c.commit.branch if ( |
@@ -1135,7 +1140,8 b' class RepoFilesView(RepoAppView):' | |||
|
1135 | 1140 | |
|
1136 | 1141 | commit_id, f_path = self._get_commit_and_path() |
|
1137 | 1142 | _branch_name, _sha_commit_id, is_head = \ |
|
1138 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1143 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1144 | landing_ref=self.db_repo.landing_ref_name) | |
|
1139 | 1145 | |
|
1140 | 1146 | new_path = self.request.POST.get('path') |
|
1141 | 1147 | operation = self.request.POST.get('operation') |
@@ -1173,7 +1179,8 b' class RepoFilesView(RepoAppView):' | |||
|
1173 | 1179 | |
|
1174 | 1180 | self._ensure_not_locked() |
|
1175 | 1181 | _branch_name, _sha_commit_id, is_head = \ |
|
1176 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1182 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1183 | landing_ref=self.db_repo.landing_ref_name) | |
|
1177 | 1184 | |
|
1178 | 1185 | self.forbid_non_head(is_head, f_path) |
|
1179 | 1186 | self.check_branch_permission(_branch_name) |
@@ -1201,7 +1208,8 b' class RepoFilesView(RepoAppView):' | |||
|
1201 | 1208 | |
|
1202 | 1209 | self._ensure_not_locked() |
|
1203 | 1210 | _branch_name, _sha_commit_id, is_head = \ |
|
1204 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1211 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1212 | landing_ref=self.db_repo.landing_ref_name) | |
|
1205 | 1213 | |
|
1206 | 1214 | self.forbid_non_head(is_head, f_path) |
|
1207 | 1215 | self.check_branch_permission(_branch_name) |
@@ -1251,7 +1259,8 b' class RepoFilesView(RepoAppView):' | |||
|
1251 | 1259 | |
|
1252 | 1260 | self._ensure_not_locked() |
|
1253 | 1261 | _branch_name, _sha_commit_id, is_head = \ |
|
1254 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1262 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1263 | landing_ref=self.db_repo.landing_ref_name) | |
|
1255 | 1264 | |
|
1256 | 1265 | self.forbid_non_head(is_head, f_path, commit_id=commit_id) |
|
1257 | 1266 | self.check_branch_permission(_branch_name, commit_id=commit_id) |
@@ -1292,7 +1301,8 b' class RepoFilesView(RepoAppView):' | |||
|
1292 | 1301 | commit_id=c.commit.raw_id, f_path=f_path)) |
|
1293 | 1302 | |
|
1294 | 1303 | _branch_name, _sha_commit_id, is_head = \ |
|
1295 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1304 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1305 | landing_ref=self.db_repo.landing_ref_name) | |
|
1296 | 1306 | |
|
1297 | 1307 | self.forbid_non_head(is_head, f_path, commit_id=commit_id) |
|
1298 | 1308 | self.check_branch_permission(_branch_name, commit_id=commit_id) |
@@ -1380,7 +1390,8 b' class RepoFilesView(RepoAppView):' | |||
|
1380 | 1390 | _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True |
|
1381 | 1391 | else: |
|
1382 | 1392 | _branch_name, _sha_commit_id, is_head = \ |
|
1383 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1393 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1394 | landing_ref=self.db_repo.landing_ref_name) | |
|
1384 | 1395 | |
|
1385 | 1396 | self.forbid_non_head(is_head, f_path, commit_id=commit_id) |
|
1386 | 1397 | self.check_branch_permission(_branch_name, commit_id=commit_id) |
@@ -1421,7 +1432,8 b' class RepoFilesView(RepoAppView):' | |||
|
1421 | 1432 | _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True |
|
1422 | 1433 | else: |
|
1423 | 1434 | _branch_name, _sha_commit_id, is_head = \ |
|
1424 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1435 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1436 | landing_ref=self.db_repo.landing_ref_name) | |
|
1425 | 1437 | |
|
1426 | 1438 | self.forbid_non_head(is_head, f_path, commit_id=commit_id) |
|
1427 | 1439 | self.check_branch_permission(_branch_name, commit_id=commit_id) |
@@ -1517,7 +1529,8 b' class RepoFilesView(RepoAppView):' | |||
|
1517 | 1529 | _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True |
|
1518 | 1530 | else: |
|
1519 | 1531 | _branch_name, _sha_commit_id, is_head = \ |
|
1520 |
self._is_valid_head(commit_id, self.rhodecode_vcs_repo |
|
|
1532 | self._is_valid_head(commit_id, self.rhodecode_vcs_repo, | |
|
1533 | landing_ref=self.db_repo.landing_ref_name) | |
|
1521 | 1534 | |
|
1522 | 1535 | error = self.forbid_non_head(is_head, f_path, json_mode=True) |
|
1523 | 1536 | if error: |
@@ -54,7 +54,7 b' class RepoSettingsPermissionsView(RepoAp' | |||
|
54 | 54 | c = self.load_default_context() |
|
55 | 55 | c.active = 'permissions' |
|
56 | 56 | if self.request.GET.get('branch_permissions'): |
|
57 |
h.flash(_('Explicitly add user or user group with write |
|
|
57 | h.flash(_('Explicitly add user or user group with write or higher ' | |
|
58 | 58 | 'permission to modify their branch permissions.'), |
|
59 | 59 | category='notice') |
|
60 | 60 | return self._get_template_context(c) |
@@ -604,6 +604,7 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
604 | 604 | if not force_recache and has_proper_diff_cache: |
|
605 | 605 | c.diffset = cached_diff['diff'] |
|
606 | 606 | else: |
|
607 | try: | |
|
607 | 608 | c.diffset = self._get_diffset( |
|
608 | 609 | c.source_repo.repo_name, commits_source_repo, |
|
609 | 610 | c.ancestor_commit, |
@@ -617,6 +618,11 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
617 | 618 | # save cached diff |
|
618 | 619 | if caching_enabled: |
|
619 | 620 | cache_diff(cache_file_path, c.diffset, diff_commit_cache) |
|
621 | except CommitDoesNotExistError: | |
|
622 | log.exception('Failed to generate diffset') | |
|
623 | c.missing_commits = True | |
|
624 | ||
|
625 | if not c.missing_commits: | |
|
620 | 626 | |
|
621 | 627 | c.limited_diff = c.diffset.limited_diff |
|
622 | 628 |
@@ -83,7 +83,7 b' class VcsServer(object):' | |||
|
83 | 83 | else: |
|
84 | 84 | if permission in self.write_perms: |
|
85 | 85 | log.info( |
|
86 |
'WRITE |
|
|
86 | 'WRITE, or Higher Permissions for User "%s" detected to repo "%s"!', | |
|
87 | 87 | self.user, self.repo_name) |
|
88 | 88 | return 0 |
|
89 | 89 |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
@@ -644,7 +644,7 b' def load_rcextensions(root_path):' | |||
|
644 | 644 | rcextensions = None |
|
645 | 645 | |
|
646 | 646 | if rcextensions: |
|
647 |
log. |
|
|
647 | log.info('Loaded rcextensions from %s...', rcextensions) | |
|
648 | 648 | rhodecode.EXTENSIONS = rcextensions |
|
649 | 649 | |
|
650 | 650 | # Additional mappings that are not present in the pygments lexers |
@@ -587,51 +587,17 b' def cleaned_uri(uri):' | |||
|
587 | 587 | return urllib.quote(uri, safe='@$:/') |
|
588 | 588 | |
|
589 | 589 | |
|
590 | def uri_filter(uri): | |
|
591 | """ | |
|
592 | Removes user:password from given url string | |
|
593 | ||
|
594 | :param uri: | |
|
595 | :rtype: unicode | |
|
596 | :returns: filtered list of strings | |
|
597 | """ | |
|
598 | if not uri: | |
|
599 | return '' | |
|
600 | ||
|
601 | proto = '' | |
|
602 | ||
|
603 | for pat in ('https://', 'http://'): | |
|
604 | if uri.startswith(pat): | |
|
605 | uri = uri[len(pat):] | |
|
606 | proto = pat | |
|
607 | break | |
|
608 | ||
|
609 | # remove passwords and username | |
|
610 | uri = uri[uri.find('@') + 1:] | |
|
611 | ||
|
612 | # get the port | |
|
613 | cred_pos = uri.find(':') | |
|
614 | if cred_pos == -1: | |
|
615 | host, port = uri, None | |
|
616 | else: | |
|
617 | host, port = uri[:cred_pos], uri[cred_pos + 1:] | |
|
618 | ||
|
619 | return filter(None, [proto, host, port]) | |
|
620 | ||
|
621 | ||
|
622 | 590 | def credentials_filter(uri): |
|
623 | 591 | """ |
|
624 | 592 | Returns a url with removed credentials |
|
625 | 593 | |
|
626 | 594 | :param uri: |
|
627 | 595 | """ |
|
596 | import urlobject | |
|
597 | url_obj = urlobject.URLObject(cleaned_uri(uri)) | |
|
598 | url_obj = url_obj.without_password().without_username() | |
|
628 | 599 | |
|
629 | uri = uri_filter(uri) | |
|
630 | # check if we have port | |
|
631 | if len(uri) > 2 and uri[2]: | |
|
632 | uri[2] = ':' + uri[2] | |
|
633 | ||
|
634 | return ''.join(uri) | |
|
600 | return url_obj | |
|
635 | 601 | |
|
636 | 602 | |
|
637 | 603 | def get_host_info(request): |
@@ -384,7 +384,15 b' class EmailNotificationModel(BaseModel):' | |||
|
384 | 384 | instance_url = h.route_url('home') |
|
385 | 385 | _kwargs = { |
|
386 | 386 | 'instance_url': instance_url, |
|
387 | 'whitespace_filter': self.whitespace_filter | |
|
387 | 'whitespace_filter': self.whitespace_filter, | |
|
388 | 'email_pr_update_subject_template': EMAIL_PR_UPDATE_SUBJECT_TEMPLATE, | |
|
389 | 'email_pr_review_subject_template': EMAIL_PR_REVIEW_SUBJECT_TEMPLATE, | |
|
390 | 'email_pr_comment_subject_template': EMAIL_PR_COMMENT_SUBJECT_TEMPLATE, | |
|
391 | 'email_pr_comment_status_change_subject_template': EMAIL_PR_COMMENT_STATUS_CHANGE_SUBJECT_TEMPLATE, | |
|
392 | 'email_pr_comment_file_subject_template': EMAIL_PR_COMMENT_FILE_SUBJECT_TEMPLATE, | |
|
393 | 'email_comment_subject_template': EMAIL_COMMENT_SUBJECT_TEMPLATE, | |
|
394 | 'email_comment_status_change_subject_template': EMAIL_COMMENT_STATUS_CHANGE_SUBJECT_TEMPLATE, | |
|
395 | 'email_comment_file_subject_template': EMAIL_COMMENT_FILE_SUBJECT_TEMPLATE, | |
|
388 | 396 | } |
|
389 | 397 | _kwargs.update(kwargs) |
|
390 | 398 | return _kwargs |
@@ -561,7 +561,7 b' class PermissionModel(BaseModel):' | |||
|
561 | 561 | default_user_id = User.get_default_user_id() |
|
562 | 562 | user_write_permissions = collections.OrderedDict() |
|
563 | 563 | |
|
564 |
# write |
|
|
564 | # write or higher and DEFAULT user for inheritance | |
|
565 | 565 | for perm in db_repo.permissions(): |
|
566 | 566 | if perm.permission in write_plus or perm.user_id == default_user_id: |
|
567 | 567 | user_write_permissions[perm.user_id] = perm |
@@ -571,7 +571,7 b' class PermissionModel(BaseModel):' | |||
|
571 | 571 | write_plus = ['repository.write', 'repository.admin'] |
|
572 | 572 | user_group_write_permissions = collections.OrderedDict() |
|
573 | 573 | |
|
574 |
# write |
|
|
574 | # write or higher and DEFAULT user for inheritance | |
|
575 | 575 | for p in db_repo.permission_user_groups(): |
|
576 | 576 | if p.permission in write_plus: |
|
577 | 577 | user_group_write_permissions[p.users_group_id] = p |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Unfollow', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Unfollow', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Unfollow', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Unfollow', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Unfollow', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Smetti di seguire', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': '選択したステータス ({0}) を元にコメントが自動的に設定されます...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'アンフォロー', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -18,6 +18,7 b'' | |||
|
18 | 18 | _gettext('Collapse all files'); |
|
19 | 19 | _gettext('Collapse {0} commit'); |
|
20 | 20 | _gettext('Collapse {0} commits'); |
|
21 | _gettext('Comment body was not changed.'); | |
|
21 | 22 | _gettext('Comment text will be set automatically based on currently selected status ({0}) ...'); |
|
22 | 23 | _gettext('Commit Authors are not allowed to be a reviewer.'); |
|
23 | 24 | _gettext('Context file: '); |
@@ -106,6 +107,7 b'' | |||
|
106 | 107 | _gettext('Toggle Wide Mode diff'); |
|
107 | 108 | _gettext('Unfollow'); |
|
108 | 109 | _gettext('Unwatch'); |
|
110 | _gettext('Updated Comment'); | |
|
109 | 111 | _gettext('Updating...'); |
|
110 | 112 | _gettext('User `{0}` already in reviewers'); |
|
111 | 113 | _gettext('User `{0}` not allowed to be a reviewer'); |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Nie obserwuj', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Parar de seguir', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Не наблюдать', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -24,6 +24,7 b' var _TM = {' | |||
|
24 | 24 | 'Collapse all files': 'Collapse all files', |
|
25 | 25 | 'Collapse {0} commit': 'Collapse {0} commit', |
|
26 | 26 | 'Collapse {0} commits': 'Collapse {0} commits', |
|
27 | 'Comment body was not changed.': 'Comment body was not changed.', | |
|
27 | 28 | 'Comment text will be set automatically based on currently selected status ({0}) ...': 'Comment text will be set automatically based on currently selected status ({0}) ...', |
|
28 | 29 | 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.', |
|
29 | 30 | 'Context file: ': 'Context file: ', |
@@ -112,6 +113,7 b' var _TM = {' | |||
|
112 | 113 | 'Toggle Wide Mode diff': 'Toggle Wide Mode diff', |
|
113 | 114 | 'Unfollow': 'Unfollow', |
|
114 | 115 | 'Unwatch': 'Unwatch', |
|
116 | 'Updated Comment': 'Updated Comment', | |
|
115 | 117 | 'Updating...': 'Updating...', |
|
116 | 118 | 'User `{0}` already in reviewers': 'User `{0}` already in reviewers', |
|
117 | 119 | 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer', |
@@ -106,9 +106,9 b'' | |||
|
106 | 106 | |
|
107 | 107 | %if getattr(_user, 'branch_rules', None): |
|
108 | 108 | % if used_by_n_rules == 1: |
|
109 |
(${_('used by {} branch rule, requires write |
|
|
109 | (${_('used by {} branch rule, requires write or higher permissions').format(used_by_n_rules)}) | |
|
110 | 110 | % else: |
|
111 |
(${_('used by {} branch rules, requires write |
|
|
111 | (${_('used by {} branch rules, requires write or higher permissions').format(used_by_n_rules)}) | |
|
112 | 112 | % endif |
|
113 | 113 | %endif |
|
114 | 114 | % endif |
@@ -465,9 +465,9 b'' | |||
|
465 | 465 | <div class="alert alert-warning"> |
|
466 | 466 | <div> |
|
467 | 467 | <strong>${_('Missing commits')}:</strong> |
|
468 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} | |
|
469 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')} | |
|
470 | ${_('Consider doing a {force_refresh_url} in case you think this is an error.').format(force_refresh_url=h.link_to('force refresh', h.current_route_path(request, force_refresh='1')))|n} | |
|
468 | ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}<br/> | |
|
469 | ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}<br/> | |
|
470 | ${_('Consider doing a `force update commits` in case you think this is an error.')} | |
|
471 | 471 | </div> |
|
472 | 472 | </div> |
|
473 | 473 | </div> |
@@ -38,36 +38,29 b' from rhodecode.lib.utils2 import Attribu' | |||
|
38 | 38 | from rhodecode.model.db import Repository, CacheKey |
|
39 | 39 | |
|
40 | 40 | |
|
41 | def _urls_for_proto(proto): | |
|
42 | return [ | |
|
43 |
(' |
|
|
44 | '%s://127.0.0.1' % proto), | |
|
45 |
(' |
|
|
46 | '%s://127.0.0.1' % proto), | |
|
47 | ('%s://marcink:pass@127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'], | |
|
48 | '%s://127.0.0.1' % proto), | |
|
49 |
(' |
|
|
50 | '%s://127.0.0.1:8080' % proto), | |
|
51 | ('%s://domain.org' % proto, ['%s://' % proto, 'domain.org'], | |
|
52 |
|
|
|
53 |
(' |
|
|
54 | ['%s://' % proto, 'domain.org', '8080'], | |
|
55 | '%s://domain.org:8080' % proto), | |
|
41 | TEST_URLS = [ | |
|
42 | ('127.0.0.1', '127.0.0.1'), | |
|
43 | ('marcink@127.0.0.1', '127.0.0.1'), | |
|
44 | ('marcink:pass@127.0.0.1', '127.0.0.1'), | |
|
45 | ('marcink@domain.name:pass@127.0.0.1', '127.0.0.1'), | |
|
46 | ||
|
47 | ('127.0.0.1:8080', '127.0.0.1:8080'), | |
|
48 | ('marcink@127.0.0.1:8080', '127.0.0.1:8080'), | |
|
49 | ('marcink:pass@127.0.0.1:8080', '127.0.0.1:8080'), | |
|
50 | ('marcink@domain.name:pass@127.0.0.1:8080', '127.0.0.1:8080'), | |
|
51 | ||
|
52 | ('domain.org', 'domain.org'), | |
|
53 | ('user:pass@domain.org:8080', 'domain.org:8080'), | |
|
54 | ('user@domain.org:pass@domain.org:8080', 'domain.org:8080'), | |
|
56 | 55 | ] |
|
57 | 56 | |
|
58 | TEST_URLS = _urls_for_proto('http') + _urls_for_proto('https') | |
|
59 | 57 | |
|
60 | ||
|
61 |
@pytest.mark.parametrize("test_url, expected |
|
|
62 |
def test_ |
|
|
63 | from rhodecode.lib.utils2 import uri_filter | |
|
64 | assert uri_filter(test_url) == expected | |
|
65 | ||
|
66 | ||
|
67 | @pytest.mark.parametrize("test_url, expected, expected_creds", TEST_URLS) | |
|
68 | def test_credentials_filter(test_url, expected, expected_creds): | |
|
58 | @pytest.mark.parametrize("protocol", ['http://', 'https://']) | |
|
59 | @pytest.mark.parametrize("test_url, expected", TEST_URLS) | |
|
60 | def test_credentials_filter(protocol, test_url, expected): | |
|
69 | 61 | from rhodecode.lib.utils2 import credentials_filter |
|
70 | assert credentials_filter(test_url) == expected_creds | |
|
62 | test_url = protocol + test_url | |
|
63 | assert credentials_filter(test_url) == protocol + expected | |
|
71 | 64 | |
|
72 | 65 | |
|
73 | 66 | @pytest.mark.parametrize("str_bool, expected", [ |
General Comments 0
You need to be logged in to leave comments.
Login now