summaryrefslogtreecommitdiff
path: root/morphlib/localrepocache.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-01-12 13:02:59 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-01-12 13:02:59 +0000
commit28dd2ba113f40370586d693dd62e699897521ed8 (patch)
tree16032707e914bdadafea74319a510c0a7c43e7ff /morphlib/localrepocache.py
parentf3197d814a5e883f47631a4f0acfa51bd1285daf (diff)
parent7e975343c7f00e98962d2edd07ac87630c4936c4 (diff)
downloadmorph-28dd2ba113f40370586d693dd62e699897521ed8.tar.gz
Merge branch 'sam/cached-repo-cleanup'
Reviewed-By: Adam Coldrick <adam.coldrick@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
Diffstat (limited to 'morphlib/localrepocache.py')
-rw-r--r--morphlib/localrepocache.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py
index 92c5e763..9bccb20b 100644
--- a/morphlib/localrepocache.py
+++ b/morphlib/localrepocache.py
@@ -225,6 +225,11 @@ class LocalRepoCache(object):
self.fs.rename(target, path)
return self.get_repo(reponame)
+ def _new_cached_repo_instance(self, reponame, repourl,
+ path): # pragma: no cover
+ return morphlib.cachedrepo.CachedRepo(
+ self._app, reponame, repourl, path)
+
def get_repo(self, reponame):
'''Return an object representing a cached repository.'''
@@ -234,8 +239,7 @@ class LocalRepoCache(object):
repourl = self._resolver.pull_url(reponame)
path = self._cache_name(repourl)
if self.fs.exists(path):
- repo = morphlib.cachedrepo.CachedRepo(self._app, reponame,
- repourl, path)
+ repo = self._new_cached_repo_instance(reponame, repourl, path)
self._cached_repo_objects[reponame] = repo
return repo
raise NotCached(reponame)