379 return self.vfs.join(self._filter(path)) |
379 return self.vfs.join(self._filter(path)) |
380 else: |
380 else: |
381 return self.vfs.join(path) |
381 return self.vfs.join(path) |
382 |
382 |
383 filteropener = filtervfs |
383 filteropener = filtervfs |
|
384 |
|
385 class readonlyvfs(abstractvfs, auditvfs): |
|
386 '''Wrapper vfs preventing any writing.''' |
|
387 |
|
388 def __init__(self, vfs): |
|
389 auditvfs.__init__(self, vfs) |
|
390 |
|
391 def __call__(self, path, mode='r', *args, **kw): |
|
392 if mode not in ('r', 'rb'): |
|
393 raise util.Abort('this vfs is read only') |
|
394 return self.vfs(path, mode, *args, **kw) |
|
395 |
384 |
396 |
385 def canonpath(root, cwd, myname, auditor=None): |
397 def canonpath(root, cwd, myname, auditor=None): |
386 '''return the canonical path of myname, given cwd and root''' |
398 '''return the canonical path of myname, given cwd and root''' |
387 if util.endswithsep(root): |
399 if util.endswithsep(root): |
388 rootsep = root |
400 rootsep = root |