summaryrefslogtreecommitdiff
path: root/morphlib/buildcommand.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-11-06 15:55:19 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-01-23 10:04:08 +0000
commit88f0a35ba71044b84161e3d8d9e6bbb1314118cd (patch)
tree181afe7b3f072fea90090e17a40f90a427ce78b0 /morphlib/buildcommand.py
parent854983f275dd6b6f3f8185403f4a618e8bad8c81 (diff)
downloadmorph-88f0a35ba71044b84161e3d8d9e6bbb1314118cd.tar.gz
Add an LRU cache for resolved tree refs
This uses the PyLRU module, from: <https://pypi.python.org/pypi/pylru/1.0.6>. Python 3.2 and newer provide a built-in LRU cache, but this is specifically for in-memory use. See <http://bugs.python.org/issue17528>. Git commits are immutable, so caching information about their contents is fairly easy and trouble-free. There's no danger of the cache becoming stale.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r--morphlib/buildcommand.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index a22e689b..d121b895 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -96,6 +96,7 @@ class BuildCommand(object):
self.app.status(msg='Creating source pool', chatty=True)
srcpool = morphlib.sourceresolver.create_source_pool(
self.lrc, self.rrc, repo_name, ref, filename,
+ cachedir=self.app.settings['cachedir'],
original_ref=original_ref,
update_repos=not self.app.settings['no-git-update'],
status_cb=self.app.status)