Changeset - 42f5c36820ef
[Not reviewed]
default
0 3 0
Marcin Kuzminski - 15 years ago 2010-06-14 01:16:57
marcin@python-works.com
few validation bugfixes/ new repo changesets, first commit changesets
3 files changed with 20 insertions and 10 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/changeset.py
Show inline comments
 
@@ -2,6 +2,16 @@
 
# encoding: utf-8
 
# changeset controller for pylons
 
# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
 
from pylons import tmpl_context as c, url
 
from pylons.controllers.util import redirect
 
from pylons_app.lib.auth import LoginRequired
 
from pylons_app.lib.base import BaseController, render
 
from pylons_app.model.hg_model import HgModel
 
from vcs.exceptions import RepositoryError
 
from vcs.nodes import FileNode
 
from vcs.utils import diffs as differ
 
import logging
 
import traceback
 
 
 
# This program is free software; you can redistribute it and/or
 
# modify it under the terms of the GNU General Public License
 
@@ -22,13 +32,6 @@ Created on April 25, 2010
 
changeset controller for pylons
 
@author: marcink
 
"""
 
from pylons import tmpl_context as c
 
from pylons_app.lib.auth import LoginRequired
 
from pylons_app.lib.base import BaseController, render
 
from pylons_app.model.hg_model import HgModel
 
from vcs.utils import diffs as differ
 
import logging
 
from vcs.nodes import FileNode
 

	
 

	
 
log = logging.getLogger(__name__)
 
@@ -41,11 +44,18 @@ class ChangesetController(BaseController
 
        
 
    def index(self, revision):
 
        hg_model = HgModel()
 
        try:
 
        c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision)
 
        except RepositoryError:
 
            log.error(traceback.format_exc())
 
            return redirect(url('hg_home'))
 
        else:
 
            try:
 
        c.changeset_old = c.changeset.parents[0]
 
            except IndexError:
 
                c.changeset_old = None
 
        c.changes = []
 
        
 
                
 
        for node in c.changeset.added:
 
            filenode_old = FileNode(node.path, '')
 
            if filenode_old.is_binary or node.is_binary:
pylons_app/templates/changeset/changeset.html
Show inline comments
 
@@ -26,7 +26,7 @@
 
				<div class="date">${_('Date')}: ${c.changeset.date}</div>
 
				<div class="author">${_('Author')}: ${c.changeset.author}</div>
 
				<div class="message">
 
					${c.changeset.message}
 
					${h.wrap_paragraphs(c.changeset.message)}
 
				</div>
 
			</div>	
 
			<div class="right">
pylons_app/templates/index.html
Show inline comments
 
@@ -36,7 +36,7 @@
 
		    	h.url('summary_home',repo_name=repo['name']))}</td>
 
		    <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
 
	        <td>${h.age(repo['last_change'])}</td>
 
	        <td>${h.link_to('r%s:%s' % (repo['rev'],repo['tip']),
 
	        <td>${h.link_to_if(repo['rev']>=0,'r%s:%s' % (repo['rev'],repo['tip']),
 
		        h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
 
	        	class_="tooltip",
 
		    	tooltip_title=h.tooltip(repo['last_msg']))}</td>
0 comments (0 inline, 0 general)