You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/03/29 15:30:47 UTC

[2/2] git commit: [#5978] Fixed call to guess_repo in History view and log any other calls as errors

[#5978] Fixed call to guess_repo in History view and log any other calls as errors

Signed-off-by: Cory Johns <cj...@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/34729f5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/34729f5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/34729f5c

Branch: refs/heads/master
Commit: 34729f5cc504c027115f251f91f5ad67b8a286f2
Parents: 789d7b8
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Mar 28 22:09:19 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Mar 29 14:30:15 2013 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34729f5c/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index e110e10..bbfb307 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -470,7 +470,11 @@ class CommitBrowser(BaseController):
         next_commit = None
         if len(commits) > limit:
             next_commit = M.repo.Commit.query.get(_id=commits.pop())
-        revisions = sorted(M.repo.Commit.query.find({'_id': {'$in': commits}}), key=lambda c:commits.index(c._id))
+            next_commit.set_context(c.app.repo)
+        revisions = list(M.repo.Commit.query.find({'_id': {'$in': commits}}))
+        for commit in revisions:
+            commit.set_context(c.app.repo)
+        revisions = sorted(revisions, key=lambda c:commits.index(c._id))
         c.log_widget = self.log_widget
         return dict(
             username=c.user._id and c.user.username,

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34729f5c/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 40f4567..85fa875 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -231,6 +231,8 @@ class Commit(RepoObject):
         return self.repo.url_for_commit(self)
 
     def guess_repo(self):
+        import traceback
+        log.error('guess_repo: should not be called: %s' % ''.join(traceback.format_stack()))
         for ac in c.project.app_configs:
             try:
                 app = c.project.app_instance(ac)