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