--- a/mercurial/revlog.py Sat Apr 08 20:10:46 2006 -0400
+++ b/mercurial/revlog.py Mon Apr 17 13:19:58 2006 -0400
@@ -826,7 +826,15 @@
size = fp.tell()
if size < 131072:
return
- tr.add(self.datafile, 0)
+ trinfo = tr.find(self.indexfile)
+ if trinfo == None:
+ raise RevlogError(_("%s not found in the transaction" %
+ self.indexfile))
+
+ trindex = trinfo[2]
+ dataoff = self.start(trindex)
+
+ tr.add(self.datafile, dataoff)
df = self.opener(self.datafile, 'w')
calc = struct.calcsize(self.indexformat)
for r in xrange(self.count()):
@@ -854,6 +862,8 @@
# if we don't call rename, the temp file will never replace the
# real index
fp.rename()
+
+ tr.replace(self.indexfile, trindex * calc)
self.chunkcache = None
def addrevision(self, text, transaction, link, p1=None, p2=None, d=None):
@@ -922,7 +932,7 @@
else:
f = self.opener(self.indexfile, "a+")
f.seek(0, 2)
- transaction.add(self.indexfile, f.tell())
+ transaction.add(self.indexfile, f.tell(), self.count() - 1)
if len(self.index) == 1 and self.version != 0:
l = struct.pack(versionformat, self.version)
@@ -1071,7 +1081,7 @@
ifh = self.opener(self.indexfile, "a+")
ifh.seek(0, 2)
- transaction.add(self.indexfile, ifh.tell())
+ transaction.add(self.indexfile, ifh.tell(), self.count())
if self.inlinedata():
dfh = None
else: