Mercurial > public > mercurial-scm > hg
comparison mercurial/vfs.py @ 41091:d9b6b9ed96d8
vfs: add a `_auditpath` to abstract vfs
We are about to make `rename` audit path. Since rename lives in the
`abstractvfs` layer, we need it to be aware of auditing to some extent.
The default implementation is no-op because multiple existing vfs are not using
auditing at all right now (eg: fncachevfs).
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 26 Dec 2018 13:44:23 +0100 |
parents | c8006a25b845 |
children | 9e593db5f1a1 |
comparison
equal
deleted
inserted
replaced
41090:c8006a25b845 | 41091:d9b6b9ed96d8 |
---|---|
43 """Abstract base class; cannot be instantiated""" | 43 """Abstract base class; cannot be instantiated""" |
44 | 44 |
45 def __init__(self, *args, **kwargs): | 45 def __init__(self, *args, **kwargs): |
46 '''Prevent instantiation; don't call this from subclasses.''' | 46 '''Prevent instantiation; don't call this from subclasses.''' |
47 raise NotImplementedError('attempted instantiating ' + str(type(self))) | 47 raise NotImplementedError('attempted instantiating ' + str(type(self))) |
48 | |
49 def _auditpath(self, path, mode): | |
50 pass | |
48 | 51 |
49 def tryread(self, path): | 52 def tryread(self, path): |
50 '''gracefully return an empty string for missing files''' | 53 '''gracefully return an empty string for missing files''' |
51 try: | 54 try: |
52 return self.read(path) | 55 return self.read(path) |