Changeset - 218ed589e44a
[Not reviewed]
default
0 4 0
Mads Kiilerich - 12 years ago 2013-06-04 13:26:41
madski@unity3d.com
Grafted from: 6d3b7006e98a
branch selectors: show closed branches too

It would be even better if they were fetched dynamically somehow and perhaps
placed in a sub sub menu ... but showing them in the list is often better than
not showing them at all.
4 files changed with 27 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -176,6 +176,10 @@ class ChangelogController(BaseRepoContro
 
        c.branch_name = branch_name
 
        c.branch_filters = [('', _('All Branches'))] + \
 
            [(k, k) for k in c.rhodecode_repo.branches.keys()]
 
        if c.rhodecode_repo.closed_branches:
 
            prefix = _('(closed)') + ' '
 
            c.branch_filters += [('-', '-')] + \
 
                [(k, prefix + k) for k in c.rhodecode_repo.closed_branches.keys()]
 
        _revs = []
 
        if not f_path:
 
            _revs = [x.revision for x in c.pagination]
rhodecode/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -371,6 +371,10 @@ class GitRepository(BaseRepository):
 
        return OrderedDict(sorted(_branches, key=sortkey, reverse=False))
 

	
 
    @LazyProperty
 
    def closed_branches(self):
 
        return {}
 

	
 
    @LazyProperty
 
    def tags(self):
 
        return self._get_tags()
 

	
rhodecode/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -101,18 +101,23 @@ class MercurialRepository(BaseRepository
 
        return self._get_branches()
 

	
 
    @LazyProperty
 
    def closed_branches(self):
 
        return self._get_branches(normal=False, closed=True)
 

	
 
    @LazyProperty
 
    def allbranches(self):
 
        """
 
        List all branches, including closed branches.
 
        """
 
        return self._get_branches(closed=True)
 

	
 
    def _get_branches(self, closed=False):
 
    def _get_branches(self, normal=True, closed=False):
 
        """
 
        Get's branches for this repository
 
        Returns only not closed branches by default
 

	
 
        :param closed: return also closed branches for mercurial
 
        :param normal: return also normal branches
 
        """
 

	
 
        if self._empty:
 
@@ -135,6 +140,8 @@ class MercurialRepository(BaseRepository
 
                else:
 
                    bt[bn] = tip
 

	
 
            if not normal:
 
                return bt_closed
 
            if closed:
 
                bt.update(bt_closed)
 
            return bt
rhodecode/templates/switch_to_list.html
Show inline comments
 
@@ -11,6 +11,17 @@
 
    %endif
 
    </ul>
 
</li>
 
%if c.rhodecode_repo.closed_branches.values():
 
<li>
 
    ${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')}
 
    <ul>
 
        <li><a>-</a></li>
 
        %for cnt,branch in enumerate(c.rhodecode_repo.closed_branches.items()):
 
            <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>
 
        %endfor
 
    </ul>
 
</li>
 
%endif
 
<li>
 
    ${h.link_to('%s (%s)' % (_('Tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
 
    <ul>
0 comments (0 inline, 0 general)