mercurial/debugcommands.py
changeset 33029 b482d80e041b
parent 33028 bdf4227614e2
child 33031 e8c8d81eb864
equal deleted inserted replaced
33028:bdf4227614e2 33029:b482d80e041b
   287         for chunkdata in iter(lambda: gen.deltachunk(chain), {}):
   287         for chunkdata in iter(lambda: gen.deltachunk(chain), {}):
   288             node = chunkdata['node']
   288             node = chunkdata['node']
   289             ui.write("%s%s\n" % (indent_string, hex(node)))
   289             ui.write("%s%s\n" % (indent_string, hex(node)))
   290             chain = node
   290             chain = node
   291 
   291 
   292 def _debugobsmarkers(ui, data, indent=0, **opts):
   292 def _debugobsmarkers(ui, part, indent=0, **opts):
   293     """display version and markers contained in 'data'"""
   293     """display version and markers contained in 'data'"""
       
   294     data = part.read()
   294     indent_string = ' ' * indent
   295     indent_string = ' ' * indent
   295     try:
   296     try:
   296         version, markers = obsolete._readmarkers(data)
   297         version, markers = obsolete._readmarkers(data)
   297     except error.UnknownVersion as exc:
   298     except error.UnknownVersion as exc:
   298         msg = "%sunsupported version: %s (%d bytes)\n"
   299         msg = "%sunsupported version: %s (%d bytes)\n"
   323         if part.type == 'changegroup':
   324         if part.type == 'changegroup':
   324             version = part.params.get('version', '01')
   325             version = part.params.get('version', '01')
   325             cg = changegroup.getunbundler(version, part, 'UN')
   326             cg = changegroup.getunbundler(version, part, 'UN')
   326             _debugchangegroup(ui, cg, all=all, indent=4, **opts)
   327             _debugchangegroup(ui, cg, all=all, indent=4, **opts)
   327         if part.type == 'obsmarkers':
   328         if part.type == 'obsmarkers':
   328             _debugobsmarkers(ui, part.read(), indent=4, **opts)
   329             _debugobsmarkers(ui, part, indent=4, **opts)
   329 
   330 
   330 @command('debugbundle',
   331 @command('debugbundle',
   331         [('a', 'all', None, _('show all details')),
   332         [('a', 'all', None, _('show all details')),
   332          ('', 'part-type', [], _('show only the named part type')),
   333          ('', 'part-type', [], _('show only the named part type')),
   333          ('', 'spec', None, _('print the bundlespec of the bundle'))],
   334          ('', 'spec', None, _('print the bundlespec of the bundle'))],