# HG changeset patch # User Pierre-Yves David # Date 1643395597 -3600 # Node ID 773ad0f5152d934c7ea019dcb251e1a12a8889d0 # Parent 9bc86adf32f685f924de80c3e23084653c866a56 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 diff -r 9bc86adf32f6 -r 773ad0f5152d mercurial/mergestate.py --- 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)