summaryrefslogtreecommitdiff
path: root/morphlib/localrepocache.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-04-10 15:58:19 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2012-04-11 13:10:26 +0100
commitbb4c7432261aafc8682ffdcb49b76e44e9079501 (patch)
treedd45eba21c1e899eecbae329f9e371e78693c375 /morphlib/localrepocache.py
parenta5da18141d87111eaf85825082404a447fa9bef6 (diff)
downloadmorph-bb4c7432261aafc8682ffdcb49b76e44e9079501.tar.gz
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.
Diffstat (limited to 'morphlib/localrepocache.py')
-rw-r--r--morphlib/localrepocache.py12
1 files changed, 7 insertions, 5 deletions
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: