Fix bundle repos to use an index tuple consistent with revlogng
authormason@suse.com
Tue, 04 Apr 2006 16:38:43 -0400
changeset 2074 01ee43dda681
parent 2073 1e6745f78989
child 2075 343aeefb553b
Fix bundle repos to use an index tuple consistent with revlogng The bundle repo code was adding a field to the index tuple, which confused the revlogng changes. This creates a new dict instead to maintain the extra bundle info.
mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Tue Apr 04 16:38:43 2006 -0400
+++ b/mercurial/bundlerepo.py	Tue Apr 04 16:38:43 2006 -0400
@@ -31,6 +31,7 @@
         #
         revlog.revlog.__init__(self, opener, indexfile, datafile)
         self.bundlefile = bundlefile
+        self.basemap = {}
         def chunkpositer():
             for chunk in changegroup.chunkiter(bundlefile):
                 pos = bundlefile.tell()
@@ -58,7 +59,8 @@
             if not prev:
                 prev = p1
             # start, size, base is not used, link, p1, p2, delta ref
-            e = (start, size, None, link, p1, p2, node, prev)
+            e = (start, size, None, link, p1, p2, node)
+            self.basemap[n] = prev
             self.index.append(e)
             self.nodemap[node] = n
             prev = node
@@ -68,9 +70,9 @@
         """is rev from the bundle"""
         if rev < 0:
             return False
-        return len(self.index[rev]) > 7
-    def bundlebase(self, rev): return self.index[rev][7]
-    def chunk(self, rev):
+        return rev in self.basemap
+    def bundlebase(self, rev): return self.basemap[rev]
+    def chunk(self, rev, df=None):
         # Warning: in case of bundle, the diff is against bundlebase,
         # not against rev - 1
         # XXX: could use some caching