summaryrefslogtreecommitdiff
path: root/morphlib/cachedrepo.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-11-12 15:58:27 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2012-11-12 17:09:44 +0000
commita5b913a83db94380fc91d15571f55cbf7b5c741b (patch)
tree9d03bffd2d010ec8f554c06e86cf2adb8bf1f632 /morphlib/cachedrepo.py
parent1cc7a313d4a7c4dd348da1aab0e3b6108b6b48b9 (diff)
downloadmorph-a5b913a83db94380fc91d15571f55cbf7b5c741b.tar.gz
Avoid caching repos that are on the local machine anyway
Currently the message is still displayed "Updating xxx" but no update is actually done.
Diffstat (limited to 'morphlib/cachedrepo.py')
-rw-r--r--morphlib/cachedrepo.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/morphlib/cachedrepo.py b/morphlib/cachedrepo.py
index c40cb657..0b5ce60f 100644
--- a/morphlib/cachedrepo.py
+++ b/morphlib/cachedrepo.py
@@ -102,6 +102,7 @@ class CachedRepo(object):
self.original_name = original_name
self.url = url
self.path = path
+ self.is_mirror = not url.startswith('file://')
def resolve_ref(self, ref):
'''Attempts to resolve a ref into its SHA1 and tree SHA1.
@@ -223,6 +224,9 @@ class CachedRepo(object):
'''
+ if not self.is_mirror:
+ return
+
try:
self._update()
except cliapp.AppException, e:
@@ -260,7 +264,8 @@ class CachedRepo(object):
def _copy_repository(self, source_dir, target_dir): # pragma: no cover
try:
- morphlib.git.copy_repository(self._runcmd, source_dir, target_dir)
+ morphlib.git.copy_repository(
+ self._runcmd, source_dir, target_dir, self.is_mirror)
except cliapp.AppException:
raise CopyError(self, target_dir)