diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2016-03-03 15:56:40 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2016-03-03 17:11:25 +0000 |
commit | 014a029ade9a045a839ca86c35690b218098ea33 (patch) | |
tree | 4806d6cc1f0572604a4d027bf7a7141e381f85d6 /morphlib/plugins/system_manifests_plugin.py | |
parent | e8a67a7d12d2defbf975d707e7513837403d93a2 (diff) | |
download | morph-014a029ade9a045a839ca86c35690b218098ea33.tar.gz |
Get rid of the CachedRepo class (almost)
For a long time the CachedRepo class has basically been a wrapper around
the GitDir class, but with a few extra methods that don't really even
belong there.
It is now a tiny class in the localrepocache module which just keeps
track of a few extra attributes. All other functionality is provided
by the gitdir module.
This commit also removes the `git clone` approach for copying repos out
of the cache. The alternative approach implemented by
git.copy_repository() was slightly faster when I tested, so for now we
should use that everywhere. Longer term we should find out why this is
quicker than `git clone`, and fix Git itself to be fast.
Change-Id: I1686ab43253d44c3903d9a0bad8bb75528e9cf75
Diffstat (limited to 'morphlib/plugins/system_manifests_plugin.py')
-rw-r--r-- | morphlib/plugins/system_manifests_plugin.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/morphlib/plugins/system_manifests_plugin.py b/morphlib/plugins/system_manifests_plugin.py index 4444ecb3..86388737 100644 --- a/morphlib/plugins/system_manifests_plugin.py +++ b/morphlib/plugins/system_manifests_plugin.py @@ -172,7 +172,7 @@ def run_licensecheck(filename): def checkout_repo(lrc, repo, dest, ref='master'): cached = lrc.get_updated_repo(repo, ref) if not os.path.exists(dest): - cached.checkout(ref, dest) + morphlib.gitdir.checkout_from_cached_repo(repo, ref, dest) def load_lorries(dir): lorries = [] @@ -292,8 +292,8 @@ class Manifest(object): try: self.status(msg='Checking out chunk repo into %(dir)s at %(ref)s', dir=dir, ref=ref, chatty=True) - cached_repo.checkout(ref, dir) - gd = morphlib.gitdir.GitDirectory(dir) + gd = morphlib.gitdir.checkout_from_cached_repo( + cached_repo, ref, dir) gd.update_submodules(app) self.status(msg='Getting license info', chatty=True) |