diff hgext/largefiles/proto.py @ 35507:95a9be56c3bb

largefiles: modernize how capabilities are added to the wire protocol See 982f13bef503, which came well after this code was originally written.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 26 Dec 2017 23:40:49 -0500
parents 576ba8194fa8
children a39a9df7ecca
line wrap: on
line diff
--- a/hgext/largefiles/proto.py	Sat Dec 23 17:49:12 2017 -0500
+++ b/hgext/largefiles/proto.py	Tue Dec 26 23:40:49 2017 -0500
@@ -28,7 +28,6 @@
                            'file.\n')
 
 # these will all be replaced by largefiles.uisetup
-capabilitiesorig = None
 ssholdcallstream = None
 httpoldcallstream = None
 
@@ -161,9 +160,11 @@
     repo.__class__ = lfileswirerepository
 
 # advertise the largefiles=serve capability
-def capabilities(repo, proto):
-    '''Wrap server command to announce largefile server capability'''
-    return capabilitiesorig(repo, proto) + ' largefiles=serve'
+def _capabilities(orig, repo, proto):
+    '''announce largefile server capability'''
+    caps = orig(repo, proto)
+    caps.append('largefiles=serve')
+    return caps
 
 def heads(repo, proto):
     '''Wrap server command - largefile capable clients will know to call