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

Durham Goode durham at fb.com
Fri Feb 5 14:02:51 EST 2016


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1454696128 28800
#      Fri Feb 05 10:15:28 2016 -0800
# Node ID 3f5345de185eaae10a33c8c97afe3d2649b604f6
# Parent  27579dd5295a4b41960c34e33287c2e9bdfc8113
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
@@ -2813,6 +2813,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