changeset 2929:f3b913b76be1 beta

Calculate file history always from latest changeset to always show full history. When doing the calculation from a particular changeset git doesn't any records from parent changesets
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 17 Oct 2012 20:32:25 +0200
parents 0ebdd15de1d8
children a01c5994015c
files rhodecode/controllers/files.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/files.py	Tue Oct 16 23:34:34 2012 +0200
+++ b/rhodecode/controllers/files.py	Wed Oct 17 20:32:25 2012 +0200
@@ -153,9 +153,8 @@
             c.file = c.changeset.get_node(f_path)
 
             if c.file.is_file():
-                _hist = c.changeset.get_file_history(f_path)
-                c.file_history = self._get_node_history(c.changeset, f_path,
-                                                        _hist)
+                _hist = c.rhodecode_repo.get_changeset().get_file_history(f_path)
+                c.file_history = self._get_node_history(None, f_path, _hist)
                 c.authors = []
                 for a in set([x.author for x in _hist]):
                     c.authors.append((h.email(a), h.person(a)))
@@ -487,8 +486,12 @@
         return render('files/file_diff.html')
 
     def _get_node_history(self, cs, f_path, changesets=None):
+        if cs is None:
+            # if we pass empty CS calculate history based on tip
+            cs = c.rhodecode_repo.get_changeset()
         if changesets is None:
             changesets = cs.get_file_history(f_path)
+
         hist_l = []
 
         changesets_group = ([], _("Changesets"))