Show More
@@ -2,7 +2,7 b'' | |||||
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 | |
@@ -22,9 +22,10 b' 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 |
|
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__) | |
@@ -39,7 +40,7 b' class BranchesController(BaseController)' | |||||
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 |
@@ -55,11 +55,11 b' class SummaryController(BaseController):' | |||||
55 | 'host':e.get('HTTP_HOST'), |
|
55 | 'host':e.get('HTTP_HOST'), | |
56 | 'repo_name':c.repo_name, } |
|
56 | 'repo_name':c.repo_name, } | |
57 | c.clone_repo_url = uri |
|
57 | c.clone_repo_url = uri | |
58 |
c.repo_tags = |
|
58 | c.repo_tags = OrderedDict() | |
59 | for name, hash in c.repo_info.tags.items()[:10]: |
|
59 | for name, hash in c.repo_info.tags.items()[:10]: | |
60 | c.repo_tags[name] = c.repo_info.get_changeset(hash) |
|
60 | c.repo_tags[name] = c.repo_info.get_changeset(hash) | |
61 |
|
61 | |||
62 |
c.repo_branches = |
|
62 | c.repo_branches = OrderedDict() | |
63 | for name, hash in c.repo_info.branches.items()[:10]: |
|
63 | for name, hash in c.repo_info.branches.items()[:10]: | |
64 | c.repo_branches[name] = c.repo_info.get_changeset(hash) |
|
64 | c.repo_branches[name] = c.repo_info.get_changeset(hash) | |
65 |
|
65 |
@@ -2,7 +2,7 b'' | |||||
2 | # encoding: utf-8 |
|
2 | # encoding: utf-8 | |
3 | # tags controller for pylons |
|
3 | # tags 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 | |
@@ -22,9 +22,10 b' Created on April 21, 2010' | |||||
22 | tags controller for pylons |
|
22 | tags controller for pylons | |
23 | @author: marcink |
|
23 | @author: marcink | |
24 | """ |
|
24 | """ | |
25 |
from pylons import tmpl_context as c |
|
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__) | |
@@ -39,8 +40,8 b' class TagsController(BaseController):' | |||||
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_tags = |
|
43 | c.repo_tags = OrderedDict() | |
43 | for name, hash in c.repo_info.tags.items(): |
|
44 | for name, hash_ in c.repo_info.tags.items(): | |
44 | c.repo_tags[name] = c.repo_info.get_changeset(hash) |
|
45 | c.repo_tags[name] = c.repo_info.get_changeset(hash_) | |
45 |
|
46 | |||
46 | return render('tags/tags.html') |
|
47 | return render('tags/tags.html') |
General Comments 0
You need to be logged in to leave comments.
Login now