D12115: merge-actions: gather all created action into a set
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Sat Jan 29 14:15:05 UTC 2022
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
This is mostly to demonstrate we can do this before we start adding more
specialized set.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D12115
AFFECTED FILES
mercurial/mergestate.py
CHANGE DETAILS
diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -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)
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list