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/28 23:09:52 UTC

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

Updated Branches:
  refs/heads/cj/5978 fc6c1af16 -> 7c77617e5


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

Branch: refs/heads/cj/5978
Commit: 7c77617e5541dede61807662a9e1abb16deebd09
Parents: fc6c1af
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Mar 28 22:09:19 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu Mar 28 22:09:38 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/7c77617e/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/7c77617e/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)