# HG changeset patch # User Gregory Szorc # Date 2018-09-17 23:00:09 # Node ID 040007cd3d81534d7e7890c931dca84e0d8046a2 # Parent d27fde3e023e90b14dd6d7330fa22de03757c670 transaction: make releasefn a private attribute This is a handle on a callable that is called when the journal is closed. The value is specified at __init__ time. It doesn't need to be exposed on the public interface. So mark it as private. Differential Revision: https://phab.mercurial-scm.org/D4626 diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -143,7 +143,7 @@ class transaction(util.transactional): # A callback to do something just after releasing transaction. if releasefn is None: releasefn = lambda tr, success: None - self.releasefn = releasefn + self._releasefn = releasefn self.checkambigfiles = set() if checkambigfiles: @@ -513,8 +513,8 @@ class transaction(util.transactional): self._backupentries = [] self._journal = None - self.releasefn(self, True) # notify success of closing transaction - self.releasefn = None # Help prevent cycles. + self._releasefn(self, True) # notify success of closing transaction + self._releasefn = None # Help prevent cycles. # run post close action categories = sorted(self._postclosecallback) @@ -586,8 +586,8 @@ class transaction(util.transactional): self.report(_("rollback failed - please run hg recover\n")) finally: self._journal = None - self.releasefn(self, False) # notify failure of transaction - self.releasefn = None # Help prevent cycles. + self._releasefn(self, False) # notify failure of transaction + self._releasefn = None # Help prevent cycles. def rollback(opener, vfsmap, file, report, checkambigfiles=None): """Rolls back the transaction contained in the given file