Show More
@@ -8,7 +8,7 b' from pylons_app.lib.utils import get_rep' | |||
|
8 | 8 | from pylons_app.model.hg_model import HgModel |
|
9 | 9 | from difflib import unified_diff |
|
10 | 10 | from pylons_app.lib.differ import render_udiff |
|
11 | from vcs.exceptions import RepositoryError | |
|
11 | from vcs.exceptions import RepositoryError, ChangesetError | |
|
12 | 12 | |
|
13 | 13 | log = logging.getLogger(__name__) |
|
14 | 14 | |
@@ -18,9 +18,18 b' class FilesController(BaseController):' | |||
|
18 | 18 | c.repo_name = get_repo_slug(request) |
|
19 | 19 | |
|
20 | 20 | def index(self, repo_name, revision, f_path): |
|
21 | revision = request.POST.get('at_rev', None) or revision | |
|
22 | 21 | hg_model = HgModel() |
|
23 | 22 | c.repo = repo = hg_model.get_repo(c.repo_name) |
|
23 | ||
|
24 | revision = request.POST.get('at_rev', None) or revision | |
|
25 | if request.POST.get('view_low'): | |
|
26 | revision = int(revision) - 1 | |
|
27 | if request.POST.get('view_high'): | |
|
28 | revision = int(revision) + 1 | |
|
29 | max_rev = len(c.repo.revisions) - 1 | |
|
30 | if revision > max_rev: | |
|
31 | revision = max_rev | |
|
32 | ||
|
24 | 33 | c.f_path = f_path |
|
25 | 34 | try: |
|
26 | 35 | c.changeset = repo.get_changeset(repo._get_revision(revision)) |
@@ -28,7 +37,7 b' class FilesController(BaseController):' | |||
|
28 | 37 | c.rev_nr = c.changeset.revision |
|
29 | 38 | c.files_list = c.changeset.get_node(f_path) |
|
30 | 39 | c.file_history = self._get_history(repo, c.files_list, f_path) |
|
31 | except RepositoryError: | |
|
40 | except (RepositoryError, ChangesetError): | |
|
32 | 41 | c.files_list = None |
|
33 | 42 | |
|
34 | 43 | return render('files/files.html') |
@@ -28,7 +28,6 b'' | |||
|
28 | 28 | %for cnt,branch in enumerate(c.repo_branches): |
|
29 | 29 | <tr class="parity${cnt%2}"> |
|
30 | 30 | <td>${branch._ctx.date()|n,filters.age}</td> |
|
31 | <td></td> | |
|
32 | 31 | <td> |
|
33 | 32 | <span class="logtags"> |
|
34 | 33 | <span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span> |
@@ -36,7 +36,7 b'' | |||
|
36 | 36 | <%include file='files_source.html'/> |
|
37 | 37 | %endif |
|
38 | 38 | %else: |
|
39 | <h2>${_('No files')}</h2> | |
|
39 | <h2><a href="#" onClick="javascript:parent.history.back();" target="main">${_('Go back')}</a> ${_('No files at given path')}: "${c.f_path or "/"}" </h2> | |
|
40 | 40 | %endif |
|
41 | 41 | |
|
42 | 42 | </div> |
@@ -8,7 +8,7 b'' | |||
|
8 | 8 | <div id="body" class="browserblock"> |
|
9 | 9 | <div class="browser-header"> |
|
10 | 10 | ${h.form(h.url.current())} |
|
11 |
<span>${_('view')}@rev |
|
|
11 | <span>${_('view')}@rev ${h.submit('view_low','-')}${h.text('at_rev',value=c.rev_nr,size='5')}${h.submit('view_high','+')}</span> | |
|
12 | 12 | ${h.submit('view','view')} |
|
13 | 13 | ${h.end_form()} |
|
14 | 14 | </div> |
@@ -30,7 +30,6 b' from pylons_app.lib import filters' | |||
|
30 | 30 | %for cnt,tag in enumerate(c.repo_tags): |
|
31 | 31 | <tr class="parity${cnt%2}"> |
|
32 | 32 | <td>${tag._ctx.date()|n,filters.age}</td> |
|
33 | <td></td> | |
|
34 | 33 | <td> |
|
35 | 34 | <span class="logtags"> |
|
36 | 35 | <span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span> |
General Comments 0
You need to be logged in to leave comments.
Login now