changeset 566:7fcc539e20b1

large initial commits fixup little template fix
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 10 Oct 2010 00:13:03 +0200
parents ad2e97c6f17f
children 80dc0a23edf7
files rhodecode/controllers/changeset.py rhodecode/templates/changelog/changelog.html
diffstat 2 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/changeset.py	Sat Oct 09 17:53:15 2010 +0200
+++ b/rhodecode/controllers/changeset.py	Sun Oct 10 00:13:03 2010 +0200
@@ -16,6 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 # MA  02110-1301, USA.
+from rhodecode.lib.utils import EmptyChangeset
 """
 Created on April 25, 2010
 changeset controller for pylons
@@ -45,7 +46,7 @@
         
     def index(self, revision):
         hg_model = HgModel()
-        cut_off_limit = 1024 * 100
+        cut_off_limit = 1024 * 250
         
         def wrap_to_table(str):
             
@@ -74,7 +75,7 @@
             c.sum_added = 0
             for node in c.changeset.added:
                 
-                filenode_old = FileNode(node.path, '')
+                filenode_old = FileNode(node.path, '', EmptyChangeset())
                 if filenode_old.is_binary or node.is_binary:
                     diff = wrap_to_table(_('binary file'))
                 else:
@@ -82,6 +83,7 @@
                     if c.sum_added < cut_off_limit:
                         f_udiff = differ.get_udiff(filenode_old, node)
                         diff = differ.DiffProcessor(f_udiff).as_html()
+                                                    
                     else:
                         diff = wrap_to_table(_('Changeset is to big and was cut'
                                             ' off, see raw changeset instead'))
@@ -98,19 +100,22 @@
                 try:
                     filenode_old = c.changeset_old.get_node(node.path)
                 except ChangesetError:
-                    filenode_old = FileNode(node.path, '')
+                    filenode_old = FileNode(node.path, '', EmptyChangeset())
                     
                 if filenode_old.is_binary or node.is_binary:
                     diff = wrap_to_table(_('binary file'))
                 else:
-                    c.sum_removed += node.size
+                    
                     if c.sum_removed < cut_off_limit:
                         f_udiff = differ.get_udiff(filenode_old, node)
                         diff = differ.DiffProcessor(f_udiff).as_html()
+                        if diff:
+                            c.sum_removed += len(diff)
                     else:
                         diff = wrap_to_table(_('Changeset is to big and was cut'
                                             ' off, see raw changeset instead'))
-
+                
+                
                 cs1 = filenode_old.last_changeset.short_id
                 cs2 = node.last_changeset.short_id                    
                 c.changes.append(('changed', node, diff, cs1, cs2))
--- a/rhodecode/templates/changelog/changelog.html	Sat Oct 09 17:53:15 2010 +0200
+++ b/rhodecode/templates/changelog/changelog.html	Sun Oct 10 00:13:03 2010 +0200
@@ -66,12 +66,17 @@
 										<div class="merge">
 											${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
 										</div>
-										%endif						
+										%endif
+								   %if cs.parents:							
 									%for p_cs in reversed(cs.parents):
 										<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
 											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
 										</div>
 									%endfor
+								   %else:	
+                                        <div class="parent">${_('No parents')}</div>   
+                                   %endif  
+                    									
 								<span class="logtags">
 									<span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
 									${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}</span>