Mercurial > hg
comparison mercurial/store.py @ 17653:dacb50696b75
store: initialize "vfs" fields by "vfs" constructors
For backwards compatibility, "opener" fields are still left as aliases
for "vfs" ones.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 31 Aug 2012 02:06:29 +0900 |
parents | 2c6f7231becc |
children | 0c6de45e1212 |
comparison
equal
deleted
inserted
replaced
17652:2c6f7231becc | 17653:dacb50696b75 |
---|---|
291 def __init__(self, path, vfstype): | 291 def __init__(self, path, vfstype): |
292 self.path = path | 292 self.path = path |
293 self.createmode = _calcmode(path) | 293 self.createmode = _calcmode(path) |
294 vfs = vfstype(self.path) | 294 vfs = vfstype(self.path) |
295 vfs.createmode = self.createmode | 295 vfs.createmode = self.createmode |
296 self.opener = scmutil.filteropener(vfs, encodedir) | 296 self.vfs = scmutil.filtervfs(vfs, encodedir) |
297 self.opener = self.vfs | |
297 | 298 |
298 def join(self, f): | 299 def join(self, f): |
299 return self.path + '/' + encodedir(f) | 300 return self.path + '/' + encodedir(f) |
300 | 301 |
301 def _walk(self, relpath, recurse): | 302 def _walk(self, relpath, recurse): |
341 def __init__(self, path, vfstype): | 342 def __init__(self, path, vfstype): |
342 self.path = path + '/store' | 343 self.path = path + '/store' |
343 self.createmode = _calcmode(self.path) | 344 self.createmode = _calcmode(self.path) |
344 vfs = vfstype(self.path) | 345 vfs = vfstype(self.path) |
345 vfs.createmode = self.createmode | 346 vfs.createmode = self.createmode |
346 self.opener = scmutil.filteropener(vfs, encodefilename) | 347 self.vfs = scmutil.filtervfs(vfs, encodefilename) |
348 self.opener = self.vfs | |
347 | 349 |
348 def datafiles(self): | 350 def datafiles(self): |
349 for a, b, size in self._walk('data', True): | 351 for a, b, size in self._walk('data', True): |
350 try: | 352 try: |
351 a = decodefilename(a) | 353 a = decodefilename(a) |
449 self.createmode = _calcmode(self.path) | 451 self.createmode = _calcmode(self.path) |
450 vfs = vfstype(self.path) | 452 vfs = vfstype(self.path) |
451 vfs.createmode = self.createmode | 453 vfs.createmode = self.createmode |
452 fnc = fncache(vfs) | 454 fnc = fncache(vfs) |
453 self.fncache = fnc | 455 self.fncache = fnc |
454 self.opener = _fncachevfs(vfs, fnc, encode) | 456 self.vfs = _fncachevfs(vfs, fnc, encode) |
457 self.opener = self.vfs | |
455 | 458 |
456 def join(self, f): | 459 def join(self, f): |
457 return self.pathsep + self.encode(f) | 460 return self.pathsep + self.encode(f) |
458 | 461 |
459 def getsize(self, path): | 462 def getsize(self, path): |