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/03/12 21:04:51 UTC

[1/50] [abbrv] 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/a997dbd7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a997dbd7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a997dbd7

Branch: refs/heads/si/5453
Commit: a997dbd70cb57d4b0be2190877d4ee2785bcbfe5
Parents: 368bea0
Author: Cory Johns <jo...@geek.net>
Authored: Fri Mar 1 20:13:02 2013 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Thu Mar 7 17:47:23 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/a997dbd7/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'],
                             ),