##// END OF EJS Templates
revlog: fix for generaldelta distance calculation...
Friedrich Kastner-Masilko -
r17134:e7167007 default
parent child Browse files
Show More
@@ -349,6 +349,15 class revlog(object):
349 rev = base
349 rev = base
350 base = index[rev][3]
350 base = index[rev][3]
351 return base
351 return base
352 def chainlength(self, rev):
353 index = self.index
354 base = index[rev][3]
355 length = index[rev][1]
356 while base != rev:
357 rev = base
358 base = index[rev][3]
359 length = length + index[rev][1]
360 return length
352 def flags(self, rev):
361 def flags(self, rev):
353 return self.index[rev][0] & 0xFFFF
362 return self.index[rev][0] & 0xFFFF
354 def rawsize(self, rev):
363 def rawsize(self, rev):
@@ -1046,10 +1055,11 class revlog(object):
1046 chainbase = basecache[1]
1055 chainbase = basecache[1]
1047 else:
1056 else:
1048 chainbase = self.chainbase(rev)
1057 chainbase = self.chainbase(rev)
1049 dist = l + offset - self.start(chainbase)
1050 if self._generaldelta:
1058 if self._generaldelta:
1059 dist = l + self.chainlength(rev)
1051 base = rev
1060 base = rev
1052 else:
1061 else:
1062 dist = l + offset - self.start(chainbase)
1053 base = chainbase
1063 base = chainbase
1054 return dist, l, data, base, chainbase
1064 return dist, l, data, base, chainbase
1055
1065
General Comments 0
You need to be logged in to leave comments. Login now