Changeset - d5d7c40e8591
[Not reviewed]
beta
0 4 1
Marcin Kuzminski - 14 years ago 2011-07-16 19:30:38
marcin@python-works.com
changelog uses lazy loading of affected files details, in some scenarios this can improve speed
of changelog page dramatically especially for larger repositories.
5 files changed with 44 insertions and 12 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/routing.py
Show inline comments
 
@@ -337,6 +337,10 @@ def make_map(config):
 
    rmap.connect('changelog_home', '/{repo_name:.*}/changelog',
 
                controller='changelog', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('changelog_details', '/{repo_name:.*}/changelog_details/{cs}',
 
                controller='changelog', action='changelog_details',
 
                conditions=dict(function=check_repo))
 

	
 
    rmap.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',
 
                controller='files', revision='tip', f_path='',
 
                conditions=dict(function=check_repo))
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -76,6 +76,11 @@ class ChangelogController(BaseRepoContro
 

	
 
        return render('changelog/changelog.html')
 

	
 
    def changelog_details(self, cs):
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            c.cs = c.rhodecode_repo.get_changeset(cs)
 
            return render('changelog/changelog_details.html')
 

	
 
    def _graph(self, repo, repo_size, size, p):
 
        """
 
        Generates a DAG graph for mercurial
rhodecode/public/css/style.css
Show inline comments
 
@@ -1787,6 +1787,16 @@ white-space:pre-wrap;
 
clear:both;
 
}
 
 
.right .changes .changed_total{
 
border:1px solid #DDD;
 
display:block;
 
float:right;
 
text-align:center;
 
min-width:45px;
 
cursor: pointer;
 
background:#FD8;
 
font-weight: bold;
 
}
 
.right .changes .added,.changed,.removed {
 
border:1px solid #DDD;
 
display:block;
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -59,20 +59,15 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
							<div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
						</div>	
 
						<div class="right">
 
									<div class="changes">
 
									   % 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="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 id="${cs.raw_id}_changes_info" class="changes">
 
                                        <span id="${cs.raw_id}" class="changed_total tooltip" 
 
                                        title="${_('Affected number of files, click to show more details')}">
 
                                        ${len(cs.affected_files)}
 
                                        </span>
 
									</div>					
 
										%if len(cs.parents)>1:
 
										<div class="merge">
 
											${_('merge')}<img alt="merge" src="${h.url("/images/icons/arrow_join.png")}"/>
 
											${_('merge')}<img alt="merge" src="${h.url('/images/icons/arrow_join.png')}"/>
 
										</div>
 
										%endif
 
								   %if cs.parents:							
 
@@ -110,7 +105,7 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
				YAHOO.util.Event.onDOMReady(function(){
 
					
 
                    //Monitor range checkboxes and build a link to changesets
 
                    //ranges
 
                    //ranges 
 
                    var checkboxes = YUD.getElementsByClassName('changeset_range');
 
                    var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
 
                    YUE.on(checkboxes,'click',function(e){      
 
@@ -139,6 +134,15 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
                        }
 
                    });					
 
					
 
                    //Fetch changeset details 
 
                    YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){
 
                    	var id = e.currentTarget.id
 
                    	var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}"
 
                    	var url = url.replace('__CS__',id);
 
                    	ypjax(url,id+'_changes_info',function(){tooltip_activate()});
 
                    });
 
                    
 
                    
 
					function set_canvas(heads) {
 
						var c = document.getElementById('graph_nodes');
 
						var t = document.getElementById('graph_content');
rhodecode/templates/changelog/changelog_details.html
Show inline comments
 
new file 100644
 
% if len(c.cs.affected_files) <= c.affected_files_cut_off:                     
 
<span class="removed tooltip" title="<b>${_('removed')}</b>${h.changed_tooltip(c.cs.removed)}">${len(c.cs.removed)}</span>
 
<span class="changed tooltip" title="<b>${_('changed')}</b>${h.changed_tooltip(c.cs.changed)}">${len(c.cs.changed)}</span>
 
<span class="added tooltip" title="<b>${_('added')}</b>${h.changed_tooltip(c.cs.added)}">${len(c.cs.added)}</span>
 
% else:
 
 <span class="removed tooltip" title="${_('affected %s files') % len(c.cs.affected_files)}">!</span>
 
 <span class="changed tooltip" title="${_('affected %s files') % len(c.cs.affected_files)}">!</span>
 
 <span class="added tooltip"   title="${_('affected %s files') % len(c.cs.affected_files)}">!</span>                                         
 
% endif
 
\ No newline at end of file
0 comments (0 inline, 0 general)