Changeset - 3f01d02c2cc6
[Not reviewed]
default
0 5 0
Marcin Kuzminski - 16 years ago 2010-05-10 23:12:45
marcin@python-works.com
fixed error when browsing revisions on path that doesn't exist. Fixed files browsing. Fixed templates in branches and tags
5 files changed with 14 insertions and 7 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/files.py
Show inline comments
 
@@ -8,7 +8,7 @@ from pylons_app.lib.utils import get_rep
 
from pylons_app.model.hg_model import HgModel
 
from difflib import unified_diff
 
from pylons_app.lib.differ import render_udiff
 
from vcs.exceptions import RepositoryError
 
from vcs.exceptions import RepositoryError, ChangesetError
 
        
 
log = logging.getLogger(__name__)
 

	
 
@@ -18,9 +18,18 @@ class FilesController(BaseController):
 
        c.repo_name = get_repo_slug(request)
 

	
 
    def index(self, repo_name, revision, f_path):
 
        revision = request.POST.get('at_rev', None) or revision
 
        hg_model = HgModel()
 
        c.repo = repo = hg_model.get_repo(c.repo_name)
 
        
 
        revision = request.POST.get('at_rev', None) or revision
 
        if request.POST.get('view_low'):
 
            revision = int(revision) - 1
 
        if request.POST.get('view_high'):
 
            revision = int(revision) + 1
 
            max_rev = len(c.repo.revisions) - 1
 
            if revision > max_rev:
 
                revision = max_rev
 
                
 
        c.f_path = f_path
 
        try:
 
            c.changeset = repo.get_changeset(repo._get_revision(revision))
 
@@ -28,7 +37,7 @@ class FilesController(BaseController):
 
            c.rev_nr = c.changeset.revision
 
            c.files_list = c.changeset.get_node(f_path)
 
            c.file_history = self._get_history(repo, c.files_list, f_path)
 
        except RepositoryError:
 
        except (RepositoryError, ChangesetError):
 
            c.files_list = None
 
        
 
        return render('files/files.html')
pylons_app/templates/branches/branches.html
Show inline comments
 
@@ -28,7 +28,6 @@
 
		%for cnt,branch in enumerate(c.repo_branches):
 
		<tr class="parity${cnt%2}">
 
			<td>${branch._ctx.date()|n,filters.age}</td>
 
			<td></td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span>
pylons_app/templates/files/files.html
Show inline comments
 
@@ -36,7 +36,7 @@
 
				<%include file='files_source.html'/>			
 
			%endif	
 
	%else:
 
		<h2>${_('No files')}</h2>
 
		<h2><a href="#" onClick="javascript:parent.history.back();" target="main">${_('Go back')}</a> ${_('No files at given path')}: "${c.f_path or "/"}" </h2>
 
	%endif
 

	
 
	</div>
pylons_app/templates/files/files_browser.html
Show inline comments
 
@@ -8,7 +8,7 @@
 
<div id="body" class="browserblock">
 
	<div class="browser-header">
 
		${h.form(h.url.current())}
 
		<span>${_('view')}@rev:${h.text('at_rev',value=c.rev_nr,size='5')}</span>
 
		<span>${_('view')}@rev ${h.submit('view_low','-')}${h.text('at_rev',value=c.rev_nr,size='5')}${h.submit('view_high','+')}</span>
 
		${h.submit('view','view')}
 
		${h.end_form()}
 
	</div>
pylons_app/templates/tags/tags.html
Show inline comments
 
@@ -30,7 +30,6 @@ from pylons_app.lib import filters
 
		%for cnt,tag in enumerate(c.repo_tags):
 
		<tr class="parity${cnt%2}">
 
			<td>${tag._ctx.date()|n,filters.age}</td>
 
			<td></td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span>
0 comments (0 inline, 0 general)