changeset 39678:040007cd3d81

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 17 Sep 2018 16:00:09 -0700
parents d27fde3e023e
children ebbba3ba3f66
files mercurial/transaction.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Mon Sep 17 15:57:32 2018 -0700
+++ b/mercurial/transaction.py	Mon Sep 17 16:00:09 2018 -0700
@@ -143,7 +143,7 @@
         # 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 @@
         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 @@
                 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