changeset 48712:773ad0f5152d

merge-actions: gather all created action into a set This is mostly to demonstrate we can do this before we start adding more specialized set. Differential Revision: https://phab.mercurial-scm.org/D12115
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 28 Jan 2022 19:46:37 +0100
parents 9bc86adf32f6
children 5dfaca4464d1
files mercurial/mergestate.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mergestate.py	Fri Jan 28 17:08:30 2022 +0100
+++ b/mercurial/mergestate.py	Fri Jan 28 19:46:37 2022 +0100
@@ -4,6 +4,7 @@
 import errno
 import shutil
 import struct
+import weakref
 
 from .i18n import _
 from .node import (
@@ -106,8 +107,11 @@
     _short: internal representation used to identify each action
     """
 
+    ALL_ACTIONS = weakref.WeakSet()
+
     def __init__(self, short):
         self._short = short
+        self.ALL_ACTIONS.add(self)
 
     def __hash__(self):
         return hash(self._short)