##// END OF EJS Templates
release: merge back stable branch into default
marcink -
r4469:9d632087 merge default
parent child Browse files
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 c0c65acd73914bf4368222d510afe1161ab8c07c v4.19.1
66 c0c65acd73914bf4368222d510afe1161ab8c07c v4.19.1
67 7ac623a4a2405917e2af660d645ded662011e40d v4.19.2
67 7ac623a4a2405917e2af660d645ded662011e40d v4.19.2
68 ef7ffda65eeb90c3ba88590a6cb816ef9b0bc232 v4.19.3
68 ef7ffda65eeb90c3ba88590a6cb816ef9b0bc232 v4.19.3
69 3e635489bb7961df93b01e42454ad1a8730ae968 v4.20.0
70 7e2eb896a02ca7cd2cd9f0f853ef3dac3f0039e3 v4.20.1
@@ -9,6 +9,7 b' Release Notes'
9 .. toctree::
9 .. toctree::
10 :maxdepth: 1
10 :maxdepth: 1
11
11
12 release-notes-4.20.1.rst
12 release-notes-4.20.0.rst
13 release-notes-4.20.0.rst
13 release-notes-4.19.3.rst
14 release-notes-4.19.3.rst
14 release-notes-4.19.2.rst
15 release-notes-4.19.2.rst
@@ -211,7 +211,7 b' class RepoFilesView(RepoAppView):'
211
211
212 return file_node
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 branch_name = sha_commit_id = ''
215 branch_name = sha_commit_id = ''
216 is_head = False
216 is_head = False
217 log.debug('Checking if commit_id `%s` is a head for %s.', commit_id, repo)
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 return branch_name, sha_commit_id, is_head
237 return branch_name, sha_commit_id, is_head
238
238
239 # checked branches, means we only need to try to get the branch/commit_sha
239 # checked branches, means we only need to try to get the branch/commit_sha
240 if not repo.is_empty():
240 if repo.is_empty():
241 is_head = True
242 branch_name = landing_ref
243 sha_commit_id = EmptyCommit().raw_id
244 else:
241 commit = repo.get_commit(commit_id=commit_id)
245 commit = repo.get_commit(commit_id=commit_id)
242 if commit:
246 if commit:
243 branch_name = commit.branch
247 branch_name = commit.branch
@@ -696,8 +700,9 b' class RepoFilesView(RepoAppView):'
696 if not c.renderer:
700 if not c.renderer:
697 c.lines = filenode_as_lines_tokens(c.file)
701 c.lines = filenode_as_lines_tokens(c.file)
698
702
699 _branch_name, _sha_commit_id, is_head = self._is_valid_head(
703 _branch_name, _sha_commit_id, is_head = \
700 commit_id, self.rhodecode_vcs_repo)
704 self._is_valid_head(commit_id, self.rhodecode_vcs_repo,
705 landing_ref=self.db_repo.landing_ref_name)
701 c.on_branch_head = is_head
706 c.on_branch_head = is_head
702
707
703 branch = c.commit.branch if (
708 branch = c.commit.branch if (
@@ -1135,7 +1140,8 b' class RepoFilesView(RepoAppView):'
1135
1140
1136 commit_id, f_path = self._get_commit_and_path()
1141 commit_id, f_path = self._get_commit_and_path()
1137 _branch_name, _sha_commit_id, is_head = \
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 new_path = self.request.POST.get('path')
1146 new_path = self.request.POST.get('path')
1141 operation = self.request.POST.get('operation')
1147 operation = self.request.POST.get('operation')
@@ -1173,7 +1179,8 b' class RepoFilesView(RepoAppView):'
1173
1179
1174 self._ensure_not_locked()
1180 self._ensure_not_locked()
1175 _branch_name, _sha_commit_id, is_head = \
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 self.forbid_non_head(is_head, f_path)
1185 self.forbid_non_head(is_head, f_path)
1179 self.check_branch_permission(_branch_name)
1186 self.check_branch_permission(_branch_name)
@@ -1201,7 +1208,8 b' class RepoFilesView(RepoAppView):'
1201
1208
1202 self._ensure_not_locked()
1209 self._ensure_not_locked()
1203 _branch_name, _sha_commit_id, is_head = \
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 self.forbid_non_head(is_head, f_path)
1214 self.forbid_non_head(is_head, f_path)
1207 self.check_branch_permission(_branch_name)
1215 self.check_branch_permission(_branch_name)
@@ -1251,7 +1259,8 b' class RepoFilesView(RepoAppView):'
1251
1259
1252 self._ensure_not_locked()
1260 self._ensure_not_locked()
1253 _branch_name, _sha_commit_id, is_head = \
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 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1265 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1257 self.check_branch_permission(_branch_name, commit_id=commit_id)
1266 self.check_branch_permission(_branch_name, commit_id=commit_id)
@@ -1292,7 +1301,8 b' class RepoFilesView(RepoAppView):'
1292 commit_id=c.commit.raw_id, f_path=f_path))
1301 commit_id=c.commit.raw_id, f_path=f_path))
1293
1302
1294 _branch_name, _sha_commit_id, is_head = \
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 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1307 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1298 self.check_branch_permission(_branch_name, commit_id=commit_id)
1308 self.check_branch_permission(_branch_name, commit_id=commit_id)
@@ -1380,7 +1390,8 b' class RepoFilesView(RepoAppView):'
1380 _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True
1390 _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True
1381 else:
1391 else:
1382 _branch_name, _sha_commit_id, is_head = \
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 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1396 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1386 self.check_branch_permission(_branch_name, commit_id=commit_id)
1397 self.check_branch_permission(_branch_name, commit_id=commit_id)
@@ -1421,7 +1432,8 b' class RepoFilesView(RepoAppView):'
1421 _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True
1432 _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True
1422 else:
1433 else:
1423 _branch_name, _sha_commit_id, is_head = \
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 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1438 self.forbid_non_head(is_head, f_path, commit_id=commit_id)
1427 self.check_branch_permission(_branch_name, commit_id=commit_id)
1439 self.check_branch_permission(_branch_name, commit_id=commit_id)
@@ -1517,7 +1529,8 b' class RepoFilesView(RepoAppView):'
1517 _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True
1529 _branch_name, _sha_commit_id, is_head = c.commit.branch, '', True
1518 else:
1530 else:
1519 _branch_name, _sha_commit_id, is_head = \
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 error = self.forbid_non_head(is_head, f_path, json_mode=True)
1535 error = self.forbid_non_head(is_head, f_path, json_mode=True)
1523 if error:
1536 if error:
@@ -54,7 +54,7 b' class RepoSettingsPermissionsView(RepoAp'
54 c = self.load_default_context()
54 c = self.load_default_context()
55 c.active = 'permissions'
55 c.active = 'permissions'
56 if self.request.GET.get('branch_permissions'):
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 'permission to modify their branch permissions.'),
58 'permission to modify their branch permissions.'),
59 category='notice')
59 category='notice')
60 return self._get_template_context(c)
60 return self._get_template_context(c)
@@ -604,68 +604,74 b' class RepoPullRequestsView(RepoAppView, '
604 if not force_recache and has_proper_diff_cache:
604 if not force_recache and has_proper_diff_cache:
605 c.diffset = cached_diff['diff']
605 c.diffset = cached_diff['diff']
606 else:
606 else:
607 c.diffset = self._get_diffset(
607 try:
608 c.source_repo.repo_name, commits_source_repo,
608 c.diffset = self._get_diffset(
609 c.ancestor_commit,
609 c.source_repo.repo_name, commits_source_repo,
610 source_ref_id, target_ref_id,
610 c.ancestor_commit,
611 target_commit, source_commit,
611 source_ref_id, target_ref_id,
612 diff_limit, file_limit, c.fulldiff,
612 target_commit, source_commit,
613 hide_whitespace_changes, diff_context,
613 diff_limit, file_limit, c.fulldiff,
614 use_ancestor=use_ancestor
614 hide_whitespace_changes, diff_context,
615 )
615 use_ancestor=use_ancestor
616
616 )
617 # save cached diff
618 if caching_enabled:
619 cache_diff(cache_file_path, c.diffset, diff_commit_cache)
620
621 c.limited_diff = c.diffset.limited_diff
622
623 # calculate removed files that are bound to comments
624 comment_deleted_files = [
625 fname for fname in display_inline_comments
626 if fname not in c.diffset.file_stats]
627
628 c.deleted_files_comments = collections.defaultdict(dict)
629 for fname, per_line_comments in display_inline_comments.items():
630 if fname in comment_deleted_files:
631 c.deleted_files_comments[fname]['stats'] = 0
632 c.deleted_files_comments[fname]['comments'] = list()
633 for lno, comments in per_line_comments.items():
634 c.deleted_files_comments[fname]['comments'].extend(comments)
635
636 # maybe calculate the range diff
637 if c.range_diff_on:
638 # TODO(marcink): set whitespace/context
639 context_lcl = 3
640 ign_whitespace_lcl = False
641
642 for commit in c.commit_ranges:
643 commit2 = commit
644 commit1 = commit.first_parent
645
646 range_diff_cache_file_path = diff_cache_exist(
647 cache_path, 'diff', commit.raw_id,
648 ign_whitespace_lcl, context_lcl, c.fulldiff)
649
650 cached_diff = None
651 if caching_enabled:
652 cached_diff = load_cached_diff(range_diff_cache_file_path)
653
654 has_proper_diff_cache = cached_diff and cached_diff.get('diff')
655 if not force_recache and has_proper_diff_cache:
656 diffset = cached_diff['diff']
657 else:
658 diffset = self._get_range_diffset(
659 commits_source_repo, source_repo,
660 commit1, commit2, diff_limit, file_limit,
661 c.fulldiff, ign_whitespace_lcl, context_lcl
662 )
663
617
664 # save cached diff
618 # save cached diff
665 if caching_enabled:
619 if caching_enabled:
666 cache_diff(range_diff_cache_file_path, diffset, None)
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:
626
627 c.limited_diff = c.diffset.limited_diff
628
629 # calculate removed files that are bound to comments
630 comment_deleted_files = [
631 fname for fname in display_inline_comments
632 if fname not in c.diffset.file_stats]
633
634 c.deleted_files_comments = collections.defaultdict(dict)
635 for fname, per_line_comments in display_inline_comments.items():
636 if fname in comment_deleted_files:
637 c.deleted_files_comments[fname]['stats'] = 0
638 c.deleted_files_comments[fname]['comments'] = list()
639 for lno, comments in per_line_comments.items():
640 c.deleted_files_comments[fname]['comments'].extend(comments)
641
642 # maybe calculate the range diff
643 if c.range_diff_on:
644 # TODO(marcink): set whitespace/context
645 context_lcl = 3
646 ign_whitespace_lcl = False
667
647
668 c.changes[commit.raw_id] = diffset
648 for commit in c.commit_ranges:
649 commit2 = commit
650 commit1 = commit.first_parent
651
652 range_diff_cache_file_path = diff_cache_exist(
653 cache_path, 'diff', commit.raw_id,
654 ign_whitespace_lcl, context_lcl, c.fulldiff)
655
656 cached_diff = None
657 if caching_enabled:
658 cached_diff = load_cached_diff(range_diff_cache_file_path)
659
660 has_proper_diff_cache = cached_diff and cached_diff.get('diff')
661 if not force_recache and has_proper_diff_cache:
662 diffset = cached_diff['diff']
663 else:
664 diffset = self._get_range_diffset(
665 commits_source_repo, source_repo,
666 commit1, commit2, diff_limit, file_limit,
667 c.fulldiff, ign_whitespace_lcl, context_lcl
668 )
669
670 # save cached diff
671 if caching_enabled:
672 cache_diff(range_diff_cache_file_path, diffset, None)
673
674 c.changes[commit.raw_id] = diffset
669
675
670 # this is a hack to properly display links, when creating PR, the
676 # this is a hack to properly display links, when creating PR, the
671 # compare view and others uses different notation, and
677 # compare view and others uses different notation, and
@@ -83,7 +83,7 b' class VcsServer(object):'
83 else:
83 else:
84 if permission in self.write_perms:
84 if permission in self.write_perms:
85 log.info(
85 log.info(
86 'WRITE+ Permissions for User "%s" detected to repo "%s"!',
86 'WRITE, or Higher Permissions for User "%s" detected to repo "%s"!',
87 self.user, self.repo_name)
87 self.user, self.repo_name)
88 return 0
88 return 0
89
89
1 NO CONTENT: modified file
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 rcextensions = None
644 rcextensions = None
645
645
646 if rcextensions:
646 if rcextensions:
647 log.debug('Found rcextensions module loaded %s...', rcextensions)
647 log.info('Loaded rcextensions from %s...', rcextensions)
648 rhodecode.EXTENSIONS = rcextensions
648 rhodecode.EXTENSIONS = rcextensions
649
649
650 # Additional mappings that are not present in the pygments lexers
650 # Additional mappings that are not present in the pygments lexers
@@ -587,51 +587,17 b' def cleaned_uri(uri):'
587 return urllib.quote(uri, safe='@$:/')
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 def credentials_filter(uri):
590 def credentials_filter(uri):
623 """
591 """
624 Returns a url with removed credentials
592 Returns a url with removed credentials
625
593
626 :param uri:
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)
600 return url_obj
630 # check if we have port
631 if len(uri) > 2 and uri[2]:
632 uri[2] = ':' + uri[2]
633
634 return ''.join(uri)
635
601
636
602
637 def get_host_info(request):
603 def get_host_info(request):
@@ -384,7 +384,15 b' class EmailNotificationModel(BaseModel):'
384 instance_url = h.route_url('home')
384 instance_url = h.route_url('home')
385 _kwargs = {
385 _kwargs = {
386 'instance_url': instance_url,
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 _kwargs.update(kwargs)
397 _kwargs.update(kwargs)
390 return _kwargs
398 return _kwargs
@@ -561,7 +561,7 b' class PermissionModel(BaseModel):'
561 default_user_id = User.get_default_user_id()
561 default_user_id = User.get_default_user_id()
562 user_write_permissions = collections.OrderedDict()
562 user_write_permissions = collections.OrderedDict()
563
563
564 # write+ and DEFAULT user for inheritance
564 # write or higher and DEFAULT user for inheritance
565 for perm in db_repo.permissions():
565 for perm in db_repo.permissions():
566 if perm.permission in write_plus or perm.user_id == default_user_id:
566 if perm.permission in write_plus or perm.user_id == default_user_id:
567 user_write_permissions[perm.user_id] = perm
567 user_write_permissions[perm.user_id] = perm
@@ -571,7 +571,7 b' class PermissionModel(BaseModel):'
571 write_plus = ['repository.write', 'repository.admin']
571 write_plus = ['repository.write', 'repository.admin']
572 user_group_write_permissions = collections.OrderedDict()
572 user_group_write_permissions = collections.OrderedDict()
573
573
574 # write+ and DEFAULT user for inheritance
574 # write or higher and DEFAULT user for inheritance
575 for p in db_repo.permission_user_groups():
575 for p in db_repo.permission_user_groups():
576 if p.permission in write_plus:
576 if p.permission in write_plus:
577 user_group_write_permissions[p.users_group_id] = p
577 user_group_write_permissions[p.users_group_id] = p
@@ -24,6 +24,7 b' var _TM = {'
24 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Unfollow',
114 'Unfollow': 'Unfollow',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Unfollow',
114 'Unfollow': 'Unfollow',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Unfollow',
114 'Unfollow': 'Unfollow',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Unfollow',
114 'Unfollow': 'Unfollow',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Unfollow',
114 'Unfollow': 'Unfollow',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Smetti di seguire',
114 'Unfollow': 'Smetti di seguire',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 'Comment text will be set automatically based on currently selected status ({0}) ...': '選択したステータス ({0}) を元にコメントが自動的に設定されます...',
28 'Comment text will be set automatically based on currently selected status ({0}) ...': '選択したステータス ({0}) を元にコメントが自動的に設定されます...',
28 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'アンフォロー',
114 'Unfollow': 'アンフォロー',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
119 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
@@ -18,6 +18,7 b''
18 _gettext('Collapse all files');
18 _gettext('Collapse all files');
19 _gettext('Collapse {0} commit');
19 _gettext('Collapse {0} commit');
20 _gettext('Collapse {0} commits');
20 _gettext('Collapse {0} commits');
21 _gettext('Comment body was not changed.');
21 _gettext('Comment text will be set automatically based on currently selected status ({0}) ...');
22 _gettext('Comment text will be set automatically based on currently selected status ({0}) ...');
22 _gettext('Commit Authors are not allowed to be a reviewer.');
23 _gettext('Commit Authors are not allowed to be a reviewer.');
23 _gettext('Context file: ');
24 _gettext('Context file: ');
@@ -106,6 +107,7 b''
106 _gettext('Toggle Wide Mode diff');
107 _gettext('Toggle Wide Mode diff');
107 _gettext('Unfollow');
108 _gettext('Unfollow');
108 _gettext('Unwatch');
109 _gettext('Unwatch');
110 _gettext('Updated Comment');
109 _gettext('Updating...');
111 _gettext('Updating...');
110 _gettext('User `{0}` already in reviewers');
112 _gettext('User `{0}` already in reviewers');
111 _gettext('User `{0}` not allowed to be a reviewer');
113 _gettext('User `{0}` not allowed to be a reviewer');
@@ -24,6 +24,7 b' var _TM = {'
24 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Nie obserwuj',
114 'Unfollow': 'Nie obserwuj',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Parar de seguir',
114 'Unfollow': 'Parar de seguir',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Не наблюдать',
114 'Unfollow': 'Не наблюдать',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 'Collapse all files': 'Collapse all files',
24 'Collapse all files': 'Collapse all files',
25 'Collapse {0} commit': 'Collapse {0} commit',
25 'Collapse {0} commit': 'Collapse {0} commit',
26 'Collapse {0} commits': 'Collapse {0} commits',
26 'Collapse {0} commits': 'Collapse {0} commits',
27 'Comment body was not changed.': 'Comment body was not changed.',
27 '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 '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 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Commit Authors are not allowed to be a reviewer.': 'Commit Authors are not allowed to be a reviewer.',
29 'Context file: ': 'Context file: ',
30 'Context file: ': 'Context file: ',
@@ -112,6 +113,7 b' var _TM = {'
112 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Toggle Wide Mode diff': 'Toggle Wide Mode diff',
113 'Unfollow': 'Unfollow',
114 'Unfollow': 'Unfollow',
114 'Unwatch': 'Unwatch',
115 'Unwatch': 'Unwatch',
116 'Updated Comment': 'Updated Comment',
115 'Updating...': 'Updating...',
117 'Updating...': 'Updating...',
116 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
118 'User `{0}` already in reviewers': 'User `{0}` already in reviewers',
117 'User `{0}` not allowed to be a reviewer': 'User `{0}` not allowed to be a reviewer',
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 %if getattr(_user, 'branch_rules', None):
107 %if getattr(_user, 'branch_rules', None):
108 % if used_by_n_rules == 1:
108 % if used_by_n_rules == 1:
109 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
109 (${_('used by {} branch rule, requires write or higher permissions').format(used_by_n_rules)})
110 % else:
110 % else:
111 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
111 (${_('used by {} branch rules, requires write or higher permissions').format(used_by_n_rules)})
112 % endif
112 % endif
113 %endif
113 %endif
114 % endif
114 % endif
@@ -465,9 +465,9 b''
465 <div class="alert alert-warning">
465 <div class="alert alert-warning">
466 <div>
466 <div>
467 <strong>${_('Missing commits')}:</strong>
467 <strong>${_('Missing commits')}:</strong>
468 ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')}
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.')}
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_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}
470 ${_('Consider doing a `force update commits` in case you think this is an error.')}
471 </div>
471 </div>
472 </div>
472 </div>
473 </div>
473 </div>
@@ -38,36 +38,29 b' from rhodecode.lib.utils2 import Attribu'
38 from rhodecode.model.db import Repository, CacheKey
38 from rhodecode.model.db import Repository, CacheKey
39
39
40
40
41 def _urls_for_proto(proto):
41 TEST_URLS = [
42 return [
42 ('127.0.0.1', '127.0.0.1'),
43 ('%s://127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'],
43 ('marcink@127.0.0.1', '127.0.0.1'),
44 '%s://127.0.0.1' % proto),
44 ('marcink:pass@127.0.0.1', '127.0.0.1'),
45 ('%s://marcink@127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'],
45 ('marcink@domain.name:pass@127.0.0.1', '127.0.0.1'),
46 '%s://127.0.0.1' % proto),
46
47 ('%s://marcink:pass@127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'],
47 ('127.0.0.1:8080', '127.0.0.1:8080'),
48 '%s://127.0.0.1' % proto),
48 ('marcink@127.0.0.1:8080', '127.0.0.1:8080'),
49 ('%s://127.0.0.1:8080' % proto, ['%s://' % proto, '127.0.0.1', '8080'],
49 ('marcink:pass@127.0.0.1:8080', '127.0.0.1:8080'),
50 '%s://127.0.0.1:8080' % proto),
50 ('marcink@domain.name:pass@127.0.0.1:8080', '127.0.0.1:8080'),
51 ('%s://domain.org' % proto, ['%s://' % proto, 'domain.org'],
51
52 '%s://domain.org' % proto),
52 ('domain.org', 'domain.org'),
53 ('%s://user:pass@domain.org:8080' % proto,
53 ('user:pass@domain.org:8080', 'domain.org:8080'),
54 ['%s://' % proto, 'domain.org', '8080'],
54 ('user@domain.org:pass@domain.org:8080', 'domain.org:8080'),
55 '%s://domain.org:8080' % proto),
56 ]
55 ]
57
56
58 TEST_URLS = _urls_for_proto('http') + _urls_for_proto('https')
59
57
60
58 @pytest.mark.parametrize("protocol", ['http://', 'https://'])
61 @pytest.mark.parametrize("test_url, expected, expected_creds", TEST_URLS)
59 @pytest.mark.parametrize("test_url, expected", TEST_URLS)
62 def test_uri_filter(test_url, expected, expected_creds):
60 def test_credentials_filter(protocol, test_url, expected):
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):
69 from rhodecode.lib.utils2 import credentials_filter
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 @pytest.mark.parametrize("str_bool, expected", [
66 @pytest.mark.parametrize("str_bool, expected", [
General Comments 0
You need to be logged in to leave comments. Login now