From allura-commits-return-2691-apmail-incubator-allura-commits-archive=incubator.apache.org@incubator.apache.org Wed Apr 3 17:26:32 2013 Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BBE14FC9C for ; Wed, 3 Apr 2013 17:26:32 +0000 (UTC) Received: (qmail 86571 invoked by uid 500); 3 Apr 2013 17:26:32 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 86474 invoked by uid 500); 3 Apr 2013 17:26:32 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 85985 invoked by uid 99); 3 Apr 2013 17:26:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 17:26:31 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E1107836E70; Wed, 3 Apr 2013 17:26:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Wed, 03 Apr 2013 17:26:46 -0000 Message-Id: <37acc57a0309480993124794809b6e28@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [17/46] git commit: [#6030] Set context on commits during compute_diffs to avoid calling guess_repo [#6030] Set context on commits during compute_diffs to avoid calling guess_repo Signed-off-by: Cory Johns Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/92607ab4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/92607ab4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/92607ab4 Branch: refs/heads/cj/5879 Commit: 92607ab47540f1017f5b78cc1eba4796158170f2 Parents: 39079c5 Author: Cory Johns Authored: Tue Apr 2 14:18:14 2013 +0000 Committer: Cory Johns Committed: Tue Apr 2 14:18:14 2013 +0000 ---------------------------------------------------------------------- Allura/allura/model/repo_refresh.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/92607ab4/Allura/allura/model/repo_refresh.py ---------------------------------------------------------------------- diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py index 539df2a..2e176af 100644 --- a/Allura/allura/model/repo_refresh.py +++ b/Allura/allura/model/repo_refresh.py @@ -94,7 +94,9 @@ def refresh_repo(repo, all_commits=False, notify=True): # with caching. if repo._refresh_precompute: for i, oid in enumerate(commit_ids): - ci = CommitDoc.m.find(dict(_id=oid), validate=False).next() + cid = CommitDoc.m.find(dict(_id=oid), validate=False).next() + ci = mapper(Commit).create(cid, dict(instrument=False)) + ci.set_context(repo) compute_diffs(repo._id, cache, ci) if (i+1) % 100 == 0: log.info('Compute diffs %d: %s', (i+1), ci._id)