mercurial/util.py
changeset 1312 c9cf171f30dd
parent 1293 a6ffcebd3315
parent 1308 2073e5a71008
child 1320 5f277e73778f
equal deleted inserted replaced
1307:3b717f27ffea 1312:c9cf171f30dd
   513             self.buf = collector.getvalue()
   513             self.buf = collector.getvalue()
   514             self.iterempty = True
   514             self.iterempty = True
   515 
   515 
   516     def read(self, l):
   516     def read(self, l):
   517         """Read L bytes of data from the iterator of chunks of data.
   517         """Read L bytes of data from the iterator of chunks of data.
   518 	Returns less than L bytes if the iterator runs dry."""
   518         Returns less than L bytes if the iterator runs dry."""
   519         if l > len(self.buf) and not self.iterempty:
   519         if l > len(self.buf) and not self.iterempty:
   520             # Clamp to a multiple of self.targetsize
   520             # Clamp to a multiple of self.targetsize
   521             targetsize = self.targetsize * ((l // self.targetsize) + 1)
   521             targetsize = self.targetsize * ((l // self.targetsize) + 1)
   522             collector = cStringIO.StringIO()
   522             collector = cStringIO.StringIO()
   523             collector.write(self.buf)
   523             collector.write(self.buf)