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