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 2012/10/11 21:58:51 UTC

[5/21] git commit: [#4955] Better fix for infinite recursion and minor cleanup + comment on TreesDoc attribute error

[#4955] Better fix for infinite recursion and minor cleanup + comment on TreesDoc attribute error

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

Branch: refs/heads/cj/4942
Commit: 5d253a08abcd52216c138666ed4fcb9ae5a43c93
Parents: 2e95753
Author: Cory Johns <jo...@geek.net>
Authored: Wed Oct 10 20:14:25 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Wed Oct 10 20:16:21 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo.py         |    2 +-
 Allura/allura/model/repo_refresh.py |   13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5d253a08/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index e07de6e..b991629 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -616,7 +616,7 @@ def commitlog(commit_ids, skip=0, limit=sys.maxint):
             else:
                 ci_parents[oid] = run.parent_commit_ids
         for oid in run.parent_commit_ids:
-            if commit_id!=oid:
+            if oid not in seen:
                 _visit(oid)
 
     def _gen_ids(commit_ids, skip, limit):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5d253a08/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 12bf20c..16b8dc1 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -305,11 +305,18 @@ def compute_diffs(repo_id, tree_cache, rhs_ci):
                 yield xx
 
     treedoc = TreesDoc.m.get(_id=rhs_ci._id)
-    if treedoc:
-        rhs_tree_ids = treedoc.tree_ids
-    else:
+
+    # FIXME: There are cases of missing TreesDoc records in production
+    #        that should be fixed, but this is a quick-and-dirty patch
+    #        to at least staunch the bleeding.  A "generate-if-missing"
+    #        fix, and/or, even better, a cleanup / regen sweep plus
+    #        audit to ensure there're no more bugs causing them to be
+    #        missed should be done.
+    if not treedoc:
         return tree_cache
 
+    rhs_tree_ids = treedoc.tree_ids
+
     if rhs_ci.parent_ids:
         lhs_ci = CommitDoc.m.get(_id=rhs_ci.parent_ids[0])
     else: