diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -360,6 +360,16 @@ def debugbundle(ui, bundlepath, all=None return _debugbundle2(ui, gen, all=all, **opts) _debugchangegroup(ui, gen, all=all, **opts) +@command('debugcapabilities', + [], _('PATH'), + norepo=True) +def debugcapabilities(ui, path, **opts): + """lists the capabilities of a remote peer""" + peer = hg.peer(ui, opts, path) + caps = peer.capabilities() + ui.write(('Main capabilities:\n')) + for c in sorted(caps): + ui.write((' %s\n') % c) @command('debugcheckstate', [], '') def debugcheckstate(ui, repo): """validate the correctness of the current dirstate""" diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -72,6 +72,7 @@ Show debug commands if there are no othe debugapplystreamclonebundle debugbuilddag debugbundle + debugcapabilities debugcheckstate debugcolor debugcommands @@ -249,6 +250,7 @@ Show all commands + options debugapplystreamclonebundle: debugbuilddag: mergeable-file, overwritten-file, new-file debugbundle: all, part-type, spec + debugcapabilities: debugcheckstate: debugcolor: style debugcommands: diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -156,3 +156,15 @@ Test internal debugstacktrace command from h hidden in g at: debugstacktrace.py:6 in f debugstacktrace.py:9 in g + +Test debugcapabilities command: + + $ hg debugcapabilities ./debugrevlog/ + Main capabilities: + branchmap + bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Aphases%3Dheads%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps + getbundle + known + lookup + pushkey + unbundle diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -895,6 +895,8 @@ Test list of internal help commands builds a repo with a given DAG from scratch in the current empty repo debugbundle lists the contents of a bundle + debugcapabilities + lists the capabilities of a remote peer debugcheckstate validate the correctness of the current dirstate debugcolor show available color, effects or style