From patchwork Thu Jun 22 20:52:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 5, v3] debugcommands: pass part, not read data, into _debugobsmarker() From: via Mercurial-devel X-Patchwork-Id: 21620 Message-Id: <7faa57713bec79527a90.1498164738@martinvonz.svl.corp.google.com> To: mercurial-devel@mercurial-scm.org Date: Thu, 22 Jun 2017 13:52:18 -0700 # HG changeset patch # User Martin von Zweigbergk # Date 1498151715 25200 # Thu Jun 22 10:15:15 2017 -0700 # Node ID 7faa57713bec79527a9072f5a182b1442e768e54 # Parent a81bba284bb9e8088b9922629f82dc2b3d74b2bc 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(). diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -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')),