mercurial/util.py
changeset 37052 8c3c47362934
parent 37044 d3a9036d9ae9
child 37078 b3079fea3838
--- a/mercurial/util.py	Mon Mar 19 16:49:53 2018 -0700
+++ b/mercurial/util.py	Wed Mar 14 15:25:06 2018 -0700
@@ -2564,6 +2564,14 @@
 
         return data
 
+    def readinto(self, b):
+        res = self.read(len(b))
+        if res is None:
+            return None
+
+        b[0:len(res)] = res
+        return len(res)
+
 def stringmatcher(pattern, casesensitive=True):
     """
     accepts a string, possibly starting with 're:' or 'literal:' prefix.