mergestate: remove unnecessary recordactions() from mergestate class
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 09 Jul 2020 18:20:54 +0530
changeset 45164 7f41e824a02b
parent 45163 f69253935bf8
child 45165 01c4dccfd6b5
mergestate: remove unnecessary recordactions() from mergestate class This function is updating dirstate which sounds like not something which a method on mergestate class should do. Also this just calls another function. Lets directly call that function and remove this reducing mergestate responsibility a bit. There was single caller which is updated. Differential Revision: https://phab.mercurial-scm.org/D8737
mercurial/commands.py
mercurial/mergestate.py
--- a/mercurial/commands.py	Thu Jul 09 17:05:41 2020 +0530
+++ b/mercurial/commands.py	Thu Jul 09 18:20:54 2020 +0530
@@ -6129,7 +6129,8 @@
                     raise
 
         ms.commit()
-        ms.recordactions()
+        branchmerge = repo.dirstate.p2() != nullid
+        mergestatemod.recordupdates(repo, ms.actions(), branchmerge, None)
 
         if not didwork and pats:
             hint = None
--- a/mercurial/mergestate.py	Thu Jul 09 17:05:41 2020 +0530
+++ b/mercurial/mergestate.py	Thu Jul 09 18:20:54 2020 +0530
@@ -756,11 +756,6 @@
                 actions[action].append((f, None, b"merge result"))
         return actions
 
-    def recordactions(self):
-        """record remove/add/get actions in the dirstate"""
-        branchmerge = self._repo.dirstate.p2() != nullid
-        recordupdates(self._repo, self.actions(), branchmerge, None)
-
     def queueremove(self, f):
         """queues a file to be removed from the dirstate