Mercurial > hg-stable
changeset 2074:01ee43dda681
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.
author | mason@suse.com |
---|---|
date | Tue, 04 Apr 2006 16:38:43 -0400 |
parents | 1e6745f78989 |
children | 343aeefb553b |
files | mercurial/bundlerepo.py |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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