comparison mercurial/transaction.py @ 27924:24361fb68cba stable

transaction: abort transaction during hook exception The new transaction context did not handle the case where an exception during close should still call release. This cause pretxnclose hooks that failed to cause the transaction to fail without aborting, thus requiring a hg recover. I've added a test.
author Durham Goode <durham@fb.com>
date Tue, 19 Jan 2016 15:18:21 -0800
parents b2145c195f24
children a5009789960c
comparison
equal deleted inserted replaced
27923:f62dea3f3697 27924:24361fb68cba
335 335
336 def __enter__(self): 336 def __enter__(self):
337 return self 337 return self
338 338
339 def __exit__(self, exc_type, exc_val, exc_tb): 339 def __exit__(self, exc_type, exc_val, exc_tb):
340 if exc_type is None: 340 try:
341 self.close() 341 if exc_type is None:
342 self.release() 342 self.close()
343 finally:
344 self.release()
343 345
344 def running(self): 346 def running(self):
345 return self.count > 0 347 return self.count > 0
346 348
347 def addpending(self, category, callback): 349 def addpending(self, category, callback):