##// END OF EJS Templates
bundlerepo: drop bundlebase wrapper function for basemap
Mads Kiilerich -
r18413:0ccb16f5 default
parent child Browse files
Show More
@@ -76,10 +76,9 b' class bundlerevlog(revlog.revlog):'
76 if rev < 0:
76 if rev < 0:
77 return False
77 return False
78 return rev in self.basemap
78 return rev in self.basemap
79 def bundlebase(self, rev):
79
80 return self.basemap[rev]
81 def _chunk(self, rev):
80 def _chunk(self, rev):
82 # Warning: in case of bundle, the diff is against bundlebase,
81 # Warning: in case of bundle, the diff is against self.basemap,
83 # not against rev - 1
82 # not against rev - 1
84 # XXX: could use some caching
83 # XXX: could use some caching
85 if not self.inbundle(rev):
84 if not self.inbundle(rev):
@@ -91,14 +90,14 b' class bundlerevlog(revlog.revlog):'
91 """return or calculate a delta between two revisions"""
90 """return or calculate a delta between two revisions"""
92 if self.inbundle(rev1) and self.inbundle(rev2):
91 if self.inbundle(rev1) and self.inbundle(rev2):
93 # hot path for bundle
92 # hot path for bundle
94 revb = self.rev(self.bundlebase(rev2))
93 revb = self.rev(self.basemap[rev2])
95 if revb == rev1:
94 if revb == rev1:
96 return self._chunk(rev2)
95 return self._chunk(rev2)
97 elif not self.inbundle(rev1) and not self.inbundle(rev2):
96 elif not self.inbundle(rev1) and not self.inbundle(rev2):
98 return revlog.revlog.revdiff(self, rev1, rev2)
97 return revlog.revlog.revdiff(self, rev1, rev2)
99
98
100 return mdiff.textdiff(self.revision(self.node(rev1)),
99 return mdiff.textdiff(self.revision(self.node(rev1)),
101 self.revision(self.node(rev2)))
100 self.revision(self.node(rev2)))
102
101
103 def revision(self, nodeorrev):
102 def revision(self, nodeorrev):
104 """return an uncompressed revision of a given node or revision
103 """return an uncompressed revision of a given node or revision
@@ -123,7 +122,7 b' class bundlerevlog(revlog.revlog):'
123 text = self._cache[2]
122 text = self._cache[2]
124 break
123 break
125 chain.append(rev)
124 chain.append(rev)
126 iter_node = self.bundlebase(rev)
125 iter_node = self.basemap[rev]
127 rev = self.rev(iter_node)
126 rev = self.rev(iter_node)
128 if text is None:
127 if text is None:
129 text = revlog.revlog.revision(self, iter_node)
128 text = revlog.revlog.revision(self, iter_node)
General Comments 0
You need to be logged in to leave comments. Login now