diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -451,6 +451,13 @@ self._lenbuf += len(data) self._buffer.append(data) + # If this is our special proxied file object class, log this I/O, + # since os.read() bypasses the proxy. + if isinstance(self._input, fileobjectproxy): + fn = getattr(self._input._observer, r'osread', None) + if fn: + self._input._observer.osread(data, _chunksize) + def mmapread(fp): try: fd = getattr(fp, 'fileno', lambda: fp)() @@ -503,6 +510,8 @@ def __getattribute__(self, name): ours = { + r'_observer', + # IOBase r'close', # closed if a property @@ -679,6 +688,10 @@ self.fh.write('%s> readline() -> %d' % (self.name, len(res))) self._writedata(res) + def osread(self, res, size): + self.fh.write('%s> osread(%d) -> %d' % (self.name, size, len(res))) + self._writedata(res) + def write(self, res, data): self.fh.write('%s> write(%d) -> %r' % (self.name, len(data), res)) self._writedata(data)