Show More
@@ -45,7 +45,8 b' from rhodecode.lib.vcs.backends.base imp' | |||||
45 | from rhodecode.lib.vcs.conf import settings |
|
45 | from rhodecode.lib.vcs.conf import settings | |
46 | from rhodecode.lib.vcs.exceptions import RepositoryError, \ |
|
46 | from rhodecode.lib.vcs.exceptions import RepositoryError, \ | |
47 | ChangesetDoesNotExistError, EmptyRepositoryError, \ |
|
47 | ChangesetDoesNotExistError, EmptyRepositoryError, \ | |
48 | ImproperArchiveTypeError, VCSError, NodeAlreadyExistsError |
|
48 | ImproperArchiveTypeError, VCSError, NodeAlreadyExistsError,\ | |
|
49 | NodeDoesNotExistError | |||
49 | from rhodecode.lib.vcs.nodes import FileNode |
|
50 | from rhodecode.lib.vcs.nodes import FileNode | |
50 |
|
51 | |||
51 | from rhodecode.model.repo import RepoModel |
|
52 | from rhodecode.model.repo import RepoModel | |
@@ -160,7 +161,8 b' class FilesController(BaseRepoController' | |||||
160 | c.file_changeset = (c.changeset |
|
161 | c.file_changeset = (c.changeset | |
161 | if c.changeset.revision < _hist[0].revision |
|
162 | if c.changeset.revision < _hist[0].revision | |
162 | else _hist[0]) |
|
163 | else _hist[0]) | |
163 |
c.file_history = self._get_node_history( |
|
164 | c.file_history = self._get_node_history(c.changeset, f_path, | |
|
165 | _hist) | |||
164 | c.authors = [] |
|
166 | c.authors = [] | |
165 | for a in set([x.author for x in _hist]): |
|
167 | for a in set([x.author for x in _hist]): | |
166 | c.authors.append((h.email(a), h.person(a))) |
|
168 | c.authors.append((h.email(a), h.person(a))) | |
@@ -504,10 +506,21 b' class FilesController(BaseRepoController' | |||||
504 | return render('files/file_diff.html') |
|
506 | return render('files/file_diff.html') | |
505 |
|
507 | |||
506 | def _get_node_history(self, cs, f_path, changesets=None): |
|
508 | def _get_node_history(self, cs, f_path, changesets=None): | |
507 | if cs is None: |
|
509 | """ | |
508 | # if we pass empty CS calculate history based on tip |
|
510 | get changesets history for given node | |
509 | cs = c.rhodecode_repo.get_changeset() |
|
511 | ||
|
512 | :param cs: changeset to calculate history | |||
|
513 | :param f_path: path for node to calculate history for | |||
|
514 | :param changesets: if passed don't calculate history and take | |||
|
515 | changesets defined in this list | |||
|
516 | """ | |||
|
517 | # calculate history based on tip | |||
|
518 | tip_cs = c.rhodecode_repo.get_changeset() | |||
510 | if changesets is None: |
|
519 | if changesets is None: | |
|
520 | try: | |||
|
521 | changesets = tip_cs.get_file_history(f_path) | |||
|
522 | except NodeDoesNotExistError: | |||
|
523 | #this node is not present at tip ! | |||
511 | changesets = cs.get_file_history(f_path) |
|
524 | changesets = cs.get_file_history(f_path) | |
512 |
|
525 | |||
513 | hist_l = [] |
|
526 | hist_l = [] |
@@ -80,7 +80,7 b' var ypjax_links = function(){' | |||||
80 | History.pushState(data, title, url); |
|
80 | History.pushState(data, title, url); | |
81 |
|
81 | |||
82 | //now we're sure that we can do ypjax things |
|
82 | //now we're sure that we can do ypjax things | |
83 | YUE.preventDefault(e) |
|
83 | YUE.preventDefault(e); | |
84 | return false; |
|
84 | return false; | |
85 | }); |
|
85 | }); | |
86 | } |
|
86 | } |
General Comments 0
You need to be logged in to leave comments.
Login now