Show More
@@ -91,22 +91,28 def usercachepath(ui, hash): | |||
|
91 | 91 | else: |
|
92 | 92 | if os.name == 'nt': |
|
93 | 93 | appdata = os.getenv('LOCALAPPDATA', os.getenv('APPDATA')) |
|
94 | path = os.path.join(appdata, longname, hash) | |
|
94 | if appdata: | |
|
95 | path = os.path.join(appdata, longname, hash) | |
|
95 | 96 | elif platform.system() == 'Darwin': |
|
96 |
|
|
|
97 | longname, hash) | |
|
97 | home = os.getenv('HOME') | |
|
98 | if home: | |
|
99 | path = os.path.join(home, 'Library', 'Caches', | |
|
100 | longname, hash) | |
|
98 | 101 | elif os.name == 'posix': |
|
99 | 102 | path = os.getenv('XDG_CACHE_HOME') |
|
100 | 103 | if path: |
|
101 | 104 | path = os.path.join(path, longname, hash) |
|
102 | 105 | else: |
|
103 |
|
|
|
106 | home = os.getenv('HOME') | |
|
107 | if home: | |
|
108 | path = os.path.join(home, '.cache', longname, hash) | |
|
104 | 109 | else: |
|
105 | 110 | raise util.Abort(_('unknown operating system: %s\n') % os.name) |
|
106 | 111 | return path |
|
107 | 112 | |
|
108 | 113 | def inusercache(ui, hash): |
|
109 |
|
|
|
114 | path = usercachepath(ui, hash) | |
|
115 | return path and os.path.exists(path) | |
|
110 | 116 | |
|
111 | 117 | def findfile(repo, hash): |
|
112 | 118 | if instore(repo, hash): |
@@ -239,8 +245,10 def copytostoreabsolute(repo, file, hash | |||
|
239 | 245 | linktousercache(repo, hash) |
|
240 | 246 | |
|
241 | 247 | def linktousercache(repo, hash): |
|
242 |
|
|
|
243 | link(storepath(repo, hash), usercachepath(repo.ui, hash)) | |
|
248 | path = usercachepath(repo.ui, hash) | |
|
249 | if path: | |
|
250 | util.makedirs(os.path.dirname(path)) | |
|
251 | link(storepath(repo, hash), path) | |
|
244 | 252 | |
|
245 | 253 | def getstandinmatcher(repo, pats=[], opts={}): |
|
246 | 254 | '''Return a match object that applies pats to the standin directory''' |
General Comments 0
You need to be logged in to leave comments.
Login now