Mercurial > public > src > rhodecode
comparison pylons_app/controllers/files.py @ 128:9deb6f1d5b90
Implemented file history.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 03 May 2010 21:59:01 +0200 |
parents | a86c8de926b4 |
children | 42d46deb124d |
comparison
equal
deleted
inserted
replaced
127:20dc7a5eb748 | 128:9deb6f1d5b90 |
---|---|
20 c.f_path = f_path | 20 c.f_path = f_path |
21 c.changeset = repo.get_changeset(repo._get_revision(revision)) | 21 c.changeset = repo.get_changeset(repo._get_revision(revision)) |
22 | 22 |
23 c.files_list = c.changeset.get_node(f_path) | 23 c.files_list = c.changeset.get_node(f_path) |
24 | 24 |
25 return render('/files.html') | 25 c.file_history = self._get_history(repo, c.files_list, f_path) |
26 return render('files/files.html') | |
27 | |
28 | |
29 def _get_history(self, repo, node, f_path): | |
30 from vcs.nodes import NodeKind | |
31 if not node.kind is NodeKind.FILE: | |
32 return [] | |
33 changesets = list(node.history) | |
34 changesets.reverse() | |
35 hist_l = [] | |
36 for chs in changesets: | |
37 n_desc = 'r%s:%s' % (chs.revision, chs._short) | |
38 hist_l.append((chs._short, n_desc,)) | |
39 return hist_l |