1. Daniel LaMotte
  2. RhodeCode

Commits

Marcin Kuzminski  committed f3b913b

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

  • Participants
  • Parent commits 0ebdd15
  • Branches beta

Comments (0)

Files changed (1)

File rhodecode/controllers/files.py

View file
             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)))
         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"))