dirstate: simplify some methods' decorator
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 16 Feb 2023 02:22:13 +0100
changeset 50075 8eb460e0a202
parent 50074 a2def50142ea
child 50076 63c4e9639753
dirstate: simplify some methods' decorator Since `changing_parents` and `changing_files` are mutually exclusive, having both `@requires_changing_files` and `@requires_not_changing_parents` on a method is redundant.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Feb 16 02:19:56 2023 +0100
+++ b/mercurial/dirstate.py	Thu Feb 16 02:22:13 2023 +0100
@@ -555,7 +555,6 @@
     def copies(self):
         return self._map.copymap
 
-    @requires_not_changing_parents
     @requires_changing_files
     def set_tracked(self, filename, reset_copy=False):
         """a "public" method for generic code to mark a file as tracked
@@ -578,7 +577,6 @@
             self._dirty_tracked_set = True
         return pre_tracked
 
-    @requires_not_changing_parents
     @requires_changing_files
     def set_untracked(self, filename):
         """a "public" method for generic code to mark a file as untracked