diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-11-12 15:58:27 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-11-12 17:09:44 +0000 |
commit | a5b913a83db94380fc91d15571f55cbf7b5c741b (patch) | |
tree | 9d03bffd2d010ec8f554c06e86cf2adb8bf1f632 /morphlib/localrepocache.py | |
parent | 1cc7a313d4a7c4dd348da1aab0e3b6108b6b48b9 (diff) | |
download | morph-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/localrepocache.py')
-rw-r--r-- | morphlib/localrepocache.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py index ae5fa655..465e9f03 100644 --- a/morphlib/localrepocache.py +++ b/morphlib/localrepocache.py @@ -193,9 +193,13 @@ class LocalRepoCache(object): return quote_url(url) def _cache_name(self, url): - basename = self._escape(url) - path = os.path.join(self._cachedir, basename) - return path + scheme, netloc, path, query, fragment = urlparse.urlsplit(url) + if scheme == 'file': + return path + else: + basename = self._escape(url) + path = os.path.join(self._cachedir, basename) + return path def has_repo(self, reponame): '''Have we already got a cache of a given repo?''' |