##// END OF EJS Templates
transaction: pass the transaction to 'pending' callback...
Pierre-Yves David -
r23280:b01c491a default
parent child Browse files
Show More
@@ -270,7 +270,7 b' class changelog(revlog.revlog):'
270 self._nodecache = r._nodecache
270 self._nodecache = r._nodecache
271 self._chunkcache = r._chunkcache
271 self._chunkcache = r._chunkcache
272
272
273 def _writepending(self):
273 def _writepending(self, tr):
274 "create a file containing the unfinalized state for pretxnchangegroup"
274 "create a file containing the unfinalized state for pretxnchangegroup"
275 if self._delaybuf:
275 if self._delaybuf:
276 # make a temporary copy of the index
276 # make a temporary copy of the index
@@ -281,6 +281,8 b' class transaction(object):'
281 def addpending(self, category, callback):
281 def addpending(self, category, callback):
282 """add a callback to be called when the transaction is pending
282 """add a callback to be called when the transaction is pending
283
283
284 The transaction will be given as callback's first argument.
285
284 Category is a unique identifier to allow overwriting an old callback
286 Category is a unique identifier to allow overwriting an old callback
285 with a newer callback.
287 with a newer callback.
286 """
288 """
@@ -294,7 +296,7 b' class transaction(object):'
294 categories = sorted(self._pendingcallback)
296 categories = sorted(self._pendingcallback)
295 for cat in categories:
297 for cat in categories:
296 # remove callback since the data will have been flushed
298 # remove callback since the data will have been flushed
297 any = self._pendingcallback.pop(cat)()
299 any = self._pendingcallback.pop(cat)(self)
298 self._anypending = self._anypending or any
300 self._anypending = self._anypending or any
299 return self._anypending
301 return self._anypending
300
302
General Comments 0
You need to be logged in to leave comments. Login now