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
--- 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)