# HG changeset patch # User Pierre-Yves David # Date 1643383541 -3600 # Node ID b0aa9b0b9c21cbd39f15b937d063bfd4000a32ad # Parent d536d4afe003734a568105889fd5efcaa0b0f53f convert: use the merge action constant The constant exists, lets use them. Otherwise we cannot make these constant more powerful. Differential Revision: https://phab.mercurial-scm.org/D12113 diff -r d536d4afe003 -r b0aa9b0b9c21 hgext/convert/hg.py --- a/hgext/convert/hg.py Fri Jan 28 16:11:42 2022 +0100 +++ b/hgext/convert/hg.py Fri Jan 28 16:25:41 2022 +0100 @@ -38,6 +38,7 @@ lock as lockmod, logcmdutil, merge as mergemod, + mergestate, phases, pycompat, util, @@ -241,7 +242,7 @@ # If the file requires actual merging, abort. We don't have enough # context to resolve merges correctly. - if action in [b'm', b'dm', b'cd', b'dc']: + if action in mergestate.CONVERT_MERGE_ACTIONS: raise error.Abort( _( b"unable to convert merge commit " @@ -250,7 +251,7 @@ ) % (file, p1ctx, p2ctx) ) - elif action == b'k': + elif action == mergestate.ACTION_KEEP: # 'keep' means nothing changed from p1 continue else: diff -r d536d4afe003 -r b0aa9b0b9c21 mercurial/mergestate.py --- a/mercurial/mergestate.py Fri Jan 28 16:11:42 2022 +0100 +++ b/mercurial/mergestate.py Fri Jan 28 16:25:41 2022 +0100 @@ -129,6 +129,15 @@ ACTION_KEEP_NEW, ) +# Used by concert to detect situation it does not like, not sure what the exact +# criteria is +CONVERT_MERGE_ACTIONS = ( + ACTION_MERGE, + ACTION_DIR_RENAME_MOVE_LOCAL, + ACTION_CHANGED_DELETED, + ACTION_DELETED_CHANGED, +) + class _mergestate_base(object): """track 3-way merge state of individual files