# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1394527082 25200
#      Tue Mar 11 01:38:02 2014 -0700
# Node ID cdc3ac896997536e60541703d2c2cd26af03ac3d
# Parent  efbf15979538a1e32fb70bf89de7c60f8ead5909
wireproto: extract capabilities list in outside the wireproto function

Before that it was over complicated to add capabilities from an extension.

This mimic was is done for capabilities in localrepo.

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -414,9 +414,12 @@
         r.append(encodelist(b) + "\n")
     return "".join(r)
 
+
+wireprotocaps = ['lookup', 'changegroupsubset', 'branchmap', 'pushkey',
+                 'known', 'getbundle', 'unbundlehash', 'batch']
 def capabilities(repo, proto):
-    caps = ('lookup changegroupsubset branchmap pushkey known getbundle '
-            'unbundlehash batch').split()
+    # copy to prevent modification of the global list
+    caps = list(wireprotocaps)
     if _allowstream(repo.ui):
         if repo.ui.configbool('server', 'preferuncompressed', False):
             caps.append('stream-preferred')