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 2013/03/07 16:30:54 UTC

[4/5] git commit: [#5854] Make Tree._lcd_map handle bad LastCommit entries better

[#5854] Make Tree._lcd_map handle bad LastCommit entries better

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

Branch: refs/heads/cj/5854
Commit: b9587cc3f0287e7669986b6317711bcca71cfb63
Parents: 3b753d9
Author: Cory Johns <jo...@geek.net>
Authored: Fri Mar 1 20:13:02 2013 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Thu Mar 7 15:16:18 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b9587cc3/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 668f00e..767b144 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -542,7 +542,9 @@ class Tree(RepoObject):
             for name in names:
                 commit_info = commit_infos.get(lcd.by_name.get(name))
                 if not commit_info:
-                    continue
+                    commit_info = defaultdict(str)
+                elif 'id' in commit_info:
+                    commit_info['href'] = self.repo.url_for_commit(commit_info['id'])
                 results.append(dict(
                         kind=type,
                         name=name,
@@ -552,7 +554,7 @@ class Tree(RepoObject):
                                 author_email=commit_info['author_email'],
                                 author_url=commit_info['author_url'],
                                 date=commit_info['date'],
-                                href=self.repo.url_for_commit(commit_info['id']),
+                                href=commit_info.get('href',''),
                                 shortlink=commit_info['shortlink'],
                                 summary=commit_info['summary'],
                             ),