[PATCH 2 of 3] merge: add debugmergestate support for _stateextras

Durham Goode durham at fb.com
Wed Jan 6 19:40:07 CST 2016


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1452130005 28800
#      Wed Jan 06 17:26:45 2016 -0800
# Node ID 7afd0e010fd8d7fea0e6339f5f280fa192c1e176
# Parent  dc35478efbae806fcee1449f27b1b92d00d14853
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).

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2777,6 +2777,17 @@ def debugmergestate(ui, repo, *args):
                          % (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')))


More information about the Mercurial-devel mailing list