Patchwork D7832: transaction: add a `hasfinalize` method

login
register
mail settings
Submitter phabricator
Date Jan. 13, 2020, 2:19 p.m.
Message ID <4637c134e35ee40b49b912e73b2ff728@localhost.localdomain>
Download mbox | patch
Permalink /patch/44272/
State Not Applicable
Headers show

Comments

phabricator - Jan. 13, 2020, 2:19 p.m.
Closed by commit rHG8e09551206f5: transaction: add a `hasfinalize` method (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7832?vs=19152&id=19167

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7832/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7832

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -456,6 +456,12 @@ 
         return self._anypending
 
     @active
+    def hasfinalize(self, category):
+        """check is a callback already exist for a category
+        """
+        return category in self._finalizecallback
+
+    @active
     def addfinalize(self, category, callback):
         """add a callback to be called when the transaction is closed