[Request] [+ ] D8821: merge: add removefile() to mergeresult object

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Jul 25 10:00:54 UTC 2020


pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There are cases where some further calculation makes the file not needing to be
  merged anymore and hence needs to be dropped in mergeresult object. This adds a
  function for that.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -576,6 +576,11 @@
         """
         self._actions[filename] = (action, data, message)
 
+    def removefile(self, filename):
+        """ removes a file from the mergeresult object as the file might
+        not merging anymore """
+        del self._actions[filename]
+
     @property
     def actions(self):
         return self._actions
@@ -1929,7 +1934,7 @@
                         b'prompt recreating',
                     )
                 else:
-                    del mresult.actions[f]
+                    mresult.removefile(f)
 
         # Convert to dictionary-of-lists format
         actions = mresult.actionsdict



To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200725/0f08dd67/attachment.html>


More information about the Mercurial-patches mailing list