diff mercurial/debugcommands.py @ 35015: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
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Mon Oct 30 17:46:07 2017 -0400
+++ b/mercurial/debugcommands.py	Mon Oct 30 17:08:16 2017 +0100
@@ -360,6 +360,16 @@
             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"""