Patchwork [2,of,2] statichttprepo.httprangeheader: implement readlines

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 17, 2013, 9:41 p.m.
Message ID <3072fcfd66e7e568c176.1384724466@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/3045/
State Superseded, archived
Headers show

Comments

Siddharth Agarwal - Nov. 17, 2013, 9:41 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1384723878 28800
#      Sun Nov 17 13:31:18 2013 -0800
# Node ID 3072fcfd66e7e568c176ab0ef34865362547a9eb
# Parent  9d6ad1bb67d1290f7600f5575d2e2afb252a216d
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.

Patch

diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -54,8 +54,10 @@ 
             data = data[:bytes]
         self.pos += len(data)
         return data
+    def readlines(self):
+        return self.read().splitlines(True)
     def __iter__(self):
-        return iter(self.read().splitlines(True))
+        return iter(self.readlines())
     def close(self):
         pass