You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/02/05 21:23:35 UTC
[7/42] git commit: [#4691] Fixed blob link in tree browser
[#4691] Fixed blob link in tree browser
Signed-off-by: Cory Johns <jo...@geek.net>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0da93a03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0da93a03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0da93a03
Branch: refs/heads/master
Commit: 0da93a03ffb4c55621de68f46bdb6f340d3f8e7c
Parents: 67b875e
Author: Cory Johns <jo...@geek.net>
Authored: Wed Dec 5 17:27:27 2012 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Feb 5 20:22:50 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/repo.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0da93a03/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 58c5a5a..bb69f77 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -489,7 +489,7 @@ class Tree(RepoObject):
return dict(
kind=dirent.type,
name=dirent.name,
- href=dirent.name + '/',
+ href=dirent.name,
last_commit=dict(
author=dirent.commit_info.author,
author_email=dirent.commit_info.author_email,
@@ -607,11 +607,11 @@ class Blob(object):
@LazyProperty
def prev_commit(self):
- lc = self.repo.get_last_commit(self)
- if lc['id']:
- last_commit = self.repo.commit(lc.id)
- if last_commit.parent_ids:
- return self.repo.commit(last_commit.parent_ids[0])
+ lc = LastCommit.get(self.tree)
+ if lc:
+ entry = lc.entry_by_name(self.name)
+ last_commit = self.repo.commit(entry.commit_info.id)
+ return last_commit.get_parent()
return None
@LazyProperty