changeset 33029:b482d80e041b

debugcommands: pass part, not read data, into _debugobsmarker() This matches how it's done for _debugchangegroup() and how we will soon do it for _debugphaseheads().
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 22 Jun 2017 10:15:15 -0700
parents bdf4227614e2
children 3e102a8dd52c
files mercurial/debugcommands.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Thu Jun 22 10:09:58 2017 -0700
+++ b/mercurial/debugcommands.py	Thu Jun 22 10:15:15 2017 -0700
@@ -289,8 +289,9 @@
             ui.write("%s%s\n" % (indent_string, hex(node)))
             chain = node
 
-def _debugobsmarkers(ui, data, indent=0, **opts):
+def _debugobsmarkers(ui, part, indent=0, **opts):
     """display version and markers contained in 'data'"""
+    data = part.read()
     indent_string = ' ' * indent
     try:
         version, markers = obsolete._readmarkers(data)
@@ -325,7 +326,7 @@
             cg = changegroup.getunbundler(version, part, 'UN')
             _debugchangegroup(ui, cg, all=all, indent=4, **opts)
         if part.type == 'obsmarkers':
-            _debugobsmarkers(ui, part.read(), indent=4, **opts)
+            _debugobsmarkers(ui, part, indent=4, **opts)
 
 @command('debugbundle',
         [('a', 'all', None, _('show all details')),