Show More
@@ -2,6 +2,16 b'' | |||
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | # changeset controller for pylons |
|
4 | 4 | # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> |
|
5 | from pylons import tmpl_context as c, url | |
|
6 | from pylons.controllers.util import redirect | |
|
7 | from pylons_app.lib.auth import LoginRequired | |
|
8 | from pylons_app.lib.base import BaseController, render | |
|
9 | from pylons_app.model.hg_model import HgModel | |
|
10 | from vcs.exceptions import RepositoryError | |
|
11 | from vcs.nodes import FileNode | |
|
12 | from vcs.utils import diffs as differ | |
|
13 | import logging | |
|
14 | import traceback | |
|
5 | 15 | |
|
6 | 16 | # This program is free software; you can redistribute it and/or |
|
7 | 17 | # modify it under the terms of the GNU General Public License |
@@ -22,13 +32,6 b' Created on April 25, 2010' | |||
|
22 | 32 | changeset controller for pylons |
|
23 | 33 | @author: marcink |
|
24 | 34 | """ |
|
25 | from pylons import tmpl_context as c | |
|
26 | from pylons_app.lib.auth import LoginRequired | |
|
27 | from pylons_app.lib.base import BaseController, render | |
|
28 | from pylons_app.model.hg_model import HgModel | |
|
29 | from vcs.utils import diffs as differ | |
|
30 | import logging | |
|
31 | from vcs.nodes import FileNode | |
|
32 | 35 | |
|
33 | 36 | |
|
34 | 37 | log = logging.getLogger(__name__) |
@@ -41,11 +44,18 b' class ChangesetController(BaseController' | |||
|
41 | 44 | |
|
42 | 45 | def index(self, revision): |
|
43 | 46 | hg_model = HgModel() |
|
47 | try: | |
|
44 | 48 | c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision) |
|
49 | except RepositoryError: | |
|
50 | log.error(traceback.format_exc()) | |
|
51 | return redirect(url('hg_home')) | |
|
52 | else: | |
|
53 | try: | |
|
45 | 54 | c.changeset_old = c.changeset.parents[0] |
|
55 | except IndexError: | |
|
56 | c.changeset_old = None | |
|
46 | 57 | c.changes = [] |
|
47 | 58 | |
|
48 | ||
|
49 | 59 | for node in c.changeset.added: |
|
50 | 60 | filenode_old = FileNode(node.path, '') |
|
51 | 61 | if filenode_old.is_binary or node.is_binary: |
@@ -26,7 +26,7 b'' | |||
|
26 | 26 | <div class="date">${_('Date')}: ${c.changeset.date}</div> |
|
27 | 27 | <div class="author">${_('Author')}: ${c.changeset.author}</div> |
|
28 | 28 | <div class="message"> |
|
29 | ${c.changeset.message} | |
|
29 | ${h.wrap_paragraphs(c.changeset.message)} | |
|
30 | 30 | </div> |
|
31 | 31 | </div> |
|
32 | 32 | <div class="right"> |
@@ -36,7 +36,7 b'' | |||
|
36 | 36 | h.url('summary_home',repo_name=repo['name']))}</td> |
|
37 | 37 | <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td> |
|
38 | 38 | <td>${h.age(repo['last_change'])}</td> |
|
39 | <td>${h.link_to('r%s:%s' % (repo['rev'],repo['tip']), | |
|
39 | <td>${h.link_to_if(repo['rev']>=0,'r%s:%s' % (repo['rev'],repo['tip']), | |
|
40 | 40 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), |
|
41 | 41 | class_="tooltip", |
|
42 | 42 | tooltip_title=h.tooltip(repo['last_msg']))}</td> |
General Comments 0
You need to be logged in to leave comments.
Login now