Show More
@@ -67,29 +67,33 b' class PullrequestsController(BaseRepoCon' | |||||
67 | c.users_array = repo_model.get_users_js() |
|
67 | c.users_array = repo_model.get_users_js() | |
68 | c.users_groups_array = repo_model.get_users_groups_js() |
|
68 | c.users_groups_array = repo_model.get_users_groups_js() | |
69 |
|
69 | |||
70 | def _get_repo_refs(self, repo): |
|
70 | def _get_repo_refs(self, repo, rev=None): | |
71 | hist_l = [] |
|
71 | """return a structure with repo's interesting changesets, suitable for | |
72 |
|
72 | the selectors in pullrequest.html""" | ||
73 |
branches |
|
73 | branches = [('branch:%s:%s' % (k, v), k) | |
74 |
|
|
74 | for k, v in repo.branches.iteritems()] | |
75 |
bookmarks |
|
75 | bookmarks = [('book:%s:%s' % (k, v), k) | |
76 |
|
|
76 | for k, v in repo.bookmarks.iteritems()] | |
77 |
tags |
|
77 | tags = [('tag:%s:%s' % (k, v), k) | |
78 |
|
|
78 | for k, v in repo.tags.iteritems() | |
79 |
|
|
79 | if k != 'tip'] | |
80 |
|
80 | |||
81 | tip = repo.tags['tip'] |
|
81 | tip = repo.tags['tip'] | |
82 | tipref = 'tag:tip:%s' % tip |
|
|||
83 | colontip = ':' + tip |
|
82 | colontip = ':' + tip | |
84 |
tips = [x[1] for x in branches |
|
83 | tips = [x[1] for x in branches + bookmarks + tags | |
85 | if x[0].endswith(colontip)] |
|
84 | if x[0].endswith(colontip)] | |
86 | tags_group[0].append((tipref, 'tip (%s)' % ', '.join(tips))) |
|
85 | selected = 'tag:tip:%s' % tip | |
|
86 | special = [(selected, 'tip (%s)' % ', '.join(tips))] | |||
87 |
|
87 | |||
88 | hist_l.append(bookmarks_group) |
|
88 | if rev: | |
89 | hist_l.append(branches_group) |
|
89 | selected = 'rev:%s:%s' % (rev, rev) | |
90 | hist_l.append(tags_group) |
|
90 | special.append((selected, rev)) | |
91 |
|
91 | |||
92 | return hist_l, tipref |
|
92 | return [(special, _("Special")), | |
|
93 | (bookmarks, _("Bookmarks")), | |||
|
94 | (branches, _("Branches")), | |||
|
95 | (tags, _("Tags")), | |||
|
96 | ], selected | |||
93 |
|
97 | |||
94 | def _get_is_allowed_change_status(self, pull_request): |
|
98 | def _get_is_allowed_change_status(self, pull_request): | |
95 | owner = self.rhodecode_user.user_id == pull_request.user_id |
|
99 | owner = self.rhodecode_user.user_id == pull_request.user_id |
General Comments 0
You need to be logged in to leave comments.
Login now