From bb4c7432261aafc8682ffdcb49b76e44e9079501 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 10 Apr 2012 15:58:19 +0100 Subject: localrepocache: check every base-url before clone It should check that it doesn't already have the repository cached under a different base-url before cloning, likewise with bundles. --- morphlib/localrepocache.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'morphlib/localrepocache.py') diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py index a51a9ead..1be14555 100644 --- a/morphlib/localrepocache.py +++ b/morphlib/localrepocache.py @@ -176,7 +176,7 @@ class LocalRepoCache(object): def cache_repo(self, reponame): '''Clone the given repo into the cache. - If the repo is already clone, do nothing. + If the repo is already cloned, do nothing. ''' @@ -185,12 +185,14 @@ class LocalRepoCache(object): for repourl, path in self._base_iterate(reponame): if self._exists(path): - break + return - if (self._bundle_base_url and - self._clone_with_bundle(repourl, path)): - break + if self._bundle_base_url: + for repourl, path in self._base_iterate(reponame): + if self._clone_with_bundle(repourl, path): + return + for repourl, path in self._base_iterate(reponame): try: self._git(['clone', repourl, path]) except morphlib.execute.CommandFailure: -- cgit v1.2.1