Commits

Marcin Kuzminski committed 8fdabc8

fixes GIT issues with branch page

  • Participants
  • Parent commits 23bf79f
  • Branches beta

Comments (0)

Files changed (1)

File rhodecode/controllers/branches.py

     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')