comparison mercurial/transaction.py @ 23103:29bfa964d6d8 stable

transaction: only generate file when we actually close the transaction Before this change, the file were written for every call to `tr.close()` exposing data to reader far too early.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 17 Oct 2014 21:25:48 -0700
parents 16da812ad970
children ea5af863fbff
comparison
equal deleted inserted replaced
23102:16da812ad970 23103:29bfa964d6d8
264 return self.count > 0 264 return self.count > 0
265 265
266 @active 266 @active
267 def close(self): 267 def close(self):
268 '''commit the transaction''' 268 '''commit the transaction'''
269 self._generatefiles()
270 if self.count == 1 and self.onclose is not None: 269 if self.count == 1 and self.onclose is not None:
270 self._generatefiles()
271 self.onclose() 271 self.onclose()
272 272
273 self.count -= 1 273 self.count -= 1
274 if self.count != 0: 274 if self.count != 0:
275 return 275 return