Changeset - 1cecc7db3106
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 15 years ago 2011-03-13 13:38:07
marcin@python-works.com
fixed some limits in changesets and changelogs
4 files changed with 28 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -49,6 +49,7 @@ class ChangelogController(BaseRepoContro
 
                                   'repository.admin')
 
    def __before__(self):
 
        super(ChangelogController, self).__before__()
 
        c.affected_files_cut_off = 60
 

	
 
    def index(self):
 
        limit = 100
rhodecode/controllers/changeset.py
Show inline comments
 
@@ -52,6 +52,7 @@ class ChangesetController(BaseRepoContro
 
                                   'repository.admin')
 
    def __before__(self):
 
        super(ChangesetController, self).__before__()
 
        c.affected_files_cut_off = 60
 

	
 
    def index(self, revision):
 

	
 
@@ -66,7 +67,7 @@ class ChangesetController(BaseRepoContro
 

	
 
        #get ranges of revisions if preset
 
        rev_range = revision.split('...')[:2]
 
        range_limit = 50
 

	
 
        try:
 
            if len(rev_range) == 2:
 
                rev_start = rev_range[0]
 
@@ -86,7 +87,7 @@ class ChangesetController(BaseRepoContro
 
        c.changes = OrderedDict()
 
        c.sum_added = 0
 
        c.sum_removed = 0
 

	
 
        c.cut_off = False
 

	
 
        for changeset in c.cs_ranges:
 
            c.changes[changeset.raw_id] = []
 
@@ -112,6 +113,8 @@ class ChangesetController(BaseRepoContro
 
                    else:
 
                        diff = wrap_to_table(_('Changeset is to big and was cut'
 
                                            ' off, see raw changeset instead'))
 
                        c.cut_off = True
 
                        break
 

	
 
                cs1 = None
 
                cs2 = node.last_changeset.raw_id
 
@@ -120,6 +123,7 @@ class ChangesetController(BaseRepoContro
 
            #==================================================================
 
            # CHANGED FILES
 
            #==================================================================
 
            if not c.cut_off:
 
            for node in changeset.changed:
 
                try:
 
                    filenode_old = changeset_parent.get_node(node.path)
 
@@ -138,7 +142,8 @@ class ChangesetController(BaseRepoContro
 
                    else:
 
                        diff = wrap_to_table(_('Changeset is to big and was cut'
 
                                            ' off, see raw changeset instead'))
 

	
 
                            c.cut_off = True
 
                            break
 

	
 
                cs1 = filenode_old.last_changeset.raw_id
 
                cs2 = node.last_changeset.raw_id
 
@@ -147,6 +152,7 @@ class ChangesetController(BaseRepoContro
 
            #==================================================================
 
            # REMOVED FILES    
 
            #==================================================================
 
            if not c.cut_off:
 
            for node in changeset.removed:
 
                c.changes[changeset.raw_id].append(('removed', node, None, None, None))
 

	
 
@@ -180,7 +186,7 @@ class ChangesetController(BaseRepoContro
 
                    diff = _('binary file') + '\n'
 
                else:
 
                    f_gitdiff = differ.get_gitdiff(filenode_old, node)
 
                    diff = differ.DiffProcessor(f_gitdiff).raw_diff()
 
                    diff = differ.DiffProcessor(f_gitdiff, format='gitdiff').raw_diff()
 

	
 
                cs1 = None
 
                cs2 = node.last_changeset.raw_id
 
@@ -192,7 +198,7 @@ class ChangesetController(BaseRepoContro
 
                    diff = _('binary file')
 
                else:
 
                    f_gitdiff = differ.get_gitdiff(filenode_old, node)
 
                    diff = differ.DiffProcessor(f_gitdiff).raw_diff()
 
                    diff = differ.DiffProcessor(f_gitdiff, format='gitdiff').raw_diff()
 

	
 
                cs1 = filenode_old.last_changeset.raw_id
 
                cs2 = node.last_changeset.raw_id
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -62,12 +62,14 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
						</div>	
 
						<div class="right">
 
									<div class="changes">
 
									   % if len(cs.affected_files) <= 30:								
 
									   % if len(cs.affected_files) <= c.affected_files_cut_off:						
 
										<span class="removed tooltip" title="<b>${_('removed')}</b>${h.changed_tooltip(cs.removed)}">${len(cs.removed)}</span>
 
										<span class="changed tooltip" title="<b>${_('changed')}</b>${h.changed_tooltip(cs.changed)}">${len(cs.changed)}</span>
 
										<span class="added tooltip" title="<b>${_('added')}</b>${h.changed_tooltip(cs.added)}">${len(cs.added)}</span>
 
									   % else:
 
									     <span class="large tooltip" title="${_('affected %s files') % len(cs.affected_files)}">${len(cs.affected_files)}</span>
 
				                         <span class="removed tooltip" title="${_('affected %s files') % len(cs.affected_files)}">!</span>
 
				                         <span class="changed tooltip" title="${_('affected %s files') % len(cs.affected_files)}">!</span>
 
				                         <span class="added tooltip"   title="${_('affected %s files') % len(cs.affected_files)}">!</span>  									   
 
									   % endif
 
									</div>					
 
										%if len(cs.parents)>1:
rhodecode/templates/changeset/changeset.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
@@ -49,9 +51,15 @@
 
	             </div>
 
	             <div class="right">
 
		             <div class="changes">
 
                        % if len(c.changeset.affected_files) <= c.affected_files_cut_off:	             
 
		                 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
 
		                 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
 
		                 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span>
 
	                    % else:
 
                         <span class="removed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span>
 
                         <span class="changed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span>
 
                         <span class="added"   title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span>	                    
 
	                    % endif		                 
 
		             </div>                  
 
		                 %if len(c.changeset.parents)>1:
 
		                 <div class="merge">
 
@@ -78,11 +86,14 @@
 
		         </span>                                                                 
 
	                </div>              
 
	        </div>
 
	        <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
 
	        <span style="font-size:1.1em;font-weight: bold">${_('Files affected (%s)' % len(c.changeset.affected_files))}</span>
 
	        <div class="cs_files">
 
	                %for change,filenode,diff,cs1,cs2 in c.changes:
 
	                    <div class="cs_${change}">${h.link_to(filenode.path.decode('utf-8','replace'),h.url.current(anchor=h.repo_name_slug('C%s' % filenode.path.decode('utf-8','replace'))))}</div>
 
	                %endfor
 
	                % if c.cut_off:
 
	                  ${_('Changeset was to big and was cut off...')}
 
	                % endif
 
	        </div>         
 
	    </div>
 
	    
0 comments (0 inline, 0 general)