# HG changeset patch # User Marcin Kuzminski # Date 2011-11-18 14:31:36 # Node ID 8fdabc8cce1a39da76b09dfd90e2d53a3c3efcbb # Parent 23bf79f4e8d4e34c8f28935d245eb6228c8e917b fixes GIT issues with branch page diff --git a/rhodecode/controllers/branches.py b/rhodecode/controllers/branches.py --- a/rhodecode/controllers/branches.py +++ b/rhodecode/controllers/branches.py @@ -46,33 +46,30 @@ class BranchesController(BaseRepoControl def index(self): def _branchtags(localrepo): - - bt = {} bt_closed = {} - for bn, heads in localrepo.branchmap().iteritems(): tip = heads[-1] - if 'close' not in localrepo.changelog.read(tip)[5]: - bt[bn] = tip - else: + if 'close' in localrepo.changelog.read(tip)[5]: bt_closed[bn] = tip - return bt, bt_closed + return bt_closed + cs_g = c.rhodecode_repo.get_changeset - bt, bt_closed = _branchtags(c.rhodecode_repo._repo) - cs_g = c.rhodecode_repo.get_changeset - _branches = [(safe_unicode(n), cs_g(binascii.hexlify(h)),) for n, h in - bt.items()] + c.repo_closed_branches = {} + if c.rhodecode_db_repo.repo_type == 'hg': + bt_closed = _branchtags(c.rhodecode_repo._repo) + _closed_branches = [(safe_unicode(n), cs_g(binascii.hexlify(h)),) + for n, h in bt_closed.items()] - _closed_branches = [(safe_unicode(n), cs_g(binascii.hexlify(h)),) for n, h in - bt_closed.items()] + c.repo_closed_branches = OrderedDict(sorted(_closed_branches, + key=lambda ctx: ctx[0], + reverse=False)) + _branches = [(safe_unicode(n), cs_g(h)) + for n, h in c.rhodecode_repo.branches.items()] c.repo_branches = OrderedDict(sorted(_branches, key=lambda ctx: ctx[0], reverse=False)) - c.repo_closed_branches = OrderedDict(sorted(_closed_branches, - key=lambda ctx: ctx[0], - reverse=False)) return render('branches/branches.html')