allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [6/7] git commit: [#7305] add a few more repository docstrings
Date Mon, 14 Apr 2014 17:21:37 GMT
[#7305] add a few more repository docstrings


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

Branch: refs/heads/master
Commit: f9536b5107f85c2437738bba28895b71fc2a64e6
Parents: 66f891a
Author: Dave Brondsema <dave@brondsema.net>
Authored: Sat Apr 12 14:06:37 2014 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Apr 14 12:52:03 2014 -0400

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/f9536b51/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 662ec59..5650d35 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1313,6 +1313,12 @@ class Tree(RepoObject):
             return []
 
     def _lcd_map(self, lcd):
+        '''
+        Map "last-commit docs" to the structure that templates expect.
+
+        (This exists because LCD logic changed in the past, whereas templates
+        were not changed)
+        '''
         if lcd is None:
             return []
         commit_ids = [e.commit_id for e in lcd.entries]
@@ -1548,7 +1554,13 @@ class LastCommit(RepoObject):
 class ModelCache(object):
 
     '''
-    Cache model instances based on query params passed to get.
+    Cache model instances based on query params passed to get.  LRU cache.
+
+    This does more caching than ming sessions (which only cache individual objects by _id)
+
+    The added complexity here may be unnecessary premature optimization, but
+    should be quite helpful when building up many models in order, like lcd _build
+    for a series of several new commits.
     '''
 
     def __init__(self, max_instances=None, max_queries=None):


Mime
View raw message