From 014a029ade9a045a839ca86c35690b218098ea33 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 3 Mar 2016 15:56:40 +0000 Subject: 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 --- morphlib/plugins/diff_plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'morphlib/plugins/diff_plugin.py') diff --git a/morphlib/plugins/diff_plugin.py b/morphlib/plugins/diff_plugin.py index 9855c39f..26964df8 100644 --- a/morphlib/plugins/diff_plugin.py +++ b/morphlib/plugins/diff_plugin.py @@ -64,8 +64,8 @@ class DiffPlugin(cliapp.Plugin): ref=s.sha1) for s in (from_source, to_source)) - from_desc = from_repo.gitdir.version_guess(from_source.sha1) - to_desc = to_repo.gitdir.version_guess(to_source.sha1) + from_desc = from_repo.version_guess(from_source.sha1) + to_desc = to_repo.version_guess(to_source.sha1) self.app.output.write( '{} ref changed from {} to {}\n'.format(name, from_desc, @@ -101,7 +101,7 @@ class DiffPlugin(cliapp.Plugin): 'Convert a definition path list into a list of systems' ml = MorphologyLoader() repo = self.bc.lrc.get_updated_repo(reponame, ref=ref) - mf = MorphologyFinder(gitdir=repo.gitdir, ref=ref) + mf = MorphologyFinder(gitdir=repo, ref=ref) # We may have been given an empty set of definitions as input, in # which case we instead use every we find. if not definitions: -- cgit v1.2.1