[Updated] D12113: convert: use the merge action constant

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Feb 4 10:30:27 UTC 2022


Closed by commit rHGb0aa9b0b9c21: convert: use the merge action constant (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12113?vs=32009&id=32071

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12113/new/

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

AFFECTED FILES
  hgext/convert/hg.py
  mercurial/mergestate.py

CHANGE DETAILS

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -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
diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -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:



To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220204/a7b3187c/attachment-0002.html>


More information about the Mercurial-patches mailing list