# HG changeset patch # User mason@suse.com # Date 1144183123 14400 # Node ID 01ee43dda68136e527d23ce9e88655961a4ed3ae # Parent 1e6745f7898992d1cb74e6896a14e6f5c3401526 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. diff -r 1e6745f78989 -r 01ee43dda681 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