D2583: util: log readinto() I/O

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sat Mar 3 10:22:58 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG29128309c52d: util: log readinto() I/O (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2583?vs=6427&id=6431

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, durin42
Cc: mercurial-devel


More information about the Mercurial-devel mailing list