You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2018/01/31 15:13:58 UTC
[2/2] allura git commit: Handle repo's upstream fork being gone,
rather than whole sidebar being blank
Handle repo's upstream fork being gone, rather than whole sidebar being blank
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e7aa4c2a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e7aa4c2a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e7aa4c2a
Branch: refs/heads/master
Commit: e7aa4c2a006bd82e5f7efee46121ffc205878ffd
Parents: 36dd280
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Jan 30 17:34:32 2018 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Jan 30 17:34:43 2018 -0500
----------------------------------------------------------------------
Allura/allura/lib/repository.py | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e7aa4c2a/Allura/allura/lib/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index dc0b46a..d89f4c2 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -141,7 +141,18 @@ class RepositoryApp(Application):
SitemapEntry('Forks', c.app.url + 'forks/',
small=len(self.repo.forks))
]
+
+ has_upstream_repo = False
if self.repo.upstream_repo.name:
+ try:
+ self.repo.push_upstream_context()
+ except Exception:
+ log.warn('Could not get upstream repo (perhaps it is gone) for: %s %s',
+ self.repo, self.repo.upstream_repo.name, exc_info=True)
+ else:
+ has_upstream_repo = True
+
+ if has_upstream_repo:
repo_path_parts = self.repo.upstream_repo.name.strip(
'/').split('/')
links += [