Show More
@@ -219,6 +219,9 b' class abstractvfs(object):' | |||
|
219 | 219 | def mkdir(self, path=None): |
|
220 | 220 | return os.mkdir(self.join(path)) |
|
221 | 221 | |
|
222 | def stat(self, path=None): | |
|
223 | return os.stat(self.join(path)) | |
|
224 | ||
|
222 | 225 | class vfs(abstractvfs): |
|
223 | 226 | '''Operate files relative to a base directory |
|
224 | 227 |
@@ -274,10 +274,10 b' def _dothybridencode(f):' | |||
|
274 | 274 | def _plainhybridencode(f): |
|
275 | 275 | return _hybridencode(f, False) |
|
276 | 276 | |
|
277 |
def _calcmode( |
|
|
277 | def _calcmode(vfs): | |
|
278 | 278 | try: |
|
279 | 279 | # files in .hg/ will be created using this mode |
|
280 |
mode = |
|
|
280 | mode = vfs.stat().st_mode | |
|
281 | 281 | # avoid some useless chmods |
|
282 | 282 | if (0777 & ~util.umask) == (0777 & mode): |
|
283 | 283 | mode = None |
@@ -293,7 +293,7 b' class basicstore(object):' | |||
|
293 | 293 | def __init__(self, path, vfstype): |
|
294 | 294 | vfs = vfstype(path) |
|
295 | 295 | self.path = vfs.base |
|
296 |
self.createmode = _calcmode( |
|
|
296 | self.createmode = _calcmode(vfs) | |
|
297 | 297 | vfs.createmode = self.createmode |
|
298 | 298 | self.vfs = scmutil.filtervfs(vfs, encodedir) |
|
299 | 299 | self.opener = self.vfs |
@@ -344,7 +344,7 b' class encodedstore(basicstore):' | |||
|
344 | 344 | def __init__(self, path, vfstype): |
|
345 | 345 | vfs = vfstype(path + '/store') |
|
346 | 346 | self.path = vfs.base |
|
347 |
self.createmode = _calcmode( |
|
|
347 | self.createmode = _calcmode(vfs) | |
|
348 | 348 | vfs.createmode = self.createmode |
|
349 | 349 | self.vfs = scmutil.filtervfs(vfs, encodefilename) |
|
350 | 350 | self.opener = self.vfs |
@@ -457,7 +457,7 b' class fncachestore(basicstore):' | |||
|
457 | 457 | vfs = vfstype(path + '/store') |
|
458 | 458 | self.path = vfs.base |
|
459 | 459 | self.pathsep = self.path + '/' |
|
460 |
self.createmode = _calcmode( |
|
|
460 | self.createmode = _calcmode(vfs) | |
|
461 | 461 | vfs.createmode = self.createmode |
|
462 | 462 | fnc = fncache(vfs) |
|
463 | 463 | self.fncache = fnc |
General Comments 0
You need to be logged in to leave comments.
Login now