comparison mercurial/debugcommands.py @ 34960:762ea8a1f5e7

debug: print parsed bundle2 capabilities with debugcapabilities The bundle2 capabilities are hard to read in their encoded form. We parse and print them in a human friendly way.
author Boris Feld <boris.feld@octobus.net>
date Mon, 30 Oct 2017 17:09:29 +0100
parents 7ee2d859f720
children 5cbbef8d2a57
comparison
equal deleted inserted replaced
34959:7ee2d859f720 34960:762ea8a1f5e7
368 peer = hg.peer(ui, opts, path) 368 peer = hg.peer(ui, opts, path)
369 caps = peer.capabilities() 369 caps = peer.capabilities()
370 ui.write(('Main capabilities:\n')) 370 ui.write(('Main capabilities:\n'))
371 for c in sorted(caps): 371 for c in sorted(caps):
372 ui.write((' %s\n') % c) 372 ui.write((' %s\n') % c)
373 b2caps = bundle2.bundle2caps(peer)
374 if b2caps:
375 ui.write(('Bundle2 capabilities:\n'))
376 for key, values in sorted(b2caps.iteritems()):
377 ui.write((' %s\n') % key)
378 for v in values:
379 ui.write((' %s\n') % v)
380
373 @command('debugcheckstate', [], '') 381 @command('debugcheckstate', [], '')
374 def debugcheckstate(ui, repo): 382 def debugcheckstate(ui, repo):
375 """validate the correctness of the current dirstate""" 383 """validate the correctness of the current dirstate"""
376 parent1, parent2 = repo.dirstate.parents() 384 parent1, parent2 = repo.dirstate.parents()
377 m1 = repo[parent1].manifest() 385 m1 = repo[parent1].manifest()