Mercurial > kallithea
changeset 1232:0dc8d578ff49
merges for stable
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 09 Apr 2011 18:38:18 +0200 |
parents | 9f6560667743 |
children | d15669d9df78 |
files | docs/changelog.rst rhodecode/controllers/feed.py rhodecode/controllers/files.py rhodecode/controllers/home.py rhodecode/templates/base/base.html rhodecode/templates/changelog/changelog.html rhodecode/templates/changeset/changeset.html rhodecode/templates/files/files_annotate.html rhodecode/templates/files/files_browser.html rhodecode/templates/files/files_source.html |
diffstat | 10 files changed, 62 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/changelog.rst Sat Apr 09 17:13:15 2011 +0200 +++ b/docs/changelog.rst Sat Apr 09 18:38:18 2011 +0200 @@ -26,7 +26,7 @@ - windows fixes for os.kill #133 - fixes path splitting for windows issues #148 - fixed issue #143 wrong import on migration to 1.1.X - +- fixed problems with displaying binary files, thanks to Thomas Waldmann 1.1.7 (**2011-03-23**) ======================
--- a/rhodecode/controllers/feed.py Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/controllers/feed.py Sat Apr 09 18:38:18 2011 +0200 @@ -4,10 +4,10 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~ Feed controller for rhodecode - + :created_on: Apr 23, 2010 :author: marcink - :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> :license: GPLv3, see COPYING for more details. """ # This program is free software: you can redistribute it and/or modify
--- a/rhodecode/controllers/files.py Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/controllers/files.py Sat Apr 09 18:38:18 2011 +0200 @@ -7,7 +7,7 @@ :created_on: Apr 21, 2010 :author: marcink - :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> + :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> :license: GPLv3, see COPYING for more details. """ # This program is free software: you can redistribute it and/or modify @@ -45,6 +45,7 @@ log = logging.getLogger(__name__) + class FilesController(BaseController): @LoginRequired() @@ -58,7 +59,7 @@ """ Safe way to get changeset if error occur it redirects to tip with proper message - + :param rev: revision to fetch :param repo_name: repo name to redirect after """ @@ -228,10 +229,11 @@ return diff.raw_diff() elif c.action == 'diff': - if node1.size > self.cut_off_limit or node2.size > self.cut_off_limit: - c.cur_diff = _('Diff is to big to display') - elif node1.is_binary or node2.is_binary: + if node1.is_binary or node2.is_binary: c.cur_diff = _('Binary file') + elif node1.size > self.cut_off_limit or \ + node2.size > self.cut_off_limit: + c.cur_diff = _('Diff is too big to display') else: c.cur_diff = diff.as_html() else:
--- a/rhodecode/controllers/home.py Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/controllers/home.py Sat Apr 09 18:38:18 2011 +0200 @@ -4,10 +4,10 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~ Home controller for Rhodecode - + :created_on: Feb 18, 2010 :author: marcink - :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> :license: GPLv3, see COPYING for more details. """ # This program is free software: you can redistribute it and/or modify
--- a/rhodecode/templates/base/base.html Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/templates/base/base.html Sat Apr 09 18:38:18 2011 +0200 @@ -85,7 +85,10 @@ <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner"> <div> <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p> - <p class="footer-link-right"><a href="${h.url('rhodecode_official')}">RhodeCode</a> ${c.rhodecode_version} © 2010-2011 by Marcin Kuzminski</p> + <p class="footer-link-right"> + <a href="${h.url('rhodecode_official')}">RhodeCode</a> + ${c.rhodecode_version} © 2010-${h.datetime.today().year} by Marcin Kuzminski + </p> </div> </div> <script type="text/javascript">
--- a/rhodecode/templates/changelog/changelog.html Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/templates/changelog/changelog.html Sat Apr 09 18:38:18 2011 +0200 @@ -32,16 +32,15 @@ </div> <div id="graph_content"> <div class="container_header"> - - ${h.form(h.url.current(),method='get')} - <div class="info_box"> - <span>${_('Show')}:</span> - ${h.text('size',size=1,value=c.size)} - <span>${_('revisions')}</span> - ${h.submit('set',_('set'))} - </div> - ${h.end_form()} - + ${h.form(h.url.current(),method='get')} + <div class="info_box"> + <span>${_('Show')}:</span> + ${h.text('size',size=1,value=c.size)} + <span>${_('revisions')}</span> + ${h.submit('set',_('set'))} + + </div> + ${h.end_form()} </div> %for cnt,cs in enumerate(c.pagination): <div id="chg_${cnt+1}" class="container"> @@ -97,7 +96,7 @@ </div> </div> - <script type="text/javascript" src="${h.url("/js/graph.js")}"></script> + <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> <script type="text/javascript"> YAHOO.util.Event.onDOMReady(function(){ function set_canvas() {
--- a/rhodecode/templates/changeset/changeset.html Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/templates/changeset/changeset.html Sat Apr 09 18:38:18 2011 +0200 @@ -1,3 +1,5 @@ +## -*- coding: utf-8 -*- + <%inherit file="/base/base.html"/> <%def name="title()"> @@ -81,7 +83,7 @@ <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span> <div class="cs_files"> %for change,filenode,diff,cs1,cs2 in c.changes: - <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div> + <div class="cs_${change}">${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.repo_name_slug('CHANGE-%s' % h.safe_unicode(filenode.path))))}</div> %endfor </div> </div> @@ -92,19 +94,19 @@ %if change !='removed': <div style="clear:both;height:10px"></div> <div id="body" class="diffblock"> - <div id="${'CHANGE-%s'%filenode.path}" class="code-header"> + <div id="${h.repo_name_slug('CHANGE-%s' % h.safe_unicode(filenode.path))}" class="code-header"> <div class="changeset_header"> <span class="changeset_file"> - ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name, - revision=filenode.changeset.raw_id,f_path=filenode.path))} + ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, + revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} </span> %if 1: » <span>${h.link_to(_('diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span> + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))}</span> » <span>${h.link_to(_('raw diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span> + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</span> » <span>${h.link_to(_('download diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span> + h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))}</span> %endif </div> </div>
--- a/rhodecode/templates/files/files_annotate.html Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/templates/files/files_annotate.html Sat Apr 09 18:38:18 2011 +0200 @@ -51,8 +51,8 @@ ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} ${h.hidden('diff2',c.file.last_changeset.raw_id)} ${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)} - ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} - ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} + ${h.submit('diff','diff to revision',class_="ui-button")} + ${h.submit('show_rev','show at revision',class_="ui-button")} ${h.end_form()} </div> </dd> @@ -63,24 +63,28 @@ <div class="commit">"${c.file.message}"</div> </div> <div class="code-body"> + %if c.file.is_binary: + ${_('Binary file')} + %else: % if c.file.size < c.cut_off_limit: - ${h.pygmentize_annotation(c.file,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} + ${h.pygmentize_annotation(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} %else: ${_('File is to big to display')} ${h.link_to(_('show as raw'), h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.revision,f_path=c.f_path))} - %endif + %endif + <script type="text/javascript"> + YAHOO.util.Event.onDOMReady(function(){ + YAHOO.util.Event.addListener('show_rev','click',function(e){ + YAHOO.util.Event.preventDefault(e); + var cs = YAHOO.util.Dom.get('diff1').value; + var url = "${h.url('files_annotate_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); + window.location = url; + }); + }); + </script> + %endif </div> </div> - <script type="text/javascript"> - YAHOO.util.Event.onDOMReady(function(){ - YAHOO.util.Event.addListener('show_rev','click',function(e){ - YAHOO.util.Event.preventDefault(e); - var cs = YAHOO.util.Dom.get('diff1').value; - var url = "${h.url('files_annotate_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); - window.location = url; - }); - }); - </script> </div> </div> </div>
--- a/rhodecode/templates/files/files_browser.html Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/templates/files/files_browser.html Sat Apr 09 18:38:18 2011 +0200 @@ -49,7 +49,7 @@ %for cnt,node in enumerate(c.files_list): <tr class="parity${cnt%2}"> <td> - ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=node.path),class_=file_class(node))} + ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node))} </td> <td> %if node.is_file(): @@ -64,7 +64,7 @@ <td> %if node.is_file(): <span class="tooltip" title="${node.last_changeset.raw_id}"> - ${node.last_changeset.revision}</span> + ${'r%s:%s' % (node.last_changeset.revision,node.last_changeset.short_id)}</span> %endif </td> <td>
--- a/rhodecode/templates/files/files_source.html Sat Apr 09 17:13:15 2011 +0200 +++ b/rhodecode/templates/files/files_source.html Sat Apr 09 18:38:18 2011 +0200 @@ -22,8 +22,8 @@ ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} ${h.hidden('diff2',c.files_list.last_changeset.raw_id)} ${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)} - ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} - ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")} + ${h.submit('diff','diff to revision',class_="ui-button")} + ${h.submit('show_rev','show at revision',class_="ui-button")} ${h.end_form()} </div> </dd> @@ -36,12 +36,16 @@ <div class="commit">"${c.files_list.last_changeset.message}"</div> </div> <div class="code-body"> + %if c.files_list.is_binary: + ${_('Binary file')} + %else: % if c.files_list.size < c.cut_off_limit: - ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")} + ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} %else: ${_('File is to big to display')} ${h.link_to(_('show as raw'), h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} %endif + %endif </div> </div>