Show More
@@ -55,10 +55,7 b' def usercachepath(ui, hash):' | |||||
55 | with the given hash. |
|
55 | with the given hash. | |
56 | This cache is used for sharing of largefiles across repositories - both |
|
56 | This cache is used for sharing of largefiles across repositories - both | |
57 | to preserve download bandwidth and storage space.''' |
|
57 | to preserve download bandwidth and storage space.''' | |
58 |
path |
|
58 | return os.path.join(_usercachedir(ui), hash) | |
59 | if path: |
|
|||
60 | return os.path.join(path, hash) |
|
|||
61 | return None |
|
|||
62 |
|
59 | |||
63 | def _usercachedir(ui): |
|
60 | def _usercachedir(ui): | |
64 | '''Return the location of the "global" largefiles cache.''' |
|
61 | '''Return the location of the "global" largefiles cache.''' | |
@@ -82,11 +79,11 b' def _usercachedir(ui):' | |||||
82 | return os.path.join(home, '.cache', longname) |
|
79 | return os.path.join(home, '.cache', longname) | |
83 | else: |
|
80 | else: | |
84 | raise error.Abort(_('unknown operating system: %s\n') % os.name) |
|
81 | raise error.Abort(_('unknown operating system: %s\n') % os.name) | |
85 | return None |
|
82 | raise error.Abort(_('unknown %s usercache location\n') % longname) | |
86 |
|
83 | |||
87 | def inusercache(ui, hash): |
|
84 | def inusercache(ui, hash): | |
88 | path = usercachepath(ui, hash) |
|
85 | path = usercachepath(ui, hash) | |
89 |
return |
|
86 | return os.path.exists(path) | |
90 |
|
87 | |||
91 | def findfile(repo, hash): |
|
88 | def findfile(repo, hash): | |
92 | path, exists = findstorepath(repo, hash) |
|
89 | path, exists = findstorepath(repo, hash) | |
@@ -261,8 +258,7 b' def copytostoreabsolute(repo, file, hash' | |||||
261 |
|
258 | |||
262 | def linktousercache(repo, hash): |
|
259 | def linktousercache(repo, hash): | |
263 | path = usercachepath(repo.ui, hash) |
|
260 | path = usercachepath(repo.ui, hash) | |
264 | if path: |
|
261 | link(storepath(repo, hash), path) | |
265 | link(storepath(repo, hash), path) |
|
|||
266 |
|
262 | |||
267 | def getstandinmatcher(repo, rmatcher=None): |
|
263 | def getstandinmatcher(repo, rmatcher=None): | |
268 | '''Return a match object that applies rmatcher to the standin directory''' |
|
264 | '''Return a match object that applies rmatcher to the standin directory''' |
General Comments 0
You need to be logged in to leave comments.
Login now