Comments
Patch
@@ -268,11 +268,11 @@ class changelog(revlog.revlog):
self.index = r.index
self.nodemap = r.nodemap
self._nodecache = r._nodecache
self._chunkcache = r._chunkcache
- def _writepending(self):
+ def _writepending(self, tr):
"create a file containing the unfinalized state for pretxnchangegroup"
if self._delaybuf:
# make a temporary copy of the index
fp1 = self._realopener(self.indexfile)
fp2 = self._realopener(self.indexfile + ".a", "w")
@@ -279,10 +279,12 @@ class transaction(object):
return self.count > 0
def addpending(self, category, callback):
"""add a callback to be called when the transaction is pending
+ The transaction will be given as callback first argument.
+
Category is a unique identifier to allow overwriting an old callback
with a newer callback.
"""
self._pendingcallback[category] = callback
@@ -292,11 +294,11 @@ class transaction(object):
This is used to allow hooks to view a transaction before commit'''
categories = sorted(self._pendingcallback)
for cat in categories:
# remove callback since the data will have been flushed
- any = self._pendingcallback.pop(cat)()
+ any = self._pendingcallback.pop(cat)(self)
self._anypending = self._anypending or any
return self._anypending
@active
def addfinalize(self, category, callback):