Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
45342:150900a17ec2 | 45343:e3826f1dab60 |
---|---|
528 Filters out actions that can ignored because the repo is narrowed. | 528 Filters out actions that can ignored because the repo is narrowed. |
529 | 529 |
530 Raise an exception if the merge cannot be completed because the repo is | 530 Raise an exception if the merge cannot be completed because the repo is |
531 narrowed. | 531 narrowed. |
532 """ | 532 """ |
533 nooptypes = {b'k'} # TODO: handle with nonconflicttypes | 533 # TODO: handle with nonconflicttypes |
534 nonconflicttypes = set(b'a am c cm f g gs r e'.split()) | 534 nooptypes = {mergestatemod.ACTION_KEEP} |
535 nonconflicttypes = { | |
536 mergestatemod.ACTION_ADD, | |
537 mergestatemod.ACTION_ADD_MODIFIED, | |
538 mergestatemod.ACTION_CREATED, | |
539 mergestatemod.ACTION_CREATED_MERGE, | |
540 mergestatemod.ACTION_FORGET, | |
541 mergestatemod.ACTION_GET, | |
542 mergestatemod.ACTION_REMOVE, | |
543 mergestatemod.ACTION_EXEC, | |
544 } | |
535 # We mutate the items in the dict during iteration, so iterate | 545 # We mutate the items in the dict during iteration, so iterate |
536 # over a copy. | 546 # over a copy. |
537 for f, action in list(mresult.actions.items()): | 547 for f, action in list(mresult.actions.items()): |
538 if narrowmatch(f): | 548 if narrowmatch(f): |
539 pass | 549 pass |