From patchwork Thu Jan 16 19:20:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7833: transaction: allow finalizer to add finalizer From: phabricator X-Patchwork-Id: 44450 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Thu, 16 Jan 2020 19:20:21 +0000 Closed by commit rHG2f1d6180737f: transaction: allow finalizer to add finalizer (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/D7833?vs=19153&id=19378 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7833/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7833 AFFECTED FILES mercurial/transaction.py CHANGE DETAILS To: marmoute, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -506,9 +506,12 @@ self._validator(self) # will raise exception if needed self._validator = None # Help prevent cycles. self._generatefiles(group=gengroupprefinalize) - categories = sorted(self._finalizecallback) - for cat in categories: - self._finalizecallback[cat](self) + while self._finalizecallback: + callbacks = self._finalizecallback + self._finalizecallback = {} + categories = sorted(callbacks) + for cat in categories: + callbacks[cat](self) # Prevent double usage and help clear cycles. self._finalizecallback = None self._generatefiles(group=gengrouppostfinalize)