diff mercurial/merge.py @ 48714:c5f05c0d1c8c

merge-actions: have an attribute for narrow safetiness This allow the core doing narrow filtering to process action without explicitely listing all possible actions. This is important to make the actions system more flexible in the future. Differential Revision: https://phab.mercurial-scm.org/D12117
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 29 Jan 2022 06:21:32 +0100
parents 5dfaca4464d1
children f1eb77dceb36
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Jan 28 15:19:58 2022 +0100
+++ b/mercurial/merge.py	Sat Jan 29 06:21:32 2022 +0100
@@ -509,17 +509,6 @@
     Raise an exception if the merge cannot be completed because the repo is
     narrowed.
     """
-    # TODO: handle with nonconflicttypes
-    nonconflicttypes = {
-        mergestatemod.ACTION_ADD,
-        mergestatemod.ACTION_ADD_MODIFIED,
-        mergestatemod.ACTION_CREATED,
-        mergestatemod.ACTION_CREATED_MERGE,
-        mergestatemod.ACTION_FORGET,
-        mergestatemod.ACTION_GET,
-        mergestatemod.ACTION_REMOVE,
-        mergestatemod.ACTION_EXEC,
-    }
     # We mutate the items in the dict during iteration, so iterate
     # over a copy.
     for f, action in mresult.filemap():
@@ -529,7 +518,7 @@
             mresult.removefile(f)  # just updating, ignore changes outside clone
         elif action[0].no_op:
             mresult.removefile(f)  # merge does not affect file
-        elif action[0] in nonconflicttypes:
+        elif action[0].narrow_safe:  # TODO: handle these cases
             msg = _(
                 b'merge affects file \'%s\' outside narrow, '
                 b'which is not yet supported'