merge: add debugmergestate support for _stateextras
authorDurham Goode <durham@fb.com>
Fri, 05 Feb 2016 10:15:28 -0800
changeset 28010 eb22def9db3b
parent 28009 4a25e91fa55d
child 28011 8abd9f785030
merge: add debugmergestate support for _stateextras Now that we can store extras for each file, we need to have support for showing it in debugmergestate (the tests depend on this).
mercurial/commands.py
--- a/mercurial/commands.py	Fri Feb 05 10:15:28 2016 -0800
+++ b/mercurial/commands.py	Fri Feb 05 10:15:28 2016 -0800
@@ -2813,6 +2813,17 @@
                          % (afile, _hashornull(anode)))
                 ui.write(('  other path: %s (node %s)\n')
                          % (ofile, _hashornull(onode)))
+            elif rtype == 'f':
+                filename, rawextras = record.split('\0', 1)
+                extras = rawextras.split('\0')
+                i = 0
+                extrastrings = []
+                while i < len(extras):
+                    extrastrings.append('%s = %s' % (extras[i], extras[i + 1]))
+                    i += 2
+
+                ui.write(('file extras: %s (%s)\n')
+                         % (filename, ', '.join(extrastrings)))
             else:
                 ui.write(('unrecognized entry: %s\t%s\n')
                          % (rtype, record.replace('\0', '\t')))