diff mercurial/debugcommands.py @ 45445:766797f23f77

debugmergestate: show extras for files which are not in mergestate With recent changes and future changes, we will like to store extras information about files which were merged automatically. Hence, we will have merge extras for files which are not in the mergestate. Differential Revision: https://phab.mercurial-scm.org/D8942
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 24 Aug 2020 18:59:19 +0530
parents 4aa484efc926
children 00e4e97c6bc8
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Thu Sep 10 16:51:40 2020 +0530
+++ b/mercurial/debugcommands.py	Mon Aug 24 18:59:19 2020 +0530
@@ -2016,6 +2016,7 @@
             b'")}'
             b'{extras % "  extra: {key} = {value}\n"}'
             b'"}'
+            b'{extras % "extra: {file} ({key} = {value})\n"}'
         )
 
     ms = mergestatemod.mergestate.read(repo)
@@ -2069,6 +2070,18 @@
 
     fm_files.end()
 
+    fm_extras = fm.nested(b'extras')
+    for f, d in sorted(pycompat.iteritems(ms._stateextras)):
+        if f in ms:
+            # If file is in mergestate, we have already processed it's extras
+            continue
+        for k, v in pycompat.iteritems(d):
+            fm_extras.startitem()
+            fm_extras.data(file=f)
+            fm_extras.data(key=k)
+            fm_extras.data(value=v)
+    fm_extras.end()
+
     fm.end()