Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 7520:e4ab4802f261
patch: simplify linereader
author | Bartosz SKOWRON <getxsick@gmail.com> |
---|---|
date | Fri, 05 Dec 2008 14:51:50 +0100 |
parents | 8e76e9f67cb3 |
children | ca044918fdf1 |
comparison
equal
deleted
inserted
replaced
7519:992d78981cba | 7520:e4ab4802f261 |
---|---|
772 if line is not None: | 772 if line is not None: |
773 self.buf.append(line) | 773 self.buf.append(line) |
774 | 774 |
775 def readline(self): | 775 def readline(self): |
776 if self.buf: | 776 if self.buf: |
777 l = self.buf[0] | 777 return self.buf.pop(0) |
778 del self.buf[0] | |
779 return l | |
780 return self.fp.readline() | 778 return self.fp.readline() |
781 | 779 |
782 def __iter__(self): | 780 def __iter__(self): |
783 while 1: | 781 while 1: |
784 l = self.readline() | 782 l = self.readline() |