Mercurial > public > mercurial-scm > hg
comparison mercurial/statichttprepo.py @ 20055:6bb9de1e4d16
statichttprepo.httprangeheader: implement readlines
bookmarks.readcurrent() requires readlines() on file objects returned from
repo.vfs. It isn't used right now but will be in upcoming patches.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 17 Nov 2013 13:31:18 -0800 |
parents | d0789ce427ac |
children | af4158b8876b |
comparison
equal
deleted
inserted
replaced
20054:d0789ce427ac | 20055:6bb9de1e4d16 |
---|---|
52 data = data[self.pos:] | 52 data = data[self.pos:] |
53 elif bytes: | 53 elif bytes: |
54 data = data[:bytes] | 54 data = data[:bytes] |
55 self.pos += len(data) | 55 self.pos += len(data) |
56 return data | 56 return data |
57 def readlines(self): | |
58 return self.read().splitlines(True) | |
57 def __iter__(self): | 59 def __iter__(self): |
58 return iter(self.read().splitlines(True)) | 60 return iter(self.readlines()) |
59 def close(self): | 61 def close(self): |
60 pass | 62 pass |
61 | 63 |
62 def build_opener(ui, authinfo): | 64 def build_opener(ui, authinfo): |
63 # urllib cannot handle URLs with embedded user or passwd | 65 # urllib cannot handle URLs with embedded user or passwd |