Patchwork D7832: transaction: add a `hasfinalize` method

login
register
mail settings
Submitter phabricator
Date Jan. 13, 2020, 3:06 p.m.
Message ID <73db60ec0387e266b7f54fc1a576cfb5@localhost.localdomain>
Download mbox | patch
Permalink /patch/44275/
State Not Applicable
Headers show

Comments

phabricator - Jan. 13, 2020, 3:06 p.m.
marmoute updated this revision to Diff 19170.

REPOSITORY
  rHG Mercurial

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

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