Mercurial > kallithea
comparison rhodecode/controllers/branches.py @ 1698:8fdabc8cce1a beta
fixes GIT issues with branch page
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 18 Nov 2011 16:31:36 +0200 |
parents | 87ec80c280bb |
children | 89efedac4e6c |
comparison
equal
deleted
inserted
replaced
1697:23bf79f4e8d4 | 1698:8fdabc8cce1a |
---|---|
44 super(BranchesController, self).__before__() | 44 super(BranchesController, self).__before__() |
45 | 45 |
46 def index(self): | 46 def index(self): |
47 | 47 |
48 def _branchtags(localrepo): | 48 def _branchtags(localrepo): |
49 | |
50 bt = {} | |
51 bt_closed = {} | 49 bt_closed = {} |
52 | |
53 for bn, heads in localrepo.branchmap().iteritems(): | 50 for bn, heads in localrepo.branchmap().iteritems(): |
54 tip = heads[-1] | 51 tip = heads[-1] |
55 if 'close' not in localrepo.changelog.read(tip)[5]: | 52 if 'close' in localrepo.changelog.read(tip)[5]: |
56 bt[bn] = tip | |
57 else: | |
58 bt_closed[bn] = tip | 53 bt_closed[bn] = tip |
59 return bt, bt_closed | 54 return bt_closed |
60 | 55 |
56 cs_g = c.rhodecode_repo.get_changeset | |
61 | 57 |
62 bt, bt_closed = _branchtags(c.rhodecode_repo._repo) | 58 c.repo_closed_branches = {} |
63 cs_g = c.rhodecode_repo.get_changeset | 59 if c.rhodecode_db_repo.repo_type == 'hg': |
64 _branches = [(safe_unicode(n), cs_g(binascii.hexlify(h)),) for n, h in | 60 bt_closed = _branchtags(c.rhodecode_repo._repo) |
65 bt.items()] | 61 _closed_branches = [(safe_unicode(n), cs_g(binascii.hexlify(h)),) |
62 for n, h in bt_closed.items()] | |
66 | 63 |
67 _closed_branches = [(safe_unicode(n), cs_g(binascii.hexlify(h)),) for n, h in | 64 c.repo_closed_branches = OrderedDict(sorted(_closed_branches, |
68 bt_closed.items()] | 65 key=lambda ctx: ctx[0], |
66 reverse=False)) | |
69 | 67 |
68 _branches = [(safe_unicode(n), cs_g(h)) | |
69 for n, h in c.rhodecode_repo.branches.items()] | |
70 c.repo_branches = OrderedDict(sorted(_branches, | 70 c.repo_branches = OrderedDict(sorted(_branches, |
71 key=lambda ctx: ctx[0], | 71 key=lambda ctx: ctx[0], |
72 reverse=False)) | 72 reverse=False)) |
73 c.repo_closed_branches = OrderedDict(sorted(_closed_branches, | |
74 key=lambda ctx: ctx[0], | |
75 reverse=False)) | |
76 | 73 |
77 | 74 |
78 return render('branches/branches.html') | 75 return render('branches/branches.html') |