##// END OF EJS Templates
branch selectors: show closed branches too...
Mads Kiilerich -
r4020:218ed589 default
parent child Browse files
Show More
@@ -176,6 +176,10 b' class ChangelogController(BaseRepoContro'
176 c.branch_name = branch_name
176 c.branch_name = branch_name
177 c.branch_filters = [('', _('All Branches'))] + \
177 c.branch_filters = [('', _('All Branches'))] + \
178 [(k, k) for k in c.rhodecode_repo.branches.keys()]
178 [(k, k) for k in c.rhodecode_repo.branches.keys()]
179 if c.rhodecode_repo.closed_branches:
180 prefix = _('(closed)') + ' '
181 c.branch_filters += [('-', '-')] + \
182 [(k, prefix + k) for k in c.rhodecode_repo.closed_branches.keys()]
179 _revs = []
183 _revs = []
180 if not f_path:
184 if not f_path:
181 _revs = [x.revision for x in c.pagination]
185 _revs = [x.revision for x in c.pagination]
@@ -371,6 +371,10 b' class GitRepository(BaseRepository):'
371 return OrderedDict(sorted(_branches, key=sortkey, reverse=False))
371 return OrderedDict(sorted(_branches, key=sortkey, reverse=False))
372
372
373 @LazyProperty
373 @LazyProperty
374 def closed_branches(self):
375 return {}
376
377 @LazyProperty
374 def tags(self):
378 def tags(self):
375 return self._get_tags()
379 return self._get_tags()
376
380
@@ -101,18 +101,23 b' class MercurialRepository(BaseRepository'
101 return self._get_branches()
101 return self._get_branches()
102
102
103 @LazyProperty
103 @LazyProperty
104 def closed_branches(self):
105 return self._get_branches(normal=False, closed=True)
106
107 @LazyProperty
104 def allbranches(self):
108 def allbranches(self):
105 """
109 """
106 List all branches, including closed branches.
110 List all branches, including closed branches.
107 """
111 """
108 return self._get_branches(closed=True)
112 return self._get_branches(closed=True)
109
113
110 def _get_branches(self, closed=False):
114 def _get_branches(self, normal=True, closed=False):
111 """
115 """
112 Get's branches for this repository
116 Get's branches for this repository
113 Returns only not closed branches by default
117 Returns only not closed branches by default
114
118
115 :param closed: return also closed branches for mercurial
119 :param closed: return also closed branches for mercurial
120 :param normal: return also normal branches
116 """
121 """
117
122
118 if self._empty:
123 if self._empty:
@@ -135,6 +140,8 b' class MercurialRepository(BaseRepository'
135 else:
140 else:
136 bt[bn] = tip
141 bt[bn] = tip
137
142
143 if not normal:
144 return bt_closed
138 if closed:
145 if closed:
139 bt.update(bt_closed)
146 bt.update(bt_closed)
140 return bt
147 return bt
@@ -11,6 +11,17 b''
11 %endif
11 %endif
12 </ul>
12 </ul>
13 </li>
13 </li>
14 %if c.rhodecode_repo.closed_branches.values():
15 <li>
16 ${h.link_to('%s (%s)' % (_('Closed Branches'),len(c.rhodecode_repo.closed_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
17 <ul>
18 <li><a>-</a></li>
19 %for cnt,branch in enumerate(c.rhodecode_repo.closed_branches.items()):
20 <li><div><pre>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=(branch[0] if '/' not in branch[0] else branch[1]), at=branch[0]))}</pre></div></li>
21 %endfor
22 </ul>
23 </li>
24 %endif
14 <li>
25 <li>
15 ${h.link_to('%s (%s)' % (_('Tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
26 ${h.link_to('%s (%s)' % (_('Tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
16 <ul>
27 <ul>
General Comments 0
You need to be logged in to leave comments. Login now