Show More
@@ -50,7 +50,7 b' class bundlerevlog(revlog.revlog):' | |||||
50 | continue |
|
50 | continue | |
51 | for p in (p1, p2): |
|
51 | for p in (p1, p2): | |
52 | if not p in self.nodemap: |
|
52 | if not p in self.nodemap: | |
53 | raise RevlogError(_("unknown parent %s") % short(p1)) |
|
53 | raise revlog.RevlogError(_("unknown parent %s") % short(p1)) | |
54 | if linkmapper is None: |
|
54 | if linkmapper is None: | |
55 | link = n |
|
55 | link = n | |
56 | else: |
|
56 | else: | |
@@ -76,12 +76,12 b' class bundlerevlog(revlog.revlog):' | |||||
76 | return False |
|
76 | return False | |
77 | return rev in self.basemap |
|
77 | return rev in self.basemap | |
78 | def bundlebase(self, rev): return self.basemap[rev] |
|
78 | def bundlebase(self, rev): return self.basemap[rev] | |
79 | def chunk(self, rev, df=None): |
|
79 | def chunk(self, rev, df=None, cachelen=4096): | |
80 | # Warning: in case of bundle, the diff is against bundlebase, |
|
80 | # Warning: in case of bundle, the diff is against bundlebase, | |
81 | # not against rev - 1 |
|
81 | # not against rev - 1 | |
82 | # XXX: could use some caching |
|
82 | # XXX: could use some caching | |
83 | if not self.bundle(rev): |
|
83 | if not self.bundle(rev): | |
84 | return revlog.revlog.chunk(self, rev) |
|
84 | return revlog.revlog.chunk(self, rev, df, cachelen) | |
85 | self.bundlefile.seek(self.start(rev)) |
|
85 | self.bundlefile.seek(self.start(rev)) | |
86 | return self.bundlefile.read(self.length(rev)) |
|
86 | return self.bundlefile.read(self.length(rev)) | |
87 |
|
87 | |||
@@ -123,7 +123,7 b' class bundlerevlog(revlog.revlog):' | |||||
123 |
|
123 | |||
124 | p1, p2 = self.parents(node) |
|
124 | p1, p2 = self.parents(node) | |
125 | if node != revlog.hash(text, p1, p2): |
|
125 | if node != revlog.hash(text, p1, p2): | |
126 | raise RevlogError(_("integrity check failed on %s:%d") |
|
126 | raise revlog.RevlogError(_("integrity check failed on %s:%d") | |
127 | % (self.datafile, self.rev(node))) |
|
127 | % (self.datafile, self.rev(node))) | |
128 |
|
128 | |||
129 | self.cache = (node, self.rev(node), text) |
|
129 | self.cache = (node, self.rev(node), text) | |
@@ -160,7 +160,6 b' class bundlerepository(localrepo.localre' | |||||
160 | def __init__(self, ui, path, bundlename): |
|
160 | def __init__(self, ui, path, bundlename): | |
161 | localrepo.localrepository.__init__(self, ui, path) |
|
161 | localrepo.localrepository.__init__(self, ui, path) | |
162 | f = open(bundlename, "rb") |
|
162 | f = open(bundlename, "rb") | |
163 | s = util.fstat(f) |
|
|||
164 | self.bundlefile = f |
|
163 | self.bundlefile = f | |
165 | header = self.bundlefile.read(6) |
|
164 | header = self.bundlefile.read(6) | |
166 | if not header.startswith("HG"): |
|
165 | if not header.startswith("HG"): |
General Comments 0
You need to be logged in to leave comments.
Login now