mercurial/util.py
changeset 37055 8c3c47362934
parent 37047 d3a9036d9ae9
child 37081 b3079fea3838
equal deleted inserted replaced
37054:40206e227412 37055:8c3c47362934
  2561         data = self._fh.read(min(n, self._left))
  2561         data = self._fh.read(min(n, self._left))
  2562         self._left -= len(data)
  2562         self._left -= len(data)
  2563         assert self._left >= 0
  2563         assert self._left >= 0
  2564 
  2564 
  2565         return data
  2565         return data
       
  2566 
       
  2567     def readinto(self, b):
       
  2568         res = self.read(len(b))
       
  2569         if res is None:
       
  2570             return None
       
  2571 
       
  2572         b[0:len(res)] = res
       
  2573         return len(res)
  2566 
  2574 
  2567 def stringmatcher(pattern, casesensitive=True):
  2575 def stringmatcher(pattern, casesensitive=True):
  2568     """
  2576     """
  2569     accepts a string, possibly starting with 're:' or 'literal:' prefix.
  2577     accepts a string, possibly starting with 're:' or 'literal:' prefix.
  2570     returns the matcher name, pattern, and matcher function.
  2578     returns the matcher name, pattern, and matcher function.