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

login
register
mail settings
Submitter Durham Goode
Date Jan. 7, 2016, 1:40 a.m.
Message ID <7afd0e010fd8d7fea0e6.1452130807@dev8486.prn1.facebook.com>
Download mbox | patch
Permalink /patch/12584/
State Superseded
Commit eb22def9db3b0c2feb0416c0840d018138d5aa0e
Delegated to: Martin von Zweigbergk
Headers show

Comments

Durham Goode - Jan. 7, 2016, 1:40 a.m.
# HG changeset patch
# User Durham Goode <durham@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).

Patch

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')))