Patchwork D8737: mergestate: remove unnecessary recordactions() from mergestate class

login
register
mail settings
Submitter phabricator
Date July 14, 2020, 12:31 p.m.
Message ID <differential-rev-PHID-DREV-tmt6of7exki22qnekdmj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46723/
State Superseded
Headers show

Comments

phabricator - July 14, 2020, 12:31 p.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8737

AFFECTED FILES
  mercurial/commands.py
  mercurial/mergestate.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -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
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6128,7 +6128,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