From aa47f79da62be1320c0b975edb55054b24448d7f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 9 Apr 2012 18:19:16 +0100 Subject: Remove downloaded bundle after it has been cloned --- morphlib/localrepocache.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'morphlib/localrepocache.py') diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py index 9beba4af..c6ede082 100644 --- a/morphlib/localrepocache.py +++ b/morphlib/localrepocache.py @@ -117,6 +117,15 @@ class LocalRepoCache(object): source_handle.close() target_handle.close() + def _remove(self, filename): # pragma: no cover + '''Remove given file. + + This method is meant to be overridden by unit tests. + + ''' + + os.remove(filename) + def _escape(self, url): '''Escape a URL so it can be used as a basename in a file.''' @@ -152,6 +161,7 @@ class LocalRepoCache(object): bundle_path = path + '.bundle' if self._fetch(bundle_url, bundle_path): self._git(['clone', bundle_path, path]) + self._remove(bundle_path) return True else: return False -- cgit v1.2.1