Mercurial > hg
diff mercurial/merge.py @ 45343:e3826f1dab60
merge: use ACTION_* constants instead of values in _filternarrowactions()
It makes easier to check what noconflicttypes are and which are not included.
I hope we can have a state where we always use ACTION_* constants instead of
these values which are very hard to understand.
Differential Revision: https://phab.mercurial-scm.org/D8885
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 05 Aug 2020 14:03:59 +0530 |
parents | 150900a17ec2 |
children | 4c6004afd836 |
line wrap: on
line diff
--- a/mercurial/merge.py Wed Aug 05 13:50:49 2020 +0530 +++ b/mercurial/merge.py Wed Aug 05 14:03:59 2020 +0530 @@ -530,8 +530,18 @@ Raise an exception if the merge cannot be completed because the repo is narrowed. """ - nooptypes = {b'k'} # TODO: handle with nonconflicttypes - nonconflicttypes = set(b'a am c cm f g gs r e'.split()) + # TODO: handle with nonconflicttypes + nooptypes = {mergestatemod.ACTION_KEEP} + 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 list(mresult.actions.items()):