comparison mercurial/util.py @ 1312:c9cf171f30dd

Merge with TAH
author mpm@selenic.com
date Thu, 22 Sep 2005 09:41:34 -0700
parents a6ffcebd3315 2073e5a71008
children 5f277e73778f
comparison
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)