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