diff -r 40206e227412 -r 8c3c47362934 mercurial/util.py --- 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.