Index: cms/sources.py |
=================================================================== |
--- a/cms/sources.py |
+++ b/cms/sources.py |
@@ -211,6 +211,8 @@ |
command = ["hg", "-R", repo, "id", "-n", "-r", "default"] |
self.version = subprocess.check_output(command).strip() |
+ self._origin = urlparse.urlsplit(repo).path.strip('/') |
Wladimir Palant
2015/04/30 15:45:09
|hg archive| won't work for remote repositories, s
Sebastian Noack
2015/04/30 18:09:19
Fixed. Note that urlparse.urlsplit() did actually
|
+ |
def __enter__(self): |
return self |
@@ -240,6 +242,10 @@ |
if filename.startswith(prefix): |
yield filename[len(prefix):] |
+ if os.name == "posix": |
+ def get_cache_dir(self): |
+ return "/var/cache/" + self._origin |
+ |
class FileSource(Source): |
def __init__(self, dir): |
self._dir = dir |
@@ -280,3 +286,6 @@ |
do_list(path, relpath + filename + "/") |
do_list(self.get_path(subdir), "") |
return result |
+ |
+ def get_cache_dir(self): |
+ return os.path.join(self._dir, "cache") |