comparison hgext/evolve.py @ 1080:41d2555141ea

evolve: allow read() from the magic StringIO
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 27 Aug 2014 17:24:40 +0200
parents e8f49b32e95b
children dddb8a70437c
comparison
equal deleted inserted replaced
1079:e8f49b32e95b 1080:41d2555141ea
2394 2394
2395 @util.propertycache 2395 @util.propertycache
2396 def length(self): 2396 def length(self):
2397 return len(self.getvalue()) 2397 return len(self.getvalue())
2398 2398
2399 def read(self, size): 2399 def read(self, size=None):
2400 obsexcprg(self.ui, self.tell(), unit="bytes", total=self.length) 2400 obsexcprg(self.ui, self.tell(), unit="bytes", total=self.length)
2401 return StringIO.read(self, size) 2401 return StringIO.read(self, size)
2402 2402
2403 def __iter__(self): 2403 def __iter__(self):
2404 d = self.read(4096) 2404 d = self.read(4096)