D2583: util: log readinto() I/O
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Sat Mar 3 14:53:12 UTC 2018
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2583
AFFECTED FILES
mercurial/util.py
CHANGE DETAILS
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -749,6 +749,15 @@
self.fh.write('%s> readline() -> %d' % (self.name, len(res)))
self._writedata(res)
+ def readinto(self, res, dest):
+ if not self.reads:
+ return
+
+ self.fh.write('%s> readinto(%d) -> %r' % (self.name, len(dest),
+ res))
+ data = dest[0:res] if res is not None else b''
+ self._writedata(data)
+
def write(self, res, data):
if not self.writes:
return
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list