Patchwork D2583: util: log readinto() I/O

login
register
mail settings
Submitter phabricator
Date March 3, 2018, 3:22 p.m.
Message ID <42a5289e2424ede1071af1f000831a7c@localhost.localdomain>
Download mbox | patch
Permalink /patch/28784/
State Not Applicable
Headers show

Comments

phabricator - March 3, 2018, 3:22 p.m.
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




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

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