You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2012/12/05 18:27:47 UTC

[1/34] git commit: [#4691] Fixed blob link in tree browser

Updated Branches:
  refs/heads/cj/4691 9d74e3cb2 -> b3adc276e (forced update)


[#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/b3adc276
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b3adc276
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b3adc276

Branch: refs/heads/cj/4691
Commit: b3adc276e72e31f5ede421b3aac850dd309c2fb9
Parents: b6aefcf
Author: Cory Johns <jo...@geek.net>
Authored: Wed Dec 5 17:27:27 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Wed Dec 5 17:27:27 2012 +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/b3adc276/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 5a7f002..7befb4f 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