comparison pylons_app/controllers/branches.py @ 389:174785aa5dc4

fixed sorting of tags and branches. Fix made in vcs.
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 05 Aug 2010 23:59:41 +0200
parents fdf9f6ee5217
children
comparison
equal deleted inserted replaced
388:3bcf9529d221 389:174785aa5dc4
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # encoding: utf-8 2 # encoding: utf-8
3 # branches controller for pylons 3 # branches controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> 4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5 5 #
6 # This program is free software; you can redistribute it and/or 6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License 7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2 8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license. 9 # of the License or (at your opinion) any later version of the license.
10 # 10 #
20 """ 20 """
21 Created on April 21, 2010 21 Created on April 21, 2010
22 branches controller for pylons 22 branches controller for pylons
23 @author: marcink 23 @author: marcink
24 """ 24 """
25 from pylons import tmpl_context as c, request 25 from pylons import tmpl_context as c
26 from pylons_app.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator 26 from pylons_app.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
27 from pylons_app.lib.base import BaseController, render 27 from pylons_app.lib.base import BaseController, render
28 from pylons_app.lib.utils import OrderedDict
28 from pylons_app.model.hg_model import HgModel 29 from pylons_app.model.hg_model import HgModel
29 import logging 30 import logging
30 log = logging.getLogger(__name__) 31 log = logging.getLogger(__name__)
31 32
32 class BranchesController(BaseController): 33 class BranchesController(BaseController):
37 super(BranchesController, self).__before__() 38 super(BranchesController, self).__before__()
38 39
39 def index(self): 40 def index(self):
40 hg_model = HgModel() 41 hg_model = HgModel()
41 c.repo_info = hg_model.get_repo(c.repo_name) 42 c.repo_info = hg_model.get_repo(c.repo_name)
42 c.repo_branches = {} 43 c.repo_branches = OrderedDict()
43 for name, hash_ in c.repo_info.branches.items(): 44 for name, hash_ in c.repo_info.branches.items():
44 c.repo_branches[name] = c.repo_info.get_changeset(hash_) 45 c.repo_branches[name] = c.repo_info.get_changeset(hash_)
45 46
46 return render('branches/branches.html') 47 return render('branches/branches.html')