mercurial/dirstate.py
changeset 50022 e333cc169c45
parent 50021 4e955a7a6a55
child 50023 e1cff85484e2
--- a/mercurial/dirstate.py	Thu Jan 26 15:50:36 2023 +0100
+++ b/mercurial/dirstate.py	Mon Jan 30 19:21:34 2023 +0100
@@ -68,7 +68,7 @@
 
 def requires_changing_parents(func):
     def wrap(self, *args, **kwargs):
-        if not self.pendingparentchange():
+        if not self.is_changing_parents:
             msg = 'calling `%s` outside of a changing_parents context'
             msg %= func.__name__
             raise error.ProgrammingError(msg)
@@ -82,7 +82,7 @@
 
 def requires_not_changing_parents(func):
     def wrap(self, *args, **kwargs):
-        if self.pendingparentchange():
+        if self.is_changing_parents:
             msg = 'calling `%s` inside of a changing_parents context'
             msg %= func.__name__
             raise error.ProgrammingError(msg)
@@ -206,6 +206,14 @@
         """Returns true if the dirstate is in the middle of a set of changes
         that modify the dirstate parent.
         """
+        self._ui.deprecwarn(b"dirstate.is_changing_parents", b"6.5")
+        return self.is_changing_parents
+
+    @property
+    def is_changing_parents(self):
+        """Returns true if the dirstate is in the middle of a set of changes
+        that modify the dirstate parent.
+        """
         return self._changing_level > 0
 
     @propertycache