Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 34959:7ee2d859f720
debug: add a debugcapabilities commands
This new debugcommand prints the capabilities of any remote in a human friendly
way. Improved bundle2 capabilities support will be introduced in the next
changesets.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 30 Oct 2017 17:08:16 +0100 |
parents | 75979c8d4572 |
children | 762ea8a1f5e7 |
comparison
equal
deleted
inserted
replaced
34958:5910db5d1913 | 34959:7ee2d859f720 |
---|---|
358 gen = exchange.readbundle(ui, f, bundlepath) | 358 gen = exchange.readbundle(ui, f, bundlepath) |
359 if isinstance(gen, bundle2.unbundle20): | 359 if isinstance(gen, bundle2.unbundle20): |
360 return _debugbundle2(ui, gen, all=all, **opts) | 360 return _debugbundle2(ui, gen, all=all, **opts) |
361 _debugchangegroup(ui, gen, all=all, **opts) | 361 _debugchangegroup(ui, gen, all=all, **opts) |
362 | 362 |
363 @command('debugcapabilities', | |
364 [], _('PATH'), | |
365 norepo=True) | |
366 def debugcapabilities(ui, path, **opts): | |
367 """lists the capabilities of a remote peer""" | |
368 peer = hg.peer(ui, opts, path) | |
369 caps = peer.capabilities() | |
370 ui.write(('Main capabilities:\n')) | |
371 for c in sorted(caps): | |
372 ui.write((' %s\n') % c) | |
363 @command('debugcheckstate', [], '') | 373 @command('debugcheckstate', [], '') |
364 def debugcheckstate(ui, repo): | 374 def debugcheckstate(ui, repo): |
365 """validate the correctness of the current dirstate""" | 375 """validate the correctness of the current dirstate""" |
366 parent1, parent2 = repo.dirstate.parents() | 376 parent1, parent2 = repo.dirstate.parents() |
367 m1 = repo[parent1].manifest() | 377 m1 = repo[parent1].manifest() |