static-http: disable lazy parsing
authorMatt Mackall <mpm@selenic.com>
Tue, 11 May 2010 16:28:09 -0500
changeset 11155 245a67fe2574
parent 11153 9936ed1d04f4
child 11156 b203a95fe68b
static-http: disable lazy parsing This only hits if you're crazy enough to use static-http on a repository with revlogs larger than 1M. Don't do it.
mercurial/revlog.py
mercurial/statichttprepo.py
--- a/mercurial/revlog.py	Sun May 02 21:56:25 2010 -0400
+++ b/mercurial/revlog.py	Tue May 11 16:28:09 2010 -0500
@@ -444,7 +444,10 @@
         i = ''
         try:
             f = self.opener(self.indexfile)
-            i = f.read(_prereadsize)
+            if "nonlazy" in getattr(self.opener, 'options', {}):
+                i = f.read()
+            else:
+                i = f.read(_prereadsize)
             if len(i) > 0:
                 v = struct.unpack(versionformat, i[:4])[0]
         except IOError, inst:
--- a/mercurial/statichttprepo.py	Sun May 02 21:56:25 2010 -0400
+++ b/mercurial/statichttprepo.py	Tue May 11 16:28:09 2010 -0500
@@ -77,6 +77,7 @@
             return httprangereader(f, urlopener)
         return o
 
+    opener.options = {'nonlazy': 1}
     return opener
 
 class statichttprepository(localrepo.localrepository):